All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.iot.DefaultIotAsyncClient Maven / Gradle / Ivy

/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */

package software.amazon.awssdk.services.iot;

import java.util.Collections;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.awscore.client.handler.AwsAsyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.core.ApiName;
import software.amazon.awssdk.core.RequestOverrideConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.client.handler.AsyncClientHandler;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.metrics.CoreMetric;
import software.amazon.awssdk.core.util.VersionInfo;
import software.amazon.awssdk.metrics.MetricCollector;
import software.amazon.awssdk.metrics.MetricPublisher;
import software.amazon.awssdk.metrics.NoOpMetricCollector;
import software.amazon.awssdk.protocols.core.ExceptionMetadata;
import software.amazon.awssdk.protocols.json.AwsJsonProtocol;
import software.amazon.awssdk.protocols.json.AwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.JsonOperationMetadata;
import software.amazon.awssdk.services.iot.model.AcceptCertificateTransferRequest;
import software.amazon.awssdk.services.iot.model.AcceptCertificateTransferResponse;
import software.amazon.awssdk.services.iot.model.AddThingToBillingGroupRequest;
import software.amazon.awssdk.services.iot.model.AddThingToBillingGroupResponse;
import software.amazon.awssdk.services.iot.model.AddThingToThingGroupRequest;
import software.amazon.awssdk.services.iot.model.AddThingToThingGroupResponse;
import software.amazon.awssdk.services.iot.model.AssociateTargetsWithJobRequest;
import software.amazon.awssdk.services.iot.model.AssociateTargetsWithJobResponse;
import software.amazon.awssdk.services.iot.model.AttachPolicyRequest;
import software.amazon.awssdk.services.iot.model.AttachPolicyResponse;
import software.amazon.awssdk.services.iot.model.AttachSecurityProfileRequest;
import software.amazon.awssdk.services.iot.model.AttachSecurityProfileResponse;
import software.amazon.awssdk.services.iot.model.AttachThingPrincipalRequest;
import software.amazon.awssdk.services.iot.model.AttachThingPrincipalResponse;
import software.amazon.awssdk.services.iot.model.CancelAuditMitigationActionsTaskRequest;
import software.amazon.awssdk.services.iot.model.CancelAuditMitigationActionsTaskResponse;
import software.amazon.awssdk.services.iot.model.CancelAuditTaskRequest;
import software.amazon.awssdk.services.iot.model.CancelAuditTaskResponse;
import software.amazon.awssdk.services.iot.model.CancelCertificateTransferRequest;
import software.amazon.awssdk.services.iot.model.CancelCertificateTransferResponse;
import software.amazon.awssdk.services.iot.model.CancelDetectMitigationActionsTaskRequest;
import software.amazon.awssdk.services.iot.model.CancelDetectMitigationActionsTaskResponse;
import software.amazon.awssdk.services.iot.model.CancelJobExecutionRequest;
import software.amazon.awssdk.services.iot.model.CancelJobExecutionResponse;
import software.amazon.awssdk.services.iot.model.CancelJobRequest;
import software.amazon.awssdk.services.iot.model.CancelJobResponse;
import software.amazon.awssdk.services.iot.model.CertificateConflictException;
import software.amazon.awssdk.services.iot.model.CertificateStateException;
import software.amazon.awssdk.services.iot.model.CertificateValidationException;
import software.amazon.awssdk.services.iot.model.ClearDefaultAuthorizerRequest;
import software.amazon.awssdk.services.iot.model.ClearDefaultAuthorizerResponse;
import software.amazon.awssdk.services.iot.model.ConfirmTopicRuleDestinationRequest;
import software.amazon.awssdk.services.iot.model.ConfirmTopicRuleDestinationResponse;
import software.amazon.awssdk.services.iot.model.ConflictException;
import software.amazon.awssdk.services.iot.model.ConflictingResourceUpdateException;
import software.amazon.awssdk.services.iot.model.CreateAuditSuppressionRequest;
import software.amazon.awssdk.services.iot.model.CreateAuditSuppressionResponse;
import software.amazon.awssdk.services.iot.model.CreateAuthorizerRequest;
import software.amazon.awssdk.services.iot.model.CreateAuthorizerResponse;
import software.amazon.awssdk.services.iot.model.CreateBillingGroupRequest;
import software.amazon.awssdk.services.iot.model.CreateBillingGroupResponse;
import software.amazon.awssdk.services.iot.model.CreateCertificateFromCsrRequest;
import software.amazon.awssdk.services.iot.model.CreateCertificateFromCsrResponse;
import software.amazon.awssdk.services.iot.model.CreateCustomMetricRequest;
import software.amazon.awssdk.services.iot.model.CreateCustomMetricResponse;
import software.amazon.awssdk.services.iot.model.CreateDimensionRequest;
import software.amazon.awssdk.services.iot.model.CreateDimensionResponse;
import software.amazon.awssdk.services.iot.model.CreateDomainConfigurationRequest;
import software.amazon.awssdk.services.iot.model.CreateDomainConfigurationResponse;
import software.amazon.awssdk.services.iot.model.CreateDynamicThingGroupRequest;
import software.amazon.awssdk.services.iot.model.CreateDynamicThingGroupResponse;
import software.amazon.awssdk.services.iot.model.CreateJobRequest;
import software.amazon.awssdk.services.iot.model.CreateJobResponse;
import software.amazon.awssdk.services.iot.model.CreateJobTemplateRequest;
import software.amazon.awssdk.services.iot.model.CreateJobTemplateResponse;
import software.amazon.awssdk.services.iot.model.CreateKeysAndCertificateRequest;
import software.amazon.awssdk.services.iot.model.CreateKeysAndCertificateResponse;
import software.amazon.awssdk.services.iot.model.CreateMitigationActionRequest;
import software.amazon.awssdk.services.iot.model.CreateMitigationActionResponse;
import software.amazon.awssdk.services.iot.model.CreateOtaUpdateRequest;
import software.amazon.awssdk.services.iot.model.CreateOtaUpdateResponse;
import software.amazon.awssdk.services.iot.model.CreatePolicyRequest;
import software.amazon.awssdk.services.iot.model.CreatePolicyResponse;
import software.amazon.awssdk.services.iot.model.CreatePolicyVersionRequest;
import software.amazon.awssdk.services.iot.model.CreatePolicyVersionResponse;
import software.amazon.awssdk.services.iot.model.CreateProvisioningClaimRequest;
import software.amazon.awssdk.services.iot.model.CreateProvisioningClaimResponse;
import software.amazon.awssdk.services.iot.model.CreateProvisioningTemplateRequest;
import software.amazon.awssdk.services.iot.model.CreateProvisioningTemplateResponse;
import software.amazon.awssdk.services.iot.model.CreateProvisioningTemplateVersionRequest;
import software.amazon.awssdk.services.iot.model.CreateProvisioningTemplateVersionResponse;
import software.amazon.awssdk.services.iot.model.CreateRoleAliasRequest;
import software.amazon.awssdk.services.iot.model.CreateRoleAliasResponse;
import software.amazon.awssdk.services.iot.model.CreateScheduledAuditRequest;
import software.amazon.awssdk.services.iot.model.CreateScheduledAuditResponse;
import software.amazon.awssdk.services.iot.model.CreateSecurityProfileRequest;
import software.amazon.awssdk.services.iot.model.CreateSecurityProfileResponse;
import software.amazon.awssdk.services.iot.model.CreateStreamRequest;
import software.amazon.awssdk.services.iot.model.CreateStreamResponse;
import software.amazon.awssdk.services.iot.model.CreateThingGroupRequest;
import software.amazon.awssdk.services.iot.model.CreateThingGroupResponse;
import software.amazon.awssdk.services.iot.model.CreateThingRequest;
import software.amazon.awssdk.services.iot.model.CreateThingResponse;
import software.amazon.awssdk.services.iot.model.CreateThingTypeRequest;
import software.amazon.awssdk.services.iot.model.CreateThingTypeResponse;
import software.amazon.awssdk.services.iot.model.CreateTopicRuleDestinationRequest;
import software.amazon.awssdk.services.iot.model.CreateTopicRuleDestinationResponse;
import software.amazon.awssdk.services.iot.model.CreateTopicRuleRequest;
import software.amazon.awssdk.services.iot.model.CreateTopicRuleResponse;
import software.amazon.awssdk.services.iot.model.DeleteAccountAuditConfigurationRequest;
import software.amazon.awssdk.services.iot.model.DeleteAccountAuditConfigurationResponse;
import software.amazon.awssdk.services.iot.model.DeleteAuditSuppressionRequest;
import software.amazon.awssdk.services.iot.model.DeleteAuditSuppressionResponse;
import software.amazon.awssdk.services.iot.model.DeleteAuthorizerRequest;
import software.amazon.awssdk.services.iot.model.DeleteAuthorizerResponse;
import software.amazon.awssdk.services.iot.model.DeleteBillingGroupRequest;
import software.amazon.awssdk.services.iot.model.DeleteBillingGroupResponse;
import software.amazon.awssdk.services.iot.model.DeleteCaCertificateRequest;
import software.amazon.awssdk.services.iot.model.DeleteCaCertificateResponse;
import software.amazon.awssdk.services.iot.model.DeleteCertificateRequest;
import software.amazon.awssdk.services.iot.model.DeleteCertificateResponse;
import software.amazon.awssdk.services.iot.model.DeleteConflictException;
import software.amazon.awssdk.services.iot.model.DeleteCustomMetricRequest;
import software.amazon.awssdk.services.iot.model.DeleteCustomMetricResponse;
import software.amazon.awssdk.services.iot.model.DeleteDimensionRequest;
import software.amazon.awssdk.services.iot.model.DeleteDimensionResponse;
import software.amazon.awssdk.services.iot.model.DeleteDomainConfigurationRequest;
import software.amazon.awssdk.services.iot.model.DeleteDomainConfigurationResponse;
import software.amazon.awssdk.services.iot.model.DeleteDynamicThingGroupRequest;
import software.amazon.awssdk.services.iot.model.DeleteDynamicThingGroupResponse;
import software.amazon.awssdk.services.iot.model.DeleteJobExecutionRequest;
import software.amazon.awssdk.services.iot.model.DeleteJobExecutionResponse;
import software.amazon.awssdk.services.iot.model.DeleteJobRequest;
import software.amazon.awssdk.services.iot.model.DeleteJobResponse;
import software.amazon.awssdk.services.iot.model.DeleteJobTemplateRequest;
import software.amazon.awssdk.services.iot.model.DeleteJobTemplateResponse;
import software.amazon.awssdk.services.iot.model.DeleteMitigationActionRequest;
import software.amazon.awssdk.services.iot.model.DeleteMitigationActionResponse;
import software.amazon.awssdk.services.iot.model.DeleteOtaUpdateRequest;
import software.amazon.awssdk.services.iot.model.DeleteOtaUpdateResponse;
import software.amazon.awssdk.services.iot.model.DeletePolicyRequest;
import software.amazon.awssdk.services.iot.model.DeletePolicyResponse;
import software.amazon.awssdk.services.iot.model.DeletePolicyVersionRequest;
import software.amazon.awssdk.services.iot.model.DeletePolicyVersionResponse;
import software.amazon.awssdk.services.iot.model.DeleteProvisioningTemplateRequest;
import software.amazon.awssdk.services.iot.model.DeleteProvisioningTemplateResponse;
import software.amazon.awssdk.services.iot.model.DeleteProvisioningTemplateVersionRequest;
import software.amazon.awssdk.services.iot.model.DeleteProvisioningTemplateVersionResponse;
import software.amazon.awssdk.services.iot.model.DeleteRegistrationCodeRequest;
import software.amazon.awssdk.services.iot.model.DeleteRegistrationCodeResponse;
import software.amazon.awssdk.services.iot.model.DeleteRoleAliasRequest;
import software.amazon.awssdk.services.iot.model.DeleteRoleAliasResponse;
import software.amazon.awssdk.services.iot.model.DeleteScheduledAuditRequest;
import software.amazon.awssdk.services.iot.model.DeleteScheduledAuditResponse;
import software.amazon.awssdk.services.iot.model.DeleteSecurityProfileRequest;
import software.amazon.awssdk.services.iot.model.DeleteSecurityProfileResponse;
import software.amazon.awssdk.services.iot.model.DeleteStreamRequest;
import software.amazon.awssdk.services.iot.model.DeleteStreamResponse;
import software.amazon.awssdk.services.iot.model.DeleteThingGroupRequest;
import software.amazon.awssdk.services.iot.model.DeleteThingGroupResponse;
import software.amazon.awssdk.services.iot.model.DeleteThingRequest;
import software.amazon.awssdk.services.iot.model.DeleteThingResponse;
import software.amazon.awssdk.services.iot.model.DeleteThingTypeRequest;
import software.amazon.awssdk.services.iot.model.DeleteThingTypeResponse;
import software.amazon.awssdk.services.iot.model.DeleteTopicRuleDestinationRequest;
import software.amazon.awssdk.services.iot.model.DeleteTopicRuleDestinationResponse;
import software.amazon.awssdk.services.iot.model.DeleteTopicRuleRequest;
import software.amazon.awssdk.services.iot.model.DeleteTopicRuleResponse;
import software.amazon.awssdk.services.iot.model.DeleteV2LoggingLevelRequest;
import software.amazon.awssdk.services.iot.model.DeleteV2LoggingLevelResponse;
import software.amazon.awssdk.services.iot.model.DeprecateThingTypeRequest;
import software.amazon.awssdk.services.iot.model.DeprecateThingTypeResponse;
import software.amazon.awssdk.services.iot.model.DescribeAccountAuditConfigurationRequest;
import software.amazon.awssdk.services.iot.model.DescribeAccountAuditConfigurationResponse;
import software.amazon.awssdk.services.iot.model.DescribeAuditFindingRequest;
import software.amazon.awssdk.services.iot.model.DescribeAuditFindingResponse;
import software.amazon.awssdk.services.iot.model.DescribeAuditMitigationActionsTaskRequest;
import software.amazon.awssdk.services.iot.model.DescribeAuditMitigationActionsTaskResponse;
import software.amazon.awssdk.services.iot.model.DescribeAuditSuppressionRequest;
import software.amazon.awssdk.services.iot.model.DescribeAuditSuppressionResponse;
import software.amazon.awssdk.services.iot.model.DescribeAuditTaskRequest;
import software.amazon.awssdk.services.iot.model.DescribeAuditTaskResponse;
import software.amazon.awssdk.services.iot.model.DescribeAuthorizerRequest;
import software.amazon.awssdk.services.iot.model.DescribeAuthorizerResponse;
import software.amazon.awssdk.services.iot.model.DescribeBillingGroupRequest;
import software.amazon.awssdk.services.iot.model.DescribeBillingGroupResponse;
import software.amazon.awssdk.services.iot.model.DescribeCaCertificateRequest;
import software.amazon.awssdk.services.iot.model.DescribeCaCertificateResponse;
import software.amazon.awssdk.services.iot.model.DescribeCertificateRequest;
import software.amazon.awssdk.services.iot.model.DescribeCertificateResponse;
import software.amazon.awssdk.services.iot.model.DescribeCustomMetricRequest;
import software.amazon.awssdk.services.iot.model.DescribeCustomMetricResponse;
import software.amazon.awssdk.services.iot.model.DescribeDefaultAuthorizerRequest;
import software.amazon.awssdk.services.iot.model.DescribeDefaultAuthorizerResponse;
import software.amazon.awssdk.services.iot.model.DescribeDetectMitigationActionsTaskRequest;
import software.amazon.awssdk.services.iot.model.DescribeDetectMitigationActionsTaskResponse;
import software.amazon.awssdk.services.iot.model.DescribeDimensionRequest;
import software.amazon.awssdk.services.iot.model.DescribeDimensionResponse;
import software.amazon.awssdk.services.iot.model.DescribeDomainConfigurationRequest;
import software.amazon.awssdk.services.iot.model.DescribeDomainConfigurationResponse;
import software.amazon.awssdk.services.iot.model.DescribeEndpointRequest;
import software.amazon.awssdk.services.iot.model.DescribeEndpointResponse;
import software.amazon.awssdk.services.iot.model.DescribeEventConfigurationsRequest;
import software.amazon.awssdk.services.iot.model.DescribeEventConfigurationsResponse;
import software.amazon.awssdk.services.iot.model.DescribeIndexRequest;
import software.amazon.awssdk.services.iot.model.DescribeIndexResponse;
import software.amazon.awssdk.services.iot.model.DescribeJobExecutionRequest;
import software.amazon.awssdk.services.iot.model.DescribeJobExecutionResponse;
import software.amazon.awssdk.services.iot.model.DescribeJobRequest;
import software.amazon.awssdk.services.iot.model.DescribeJobResponse;
import software.amazon.awssdk.services.iot.model.DescribeJobTemplateRequest;
import software.amazon.awssdk.services.iot.model.DescribeJobTemplateResponse;
import software.amazon.awssdk.services.iot.model.DescribeMitigationActionRequest;
import software.amazon.awssdk.services.iot.model.DescribeMitigationActionResponse;
import software.amazon.awssdk.services.iot.model.DescribeProvisioningTemplateRequest;
import software.amazon.awssdk.services.iot.model.DescribeProvisioningTemplateResponse;
import software.amazon.awssdk.services.iot.model.DescribeProvisioningTemplateVersionRequest;
import software.amazon.awssdk.services.iot.model.DescribeProvisioningTemplateVersionResponse;
import software.amazon.awssdk.services.iot.model.DescribeRoleAliasRequest;
import software.amazon.awssdk.services.iot.model.DescribeRoleAliasResponse;
import software.amazon.awssdk.services.iot.model.DescribeScheduledAuditRequest;
import software.amazon.awssdk.services.iot.model.DescribeScheduledAuditResponse;
import software.amazon.awssdk.services.iot.model.DescribeSecurityProfileRequest;
import software.amazon.awssdk.services.iot.model.DescribeSecurityProfileResponse;
import software.amazon.awssdk.services.iot.model.DescribeStreamRequest;
import software.amazon.awssdk.services.iot.model.DescribeStreamResponse;
import software.amazon.awssdk.services.iot.model.DescribeThingGroupRequest;
import software.amazon.awssdk.services.iot.model.DescribeThingGroupResponse;
import software.amazon.awssdk.services.iot.model.DescribeThingRegistrationTaskRequest;
import software.amazon.awssdk.services.iot.model.DescribeThingRegistrationTaskResponse;
import software.amazon.awssdk.services.iot.model.DescribeThingRequest;
import software.amazon.awssdk.services.iot.model.DescribeThingResponse;
import software.amazon.awssdk.services.iot.model.DescribeThingTypeRequest;
import software.amazon.awssdk.services.iot.model.DescribeThingTypeResponse;
import software.amazon.awssdk.services.iot.model.DetachPolicyRequest;
import software.amazon.awssdk.services.iot.model.DetachPolicyResponse;
import software.amazon.awssdk.services.iot.model.DetachSecurityProfileRequest;
import software.amazon.awssdk.services.iot.model.DetachSecurityProfileResponse;
import software.amazon.awssdk.services.iot.model.DetachThingPrincipalRequest;
import software.amazon.awssdk.services.iot.model.DetachThingPrincipalResponse;
import software.amazon.awssdk.services.iot.model.DisableTopicRuleRequest;
import software.amazon.awssdk.services.iot.model.DisableTopicRuleResponse;
import software.amazon.awssdk.services.iot.model.EnableTopicRuleRequest;
import software.amazon.awssdk.services.iot.model.EnableTopicRuleResponse;
import software.amazon.awssdk.services.iot.model.GetBehaviorModelTrainingSummariesRequest;
import software.amazon.awssdk.services.iot.model.GetBehaviorModelTrainingSummariesResponse;
import software.amazon.awssdk.services.iot.model.GetCardinalityRequest;
import software.amazon.awssdk.services.iot.model.GetCardinalityResponse;
import software.amazon.awssdk.services.iot.model.GetEffectivePoliciesRequest;
import software.amazon.awssdk.services.iot.model.GetEffectivePoliciesResponse;
import software.amazon.awssdk.services.iot.model.GetIndexingConfigurationRequest;
import software.amazon.awssdk.services.iot.model.GetIndexingConfigurationResponse;
import software.amazon.awssdk.services.iot.model.GetJobDocumentRequest;
import software.amazon.awssdk.services.iot.model.GetJobDocumentResponse;
import software.amazon.awssdk.services.iot.model.GetLoggingOptionsRequest;
import software.amazon.awssdk.services.iot.model.GetLoggingOptionsResponse;
import software.amazon.awssdk.services.iot.model.GetOtaUpdateRequest;
import software.amazon.awssdk.services.iot.model.GetOtaUpdateResponse;
import software.amazon.awssdk.services.iot.model.GetPercentilesRequest;
import software.amazon.awssdk.services.iot.model.GetPercentilesResponse;
import software.amazon.awssdk.services.iot.model.GetPolicyRequest;
import software.amazon.awssdk.services.iot.model.GetPolicyResponse;
import software.amazon.awssdk.services.iot.model.GetPolicyVersionRequest;
import software.amazon.awssdk.services.iot.model.GetPolicyVersionResponse;
import software.amazon.awssdk.services.iot.model.GetRegistrationCodeRequest;
import software.amazon.awssdk.services.iot.model.GetRegistrationCodeResponse;
import software.amazon.awssdk.services.iot.model.GetStatisticsRequest;
import software.amazon.awssdk.services.iot.model.GetStatisticsResponse;
import software.amazon.awssdk.services.iot.model.GetTopicRuleDestinationRequest;
import software.amazon.awssdk.services.iot.model.GetTopicRuleDestinationResponse;
import software.amazon.awssdk.services.iot.model.GetTopicRuleRequest;
import software.amazon.awssdk.services.iot.model.GetTopicRuleResponse;
import software.amazon.awssdk.services.iot.model.GetV2LoggingOptionsRequest;
import software.amazon.awssdk.services.iot.model.GetV2LoggingOptionsResponse;
import software.amazon.awssdk.services.iot.model.IndexNotReadyException;
import software.amazon.awssdk.services.iot.model.InternalException;
import software.amazon.awssdk.services.iot.model.InternalFailureException;
import software.amazon.awssdk.services.iot.model.InvalidAggregationException;
import software.amazon.awssdk.services.iot.model.InvalidQueryException;
import software.amazon.awssdk.services.iot.model.InvalidRequestException;
import software.amazon.awssdk.services.iot.model.InvalidResponseException;
import software.amazon.awssdk.services.iot.model.InvalidStateTransitionException;
import software.amazon.awssdk.services.iot.model.IotException;
import software.amazon.awssdk.services.iot.model.IotRequest;
import software.amazon.awssdk.services.iot.model.LimitExceededException;
import software.amazon.awssdk.services.iot.model.ListActiveViolationsRequest;
import software.amazon.awssdk.services.iot.model.ListActiveViolationsResponse;
import software.amazon.awssdk.services.iot.model.ListAttachedPoliciesRequest;
import software.amazon.awssdk.services.iot.model.ListAttachedPoliciesResponse;
import software.amazon.awssdk.services.iot.model.ListAuditFindingsRequest;
import software.amazon.awssdk.services.iot.model.ListAuditFindingsResponse;
import software.amazon.awssdk.services.iot.model.ListAuditMitigationActionsExecutionsRequest;
import software.amazon.awssdk.services.iot.model.ListAuditMitigationActionsExecutionsResponse;
import software.amazon.awssdk.services.iot.model.ListAuditMitigationActionsTasksRequest;
import software.amazon.awssdk.services.iot.model.ListAuditMitigationActionsTasksResponse;
import software.amazon.awssdk.services.iot.model.ListAuditSuppressionsRequest;
import software.amazon.awssdk.services.iot.model.ListAuditSuppressionsResponse;
import software.amazon.awssdk.services.iot.model.ListAuditTasksRequest;
import software.amazon.awssdk.services.iot.model.ListAuditTasksResponse;
import software.amazon.awssdk.services.iot.model.ListAuthorizersRequest;
import software.amazon.awssdk.services.iot.model.ListAuthorizersResponse;
import software.amazon.awssdk.services.iot.model.ListBillingGroupsRequest;
import software.amazon.awssdk.services.iot.model.ListBillingGroupsResponse;
import software.amazon.awssdk.services.iot.model.ListCaCertificatesRequest;
import software.amazon.awssdk.services.iot.model.ListCaCertificatesResponse;
import software.amazon.awssdk.services.iot.model.ListCertificatesByCaRequest;
import software.amazon.awssdk.services.iot.model.ListCertificatesByCaResponse;
import software.amazon.awssdk.services.iot.model.ListCertificatesRequest;
import software.amazon.awssdk.services.iot.model.ListCertificatesResponse;
import software.amazon.awssdk.services.iot.model.ListCustomMetricsRequest;
import software.amazon.awssdk.services.iot.model.ListCustomMetricsResponse;
import software.amazon.awssdk.services.iot.model.ListDetectMitigationActionsExecutionsRequest;
import software.amazon.awssdk.services.iot.model.ListDetectMitigationActionsExecutionsResponse;
import software.amazon.awssdk.services.iot.model.ListDetectMitigationActionsTasksRequest;
import software.amazon.awssdk.services.iot.model.ListDetectMitigationActionsTasksResponse;
import software.amazon.awssdk.services.iot.model.ListDimensionsRequest;
import software.amazon.awssdk.services.iot.model.ListDimensionsResponse;
import software.amazon.awssdk.services.iot.model.ListDomainConfigurationsRequest;
import software.amazon.awssdk.services.iot.model.ListDomainConfigurationsResponse;
import software.amazon.awssdk.services.iot.model.ListIndicesRequest;
import software.amazon.awssdk.services.iot.model.ListIndicesResponse;
import software.amazon.awssdk.services.iot.model.ListJobExecutionsForJobRequest;
import software.amazon.awssdk.services.iot.model.ListJobExecutionsForJobResponse;
import software.amazon.awssdk.services.iot.model.ListJobExecutionsForThingRequest;
import software.amazon.awssdk.services.iot.model.ListJobExecutionsForThingResponse;
import software.amazon.awssdk.services.iot.model.ListJobTemplatesRequest;
import software.amazon.awssdk.services.iot.model.ListJobTemplatesResponse;
import software.amazon.awssdk.services.iot.model.ListJobsRequest;
import software.amazon.awssdk.services.iot.model.ListJobsResponse;
import software.amazon.awssdk.services.iot.model.ListMitigationActionsRequest;
import software.amazon.awssdk.services.iot.model.ListMitigationActionsResponse;
import software.amazon.awssdk.services.iot.model.ListOtaUpdatesRequest;
import software.amazon.awssdk.services.iot.model.ListOtaUpdatesResponse;
import software.amazon.awssdk.services.iot.model.ListOutgoingCertificatesRequest;
import software.amazon.awssdk.services.iot.model.ListOutgoingCertificatesResponse;
import software.amazon.awssdk.services.iot.model.ListPoliciesRequest;
import software.amazon.awssdk.services.iot.model.ListPoliciesResponse;
import software.amazon.awssdk.services.iot.model.ListPolicyVersionsRequest;
import software.amazon.awssdk.services.iot.model.ListPolicyVersionsResponse;
import software.amazon.awssdk.services.iot.model.ListPrincipalThingsRequest;
import software.amazon.awssdk.services.iot.model.ListPrincipalThingsResponse;
import software.amazon.awssdk.services.iot.model.ListProvisioningTemplateVersionsRequest;
import software.amazon.awssdk.services.iot.model.ListProvisioningTemplateVersionsResponse;
import software.amazon.awssdk.services.iot.model.ListProvisioningTemplatesRequest;
import software.amazon.awssdk.services.iot.model.ListProvisioningTemplatesResponse;
import software.amazon.awssdk.services.iot.model.ListRoleAliasesRequest;
import software.amazon.awssdk.services.iot.model.ListRoleAliasesResponse;
import software.amazon.awssdk.services.iot.model.ListScheduledAuditsRequest;
import software.amazon.awssdk.services.iot.model.ListScheduledAuditsResponse;
import software.amazon.awssdk.services.iot.model.ListSecurityProfilesForTargetRequest;
import software.amazon.awssdk.services.iot.model.ListSecurityProfilesForTargetResponse;
import software.amazon.awssdk.services.iot.model.ListSecurityProfilesRequest;
import software.amazon.awssdk.services.iot.model.ListSecurityProfilesResponse;
import software.amazon.awssdk.services.iot.model.ListStreamsRequest;
import software.amazon.awssdk.services.iot.model.ListStreamsResponse;
import software.amazon.awssdk.services.iot.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.iot.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.iot.model.ListTargetsForPolicyRequest;
import software.amazon.awssdk.services.iot.model.ListTargetsForPolicyResponse;
import software.amazon.awssdk.services.iot.model.ListTargetsForSecurityProfileRequest;
import software.amazon.awssdk.services.iot.model.ListTargetsForSecurityProfileResponse;
import software.amazon.awssdk.services.iot.model.ListThingGroupsForThingRequest;
import software.amazon.awssdk.services.iot.model.ListThingGroupsForThingResponse;
import software.amazon.awssdk.services.iot.model.ListThingGroupsRequest;
import software.amazon.awssdk.services.iot.model.ListThingGroupsResponse;
import software.amazon.awssdk.services.iot.model.ListThingPrincipalsRequest;
import software.amazon.awssdk.services.iot.model.ListThingPrincipalsResponse;
import software.amazon.awssdk.services.iot.model.ListThingRegistrationTaskReportsRequest;
import software.amazon.awssdk.services.iot.model.ListThingRegistrationTaskReportsResponse;
import software.amazon.awssdk.services.iot.model.ListThingRegistrationTasksRequest;
import software.amazon.awssdk.services.iot.model.ListThingRegistrationTasksResponse;
import software.amazon.awssdk.services.iot.model.ListThingTypesRequest;
import software.amazon.awssdk.services.iot.model.ListThingTypesResponse;
import software.amazon.awssdk.services.iot.model.ListThingsInBillingGroupRequest;
import software.amazon.awssdk.services.iot.model.ListThingsInBillingGroupResponse;
import software.amazon.awssdk.services.iot.model.ListThingsInThingGroupRequest;
import software.amazon.awssdk.services.iot.model.ListThingsInThingGroupResponse;
import software.amazon.awssdk.services.iot.model.ListThingsRequest;
import software.amazon.awssdk.services.iot.model.ListThingsResponse;
import software.amazon.awssdk.services.iot.model.ListTopicRuleDestinationsRequest;
import software.amazon.awssdk.services.iot.model.ListTopicRuleDestinationsResponse;
import software.amazon.awssdk.services.iot.model.ListTopicRulesRequest;
import software.amazon.awssdk.services.iot.model.ListTopicRulesResponse;
import software.amazon.awssdk.services.iot.model.ListV2LoggingLevelsRequest;
import software.amazon.awssdk.services.iot.model.ListV2LoggingLevelsResponse;
import software.amazon.awssdk.services.iot.model.ListViolationEventsRequest;
import software.amazon.awssdk.services.iot.model.ListViolationEventsResponse;
import software.amazon.awssdk.services.iot.model.MalformedPolicyException;
import software.amazon.awssdk.services.iot.model.NotConfiguredException;
import software.amazon.awssdk.services.iot.model.RegisterCaCertificateRequest;
import software.amazon.awssdk.services.iot.model.RegisterCaCertificateResponse;
import software.amazon.awssdk.services.iot.model.RegisterCertificateRequest;
import software.amazon.awssdk.services.iot.model.RegisterCertificateResponse;
import software.amazon.awssdk.services.iot.model.RegisterCertificateWithoutCaRequest;
import software.amazon.awssdk.services.iot.model.RegisterCertificateWithoutCaResponse;
import software.amazon.awssdk.services.iot.model.RegisterThingRequest;
import software.amazon.awssdk.services.iot.model.RegisterThingResponse;
import software.amazon.awssdk.services.iot.model.RegistrationCodeValidationException;
import software.amazon.awssdk.services.iot.model.RejectCertificateTransferRequest;
import software.amazon.awssdk.services.iot.model.RejectCertificateTransferResponse;
import software.amazon.awssdk.services.iot.model.RemoveThingFromBillingGroupRequest;
import software.amazon.awssdk.services.iot.model.RemoveThingFromBillingGroupResponse;
import software.amazon.awssdk.services.iot.model.RemoveThingFromThingGroupRequest;
import software.amazon.awssdk.services.iot.model.RemoveThingFromThingGroupResponse;
import software.amazon.awssdk.services.iot.model.ReplaceTopicRuleRequest;
import software.amazon.awssdk.services.iot.model.ReplaceTopicRuleResponse;
import software.amazon.awssdk.services.iot.model.ResourceAlreadyExistsException;
import software.amazon.awssdk.services.iot.model.ResourceNotFoundException;
import software.amazon.awssdk.services.iot.model.ResourceRegistrationFailureException;
import software.amazon.awssdk.services.iot.model.SearchIndexRequest;
import software.amazon.awssdk.services.iot.model.SearchIndexResponse;
import software.amazon.awssdk.services.iot.model.ServiceUnavailableException;
import software.amazon.awssdk.services.iot.model.SetDefaultAuthorizerRequest;
import software.amazon.awssdk.services.iot.model.SetDefaultAuthorizerResponse;
import software.amazon.awssdk.services.iot.model.SetDefaultPolicyVersionRequest;
import software.amazon.awssdk.services.iot.model.SetDefaultPolicyVersionResponse;
import software.amazon.awssdk.services.iot.model.SetLoggingOptionsRequest;
import software.amazon.awssdk.services.iot.model.SetLoggingOptionsResponse;
import software.amazon.awssdk.services.iot.model.SetV2LoggingLevelRequest;
import software.amazon.awssdk.services.iot.model.SetV2LoggingLevelResponse;
import software.amazon.awssdk.services.iot.model.SetV2LoggingOptionsRequest;
import software.amazon.awssdk.services.iot.model.SetV2LoggingOptionsResponse;
import software.amazon.awssdk.services.iot.model.SqlParseException;
import software.amazon.awssdk.services.iot.model.StartAuditMitigationActionsTaskRequest;
import software.amazon.awssdk.services.iot.model.StartAuditMitigationActionsTaskResponse;
import software.amazon.awssdk.services.iot.model.StartDetectMitigationActionsTaskRequest;
import software.amazon.awssdk.services.iot.model.StartDetectMitigationActionsTaskResponse;
import software.amazon.awssdk.services.iot.model.StartOnDemandAuditTaskRequest;
import software.amazon.awssdk.services.iot.model.StartOnDemandAuditTaskResponse;
import software.amazon.awssdk.services.iot.model.StartThingRegistrationTaskRequest;
import software.amazon.awssdk.services.iot.model.StartThingRegistrationTaskResponse;
import software.amazon.awssdk.services.iot.model.StopThingRegistrationTaskRequest;
import software.amazon.awssdk.services.iot.model.StopThingRegistrationTaskResponse;
import software.amazon.awssdk.services.iot.model.TagResourceRequest;
import software.amazon.awssdk.services.iot.model.TagResourceResponse;
import software.amazon.awssdk.services.iot.model.TaskAlreadyExistsException;
import software.amazon.awssdk.services.iot.model.TestAuthorizationRequest;
import software.amazon.awssdk.services.iot.model.TestAuthorizationResponse;
import software.amazon.awssdk.services.iot.model.TestInvokeAuthorizerRequest;
import software.amazon.awssdk.services.iot.model.TestInvokeAuthorizerResponse;
import software.amazon.awssdk.services.iot.model.ThrottlingException;
import software.amazon.awssdk.services.iot.model.TransferAlreadyCompletedException;
import software.amazon.awssdk.services.iot.model.TransferCertificateRequest;
import software.amazon.awssdk.services.iot.model.TransferCertificateResponse;
import software.amazon.awssdk.services.iot.model.TransferConflictException;
import software.amazon.awssdk.services.iot.model.UnauthorizedException;
import software.amazon.awssdk.services.iot.model.UntagResourceRequest;
import software.amazon.awssdk.services.iot.model.UntagResourceResponse;
import software.amazon.awssdk.services.iot.model.UpdateAccountAuditConfigurationRequest;
import software.amazon.awssdk.services.iot.model.UpdateAccountAuditConfigurationResponse;
import software.amazon.awssdk.services.iot.model.UpdateAuditSuppressionRequest;
import software.amazon.awssdk.services.iot.model.UpdateAuditSuppressionResponse;
import software.amazon.awssdk.services.iot.model.UpdateAuthorizerRequest;
import software.amazon.awssdk.services.iot.model.UpdateAuthorizerResponse;
import software.amazon.awssdk.services.iot.model.UpdateBillingGroupRequest;
import software.amazon.awssdk.services.iot.model.UpdateBillingGroupResponse;
import software.amazon.awssdk.services.iot.model.UpdateCaCertificateRequest;
import software.amazon.awssdk.services.iot.model.UpdateCaCertificateResponse;
import software.amazon.awssdk.services.iot.model.UpdateCertificateRequest;
import software.amazon.awssdk.services.iot.model.UpdateCertificateResponse;
import software.amazon.awssdk.services.iot.model.UpdateCustomMetricRequest;
import software.amazon.awssdk.services.iot.model.UpdateCustomMetricResponse;
import software.amazon.awssdk.services.iot.model.UpdateDimensionRequest;
import software.amazon.awssdk.services.iot.model.UpdateDimensionResponse;
import software.amazon.awssdk.services.iot.model.UpdateDomainConfigurationRequest;
import software.amazon.awssdk.services.iot.model.UpdateDomainConfigurationResponse;
import software.amazon.awssdk.services.iot.model.UpdateDynamicThingGroupRequest;
import software.amazon.awssdk.services.iot.model.UpdateDynamicThingGroupResponse;
import software.amazon.awssdk.services.iot.model.UpdateEventConfigurationsRequest;
import software.amazon.awssdk.services.iot.model.UpdateEventConfigurationsResponse;
import software.amazon.awssdk.services.iot.model.UpdateIndexingConfigurationRequest;
import software.amazon.awssdk.services.iot.model.UpdateIndexingConfigurationResponse;
import software.amazon.awssdk.services.iot.model.UpdateJobRequest;
import software.amazon.awssdk.services.iot.model.UpdateJobResponse;
import software.amazon.awssdk.services.iot.model.UpdateMitigationActionRequest;
import software.amazon.awssdk.services.iot.model.UpdateMitigationActionResponse;
import software.amazon.awssdk.services.iot.model.UpdateProvisioningTemplateRequest;
import software.amazon.awssdk.services.iot.model.UpdateProvisioningTemplateResponse;
import software.amazon.awssdk.services.iot.model.UpdateRoleAliasRequest;
import software.amazon.awssdk.services.iot.model.UpdateRoleAliasResponse;
import software.amazon.awssdk.services.iot.model.UpdateScheduledAuditRequest;
import software.amazon.awssdk.services.iot.model.UpdateScheduledAuditResponse;
import software.amazon.awssdk.services.iot.model.UpdateSecurityProfileRequest;
import software.amazon.awssdk.services.iot.model.UpdateSecurityProfileResponse;
import software.amazon.awssdk.services.iot.model.UpdateStreamRequest;
import software.amazon.awssdk.services.iot.model.UpdateStreamResponse;
import software.amazon.awssdk.services.iot.model.UpdateThingGroupRequest;
import software.amazon.awssdk.services.iot.model.UpdateThingGroupResponse;
import software.amazon.awssdk.services.iot.model.UpdateThingGroupsForThingRequest;
import software.amazon.awssdk.services.iot.model.UpdateThingGroupsForThingResponse;
import software.amazon.awssdk.services.iot.model.UpdateThingRequest;
import software.amazon.awssdk.services.iot.model.UpdateThingResponse;
import software.amazon.awssdk.services.iot.model.UpdateTopicRuleDestinationRequest;
import software.amazon.awssdk.services.iot.model.UpdateTopicRuleDestinationResponse;
import software.amazon.awssdk.services.iot.model.ValidateSecurityProfileBehaviorsRequest;
import software.amazon.awssdk.services.iot.model.ValidateSecurityProfileBehaviorsResponse;
import software.amazon.awssdk.services.iot.model.VersionConflictException;
import software.amazon.awssdk.services.iot.model.VersionsLimitExceededException;
import software.amazon.awssdk.services.iot.paginators.GetBehaviorModelTrainingSummariesPublisher;
import software.amazon.awssdk.services.iot.paginators.ListActiveViolationsPublisher;
import software.amazon.awssdk.services.iot.paginators.ListAttachedPoliciesPublisher;
import software.amazon.awssdk.services.iot.paginators.ListAuditFindingsPublisher;
import software.amazon.awssdk.services.iot.paginators.ListAuditMitigationActionsExecutionsPublisher;
import software.amazon.awssdk.services.iot.paginators.ListAuditMitigationActionsTasksPublisher;
import software.amazon.awssdk.services.iot.paginators.ListAuditSuppressionsPublisher;
import software.amazon.awssdk.services.iot.paginators.ListAuditTasksPublisher;
import software.amazon.awssdk.services.iot.paginators.ListAuthorizersPublisher;
import software.amazon.awssdk.services.iot.paginators.ListBillingGroupsPublisher;
import software.amazon.awssdk.services.iot.paginators.ListCACertificatesPublisher;
import software.amazon.awssdk.services.iot.paginators.ListCertificatesByCAPublisher;
import software.amazon.awssdk.services.iot.paginators.ListCertificatesPublisher;
import software.amazon.awssdk.services.iot.paginators.ListCustomMetricsPublisher;
import software.amazon.awssdk.services.iot.paginators.ListDetectMitigationActionsExecutionsPublisher;
import software.amazon.awssdk.services.iot.paginators.ListDetectMitigationActionsTasksPublisher;
import software.amazon.awssdk.services.iot.paginators.ListDimensionsPublisher;
import software.amazon.awssdk.services.iot.paginators.ListDomainConfigurationsPublisher;
import software.amazon.awssdk.services.iot.paginators.ListIndicesPublisher;
import software.amazon.awssdk.services.iot.paginators.ListJobExecutionsForJobPublisher;
import software.amazon.awssdk.services.iot.paginators.ListJobExecutionsForThingPublisher;
import software.amazon.awssdk.services.iot.paginators.ListJobsPublisher;
import software.amazon.awssdk.services.iot.paginators.ListMitigationActionsPublisher;
import software.amazon.awssdk.services.iot.paginators.ListOTAUpdatesPublisher;
import software.amazon.awssdk.services.iot.paginators.ListOutgoingCertificatesPublisher;
import software.amazon.awssdk.services.iot.paginators.ListPoliciesPublisher;
import software.amazon.awssdk.services.iot.paginators.ListPrincipalThingsPublisher;
import software.amazon.awssdk.services.iot.paginators.ListProvisioningTemplateVersionsPublisher;
import software.amazon.awssdk.services.iot.paginators.ListProvisioningTemplatesPublisher;
import software.amazon.awssdk.services.iot.paginators.ListRoleAliasesPublisher;
import software.amazon.awssdk.services.iot.paginators.ListScheduledAuditsPublisher;
import software.amazon.awssdk.services.iot.paginators.ListSecurityProfilesForTargetPublisher;
import software.amazon.awssdk.services.iot.paginators.ListSecurityProfilesPublisher;
import software.amazon.awssdk.services.iot.paginators.ListStreamsPublisher;
import software.amazon.awssdk.services.iot.paginators.ListTagsForResourcePublisher;
import software.amazon.awssdk.services.iot.paginators.ListTargetsForPolicyPublisher;
import software.amazon.awssdk.services.iot.paginators.ListTargetsForSecurityProfilePublisher;
import software.amazon.awssdk.services.iot.paginators.ListThingGroupsForThingPublisher;
import software.amazon.awssdk.services.iot.paginators.ListThingGroupsPublisher;
import software.amazon.awssdk.services.iot.paginators.ListThingPrincipalsPublisher;
import software.amazon.awssdk.services.iot.paginators.ListThingRegistrationTaskReportsPublisher;
import software.amazon.awssdk.services.iot.paginators.ListThingRegistrationTasksPublisher;
import software.amazon.awssdk.services.iot.paginators.ListThingTypesPublisher;
import software.amazon.awssdk.services.iot.paginators.ListThingsInBillingGroupPublisher;
import software.amazon.awssdk.services.iot.paginators.ListThingsInThingGroupPublisher;
import software.amazon.awssdk.services.iot.paginators.ListThingsPublisher;
import software.amazon.awssdk.services.iot.paginators.ListTopicRuleDestinationsPublisher;
import software.amazon.awssdk.services.iot.paginators.ListTopicRulesPublisher;
import software.amazon.awssdk.services.iot.paginators.ListV2LoggingLevelsPublisher;
import software.amazon.awssdk.services.iot.paginators.ListViolationEventsPublisher;
import software.amazon.awssdk.services.iot.transform.AcceptCertificateTransferRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.AddThingToBillingGroupRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.AddThingToThingGroupRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.AssociateTargetsWithJobRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.AttachPolicyRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.AttachSecurityProfileRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.AttachThingPrincipalRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.CancelAuditMitigationActionsTaskRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.CancelAuditTaskRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.CancelCertificateTransferRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.CancelDetectMitigationActionsTaskRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.CancelJobExecutionRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.CancelJobRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ClearDefaultAuthorizerRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ConfirmTopicRuleDestinationRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.CreateAuditSuppressionRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.CreateAuthorizerRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.CreateBillingGroupRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.CreateCertificateFromCsrRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.CreateCustomMetricRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.CreateDimensionRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.CreateDomainConfigurationRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.CreateDynamicThingGroupRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.CreateJobRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.CreateJobTemplateRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.CreateKeysAndCertificateRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.CreateMitigationActionRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.CreateOtaUpdateRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.CreatePolicyRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.CreatePolicyVersionRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.CreateProvisioningClaimRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.CreateProvisioningTemplateRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.CreateProvisioningTemplateVersionRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.CreateRoleAliasRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.CreateScheduledAuditRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.CreateSecurityProfileRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.CreateStreamRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.CreateThingGroupRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.CreateThingRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.CreateThingTypeRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.CreateTopicRuleDestinationRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.CreateTopicRuleRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DeleteAccountAuditConfigurationRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DeleteAuditSuppressionRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DeleteAuthorizerRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DeleteBillingGroupRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DeleteCaCertificateRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DeleteCertificateRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DeleteCustomMetricRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DeleteDimensionRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DeleteDomainConfigurationRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DeleteDynamicThingGroupRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DeleteJobExecutionRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DeleteJobRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DeleteJobTemplateRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DeleteMitigationActionRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DeleteOtaUpdateRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DeletePolicyRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DeletePolicyVersionRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DeleteProvisioningTemplateRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DeleteProvisioningTemplateVersionRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DeleteRegistrationCodeRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DeleteRoleAliasRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DeleteScheduledAuditRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DeleteSecurityProfileRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DeleteStreamRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DeleteThingGroupRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DeleteThingRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DeleteThingTypeRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DeleteTopicRuleDestinationRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DeleteTopicRuleRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DeleteV2LoggingLevelRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DeprecateThingTypeRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DescribeAccountAuditConfigurationRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DescribeAuditFindingRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DescribeAuditMitigationActionsTaskRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DescribeAuditSuppressionRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DescribeAuditTaskRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DescribeAuthorizerRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DescribeBillingGroupRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DescribeCaCertificateRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DescribeCertificateRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DescribeCustomMetricRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DescribeDefaultAuthorizerRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DescribeDetectMitigationActionsTaskRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DescribeDimensionRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DescribeDomainConfigurationRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DescribeEndpointRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DescribeEventConfigurationsRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DescribeIndexRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DescribeJobExecutionRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DescribeJobRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DescribeJobTemplateRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DescribeMitigationActionRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DescribeProvisioningTemplateRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DescribeProvisioningTemplateVersionRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DescribeRoleAliasRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DescribeScheduledAuditRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DescribeSecurityProfileRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DescribeStreamRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DescribeThingGroupRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DescribeThingRegistrationTaskRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DescribeThingRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DescribeThingTypeRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DetachPolicyRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DetachSecurityProfileRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DetachThingPrincipalRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.DisableTopicRuleRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.EnableTopicRuleRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.GetBehaviorModelTrainingSummariesRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.GetCardinalityRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.GetEffectivePoliciesRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.GetIndexingConfigurationRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.GetJobDocumentRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.GetLoggingOptionsRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.GetOtaUpdateRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.GetPercentilesRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.GetPolicyRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.GetPolicyVersionRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.GetRegistrationCodeRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.GetStatisticsRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.GetTopicRuleDestinationRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.GetTopicRuleRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.GetV2LoggingOptionsRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListActiveViolationsRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListAttachedPoliciesRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListAuditFindingsRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListAuditMitigationActionsExecutionsRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListAuditMitigationActionsTasksRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListAuditSuppressionsRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListAuditTasksRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListAuthorizersRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListBillingGroupsRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListCaCertificatesRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListCertificatesByCaRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListCertificatesRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListCustomMetricsRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListDetectMitigationActionsExecutionsRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListDetectMitigationActionsTasksRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListDimensionsRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListDomainConfigurationsRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListIndicesRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListJobExecutionsForJobRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListJobExecutionsForThingRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListJobTemplatesRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListJobsRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListMitigationActionsRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListOtaUpdatesRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListOutgoingCertificatesRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListPoliciesRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListPolicyVersionsRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListPrincipalThingsRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListProvisioningTemplateVersionsRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListProvisioningTemplatesRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListRoleAliasesRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListScheduledAuditsRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListSecurityProfilesForTargetRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListSecurityProfilesRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListStreamsRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListTargetsForPolicyRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListTargetsForSecurityProfileRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListThingGroupsForThingRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListThingGroupsRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListThingPrincipalsRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListThingRegistrationTaskReportsRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListThingRegistrationTasksRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListThingTypesRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListThingsInBillingGroupRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListThingsInThingGroupRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListThingsRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListTopicRuleDestinationsRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListTopicRulesRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListV2LoggingLevelsRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ListViolationEventsRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.RegisterCaCertificateRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.RegisterCertificateRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.RegisterCertificateWithoutCaRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.RegisterThingRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.RejectCertificateTransferRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.RemoveThingFromBillingGroupRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.RemoveThingFromThingGroupRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ReplaceTopicRuleRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.SearchIndexRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.SetDefaultAuthorizerRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.SetDefaultPolicyVersionRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.SetLoggingOptionsRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.SetV2LoggingLevelRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.SetV2LoggingOptionsRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.StartAuditMitigationActionsTaskRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.StartDetectMitigationActionsTaskRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.StartOnDemandAuditTaskRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.StartThingRegistrationTaskRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.StopThingRegistrationTaskRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.TestAuthorizationRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.TestInvokeAuthorizerRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.TransferCertificateRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.UpdateAccountAuditConfigurationRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.UpdateAuditSuppressionRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.UpdateAuthorizerRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.UpdateBillingGroupRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.UpdateCaCertificateRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.UpdateCertificateRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.UpdateCustomMetricRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.UpdateDimensionRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.UpdateDomainConfigurationRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.UpdateDynamicThingGroupRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.UpdateEventConfigurationsRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.UpdateIndexingConfigurationRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.UpdateJobRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.UpdateMitigationActionRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.UpdateProvisioningTemplateRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.UpdateRoleAliasRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.UpdateScheduledAuditRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.UpdateSecurityProfileRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.UpdateStreamRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.UpdateThingGroupRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.UpdateThingGroupsForThingRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.UpdateThingRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.UpdateTopicRuleDestinationRequestMarshaller;
import software.amazon.awssdk.services.iot.transform.ValidateSecurityProfileBehaviorsRequestMarshaller;
import software.amazon.awssdk.utils.CompletableFutureUtils;

/**
 * Internal implementation of {@link IotAsyncClient}.
 *
 * @see IotAsyncClient#builder()
 */
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultIotAsyncClient implements IotAsyncClient {
    private static final Logger log = LoggerFactory.getLogger(DefaultIotAsyncClient.class);

    private final AsyncClientHandler clientHandler;

    private final AwsJsonProtocolFactory protocolFactory;

    private final SdkClientConfiguration clientConfiguration;

    protected DefaultIotAsyncClient(SdkClientConfiguration clientConfiguration) {
        this.clientHandler = new AwsAsyncClientHandler(clientConfiguration);
        this.clientConfiguration = clientConfiguration;
        this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
    }

    @Override
    public final String serviceName() {
        return SERVICE_NAME;
    }

    /**
     * 

* Accepts a pending certificate transfer. The default state of the certificate is INACTIVE. *

*

* To check for pending certificate transfers, call ListCertificates to enumerate your certificates. *

* * @param acceptCertificateTransferRequest * The input for the AcceptCertificateTransfer operation. * @return A Java Future containing the result of the AcceptCertificateTransfer operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • TransferAlreadyCompletedException You can't revert the certificate transfer because the transfer is * already complete.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.AcceptCertificateTransfer */ @Override public CompletableFuture acceptCertificateTransfer( AcceptCertificateTransferRequest acceptCertificateTransferRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, acceptCertificateTransferRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AcceptCertificateTransfer"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AcceptCertificateTransferResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AcceptCertificateTransfer") .withMarshaller(new AcceptCertificateTransferRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(acceptCertificateTransferRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = acceptCertificateTransferRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Adds a thing to a billing group. *

* * @param addThingToBillingGroupRequest * @return A Java Future containing the result of the AddThingToBillingGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.AddThingToBillingGroup */ @Override public CompletableFuture addThingToBillingGroup( AddThingToBillingGroupRequest addThingToBillingGroupRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, addThingToBillingGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AddThingToBillingGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AddThingToBillingGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AddThingToBillingGroup") .withMarshaller(new AddThingToBillingGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(addThingToBillingGroupRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = addThingToBillingGroupRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Adds a thing to a thing group. *

* * @param addThingToThingGroupRequest * @return A Java Future containing the result of the AddThingToThingGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.AddThingToThingGroup */ @Override public CompletableFuture addThingToThingGroup( AddThingToThingGroupRequest addThingToThingGroupRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, addThingToThingGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AddThingToThingGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AddThingToThingGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AddThingToThingGroup") .withMarshaller(new AddThingToThingGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(addThingToThingGroupRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = addThingToThingGroupRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Associates a group with a continuous job. The following criteria must be met: *

*
    *
  • *

    * The job must have been created with the targetSelection field set to "CONTINUOUS". *

    *
  • *
  • *

    * The job status must currently be "IN_PROGRESS". *

    *
  • *
  • *

    * The total number of targets associated with a job must not exceed 100. *

    *
  • *
* * @param associateTargetsWithJobRequest * @return A Java Future containing the result of the AssociateTargetsWithJob operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • LimitExceededException A limit has been exceeded.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.AssociateTargetsWithJob */ @Override public CompletableFuture associateTargetsWithJob( AssociateTargetsWithJobRequest associateTargetsWithJobRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, associateTargetsWithJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AssociateTargetsWithJob"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AssociateTargetsWithJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AssociateTargetsWithJob") .withMarshaller(new AssociateTargetsWithJobRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(associateTargetsWithJobRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = associateTargetsWithJobRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Attaches the specified policy to the specified principal (certificate or other credential). *

* * @param attachPolicyRequest * @return A Java Future containing the result of the AttachPolicy operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • LimitExceededException A limit has been exceeded.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.AttachPolicy */ @Override public CompletableFuture attachPolicy(AttachPolicyRequest attachPolicyRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, attachPolicyRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AttachPolicy"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, AttachPolicyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AttachPolicy").withMarshaller(new AttachPolicyRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(attachPolicyRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = attachPolicyRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Associates a Device Defender security profile with a thing group or this account. Each thing group or account can * have up to five security profiles associated with it. *

* * @param attachSecurityProfileRequest * @return A Java Future containing the result of the AttachSecurityProfile operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • LimitExceededException A limit has been exceeded.
  • *
  • VersionConflictException An exception thrown when the version of an entity specified with the * expectedVersion parameter does not match the latest version in the system.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.AttachSecurityProfile */ @Override public CompletableFuture attachSecurityProfile( AttachSecurityProfileRequest attachSecurityProfileRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, attachSecurityProfileRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AttachSecurityProfile"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AttachSecurityProfileResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AttachSecurityProfile") .withMarshaller(new AttachSecurityProfileRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(attachSecurityProfileRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = attachSecurityProfileRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Attaches the specified principal to the specified thing. A principal can be X.509 certificates, IAM users, * groups, and roles, Amazon Cognito identities or federated identities. *

* * @param attachThingPrincipalRequest * The input for the AttachThingPrincipal operation. * @return A Java Future containing the result of the AttachThingPrincipal operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.AttachThingPrincipal */ @Override public CompletableFuture attachThingPrincipal( AttachThingPrincipalRequest attachThingPrincipalRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, attachThingPrincipalRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AttachThingPrincipal"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AttachThingPrincipalResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AttachThingPrincipal") .withMarshaller(new AttachThingPrincipalRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(attachThingPrincipalRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = attachThingPrincipalRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Cancels a mitigation action task that is in progress. If the task is not in progress, an InvalidRequestException * occurs. *

* * @param cancelAuditMitigationActionsTaskRequest * @return A Java Future containing the result of the CancelAuditMitigationActionsTask operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.CancelAuditMitigationActionsTask */ @Override public CompletableFuture cancelAuditMitigationActionsTask( CancelAuditMitigationActionsTaskRequest cancelAuditMitigationActionsTaskRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, cancelAuditMitigationActionsTaskRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CancelAuditMitigationActionsTask"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, CancelAuditMitigationActionsTaskResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CancelAuditMitigationActionsTask") .withMarshaller(new CancelAuditMitigationActionsTaskRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(cancelAuditMitigationActionsTaskRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = cancelAuditMitigationActionsTaskRequest .overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Cancels an audit that is in progress. The audit can be either scheduled or on demand. If the audit isn't in * progress, an "InvalidRequestException" occurs. *

* * @param cancelAuditTaskRequest * @return A Java Future containing the result of the CancelAuditTask operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.CancelAuditTask */ @Override public CompletableFuture cancelAuditTask(CancelAuditTaskRequest cancelAuditTaskRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, cancelAuditTaskRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CancelAuditTask"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CancelAuditTaskResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CancelAuditTask") .withMarshaller(new CancelAuditTaskRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(cancelAuditTaskRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = cancelAuditTaskRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Cancels a pending transfer for the specified certificate. *

*

* Note Only the transfer source account can use this operation to cancel a transfer. (Transfer destinations * can use RejectCertificateTransfer 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. *

*

* After a certificate transfer is cancelled, the status of the certificate changes from PENDING_TRANSFER to * INACTIVE. *

* * @param cancelCertificateTransferRequest * The input for the CancelCertificateTransfer operation. * @return A Java Future containing the result of the CancelCertificateTransfer operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • TransferAlreadyCompletedException You can't revert the certificate transfer because the transfer is * already complete.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.CancelCertificateTransfer */ @Override public CompletableFuture cancelCertificateTransfer( CancelCertificateTransferRequest cancelCertificateTransferRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, cancelCertificateTransferRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CancelCertificateTransfer"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CancelCertificateTransferResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CancelCertificateTransfer") .withMarshaller(new CancelCertificateTransferRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(cancelCertificateTransferRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = cancelCertificateTransferRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Cancels a Device Defender ML Detect mitigation action. *

* * @param cancelDetectMitigationActionsTaskRequest * @return A Java Future containing the result of the CancelDetectMitigationActionsTask operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.CancelDetectMitigationActionsTask */ @Override public CompletableFuture cancelDetectMitigationActionsTask( CancelDetectMitigationActionsTaskRequest cancelDetectMitigationActionsTaskRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, cancelDetectMitigationActionsTaskRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CancelDetectMitigationActionsTask"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, CancelDetectMitigationActionsTaskResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CancelDetectMitigationActionsTask") .withMarshaller(new CancelDetectMitigationActionsTaskRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(cancelDetectMitigationActionsTaskRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = cancelDetectMitigationActionsTaskRequest .overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Cancels a job. *

* * @param cancelJobRequest * @return A Java Future containing the result of the CancelJob operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.CancelJob */ @Override public CompletableFuture cancelJob(CancelJobRequest cancelJobRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, cancelJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CancelJob"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CancelJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("CancelJob") .withMarshaller(new CancelJobRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withMetricCollector(apiCallMetricCollector) .withInput(cancelJobRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = cancelJobRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Cancels the execution of a job for a given thing. *

* * @param cancelJobExecutionRequest * @return A Java Future containing the result of the CancelJobExecution operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • InvalidStateTransitionException An attempt was made to change to an invalid state, for example by * deleting a job or a job execution which is "IN_PROGRESS" without setting the force * parameter.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • VersionConflictException An exception thrown when the version of an entity specified with the * expectedVersion parameter does not match the latest version in the system.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.CancelJobExecution */ @Override public CompletableFuture cancelJobExecution(CancelJobExecutionRequest cancelJobExecutionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, cancelJobExecutionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CancelJobExecution"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CancelJobExecutionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CancelJobExecution") .withMarshaller(new CancelJobExecutionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(cancelJobExecutionRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = cancelJobExecutionRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Clears the default authorizer. *

* * @param clearDefaultAuthorizerRequest * @return A Java Future containing the result of the ClearDefaultAuthorizer operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ClearDefaultAuthorizer */ @Override public CompletableFuture clearDefaultAuthorizer( ClearDefaultAuthorizerRequest clearDefaultAuthorizerRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, clearDefaultAuthorizerRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ClearDefaultAuthorizer"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ClearDefaultAuthorizerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ClearDefaultAuthorizer") .withMarshaller(new ClearDefaultAuthorizerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(clearDefaultAuthorizerRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = clearDefaultAuthorizerRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Confirms a topic rule destination. When you create a rule requiring a destination, AWS IoT sends a confirmation * message to the endpoint or base address you specify. The message includes a token which you pass back when * calling ConfirmTopicRuleDestination to confirm that you own or have access to the endpoint. *

* * @param confirmTopicRuleDestinationRequest * @return A Java Future containing the result of the ConfirmTopicRuleDestination operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ConflictingResourceUpdateException A conflicting resource update exception. This exception is thrown * when two pending updates cause a conflict.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ConfirmTopicRuleDestination */ @Override public CompletableFuture confirmTopicRuleDestination( ConfirmTopicRuleDestinationRequest confirmTopicRuleDestinationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, confirmTopicRuleDestinationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ConfirmTopicRuleDestination"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ConfirmTopicRuleDestinationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ConfirmTopicRuleDestination") .withMarshaller(new ConfirmTopicRuleDestinationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(confirmTopicRuleDestinationRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = confirmTopicRuleDestinationRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a Device Defender audit suppression. *

* * @param createAuditSuppressionRequest * @return A Java Future containing the result of the CreateAuditSuppression operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceAlreadyExistsException The resource already exists.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • LimitExceededException A limit has been exceeded.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.CreateAuditSuppression */ @Override public CompletableFuture createAuditSuppression( CreateAuditSuppressionRequest createAuditSuppressionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createAuditSuppressionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateAuditSuppression"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateAuditSuppressionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateAuditSuppression") .withMarshaller(new CreateAuditSuppressionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createAuditSuppressionRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createAuditSuppressionRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates an authorizer. *

* * @param createAuthorizerRequest * @return A Java Future containing the result of the CreateAuthorizer operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceAlreadyExistsException The resource already exists.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • LimitExceededException A limit has been exceeded.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.CreateAuthorizer */ @Override public CompletableFuture createAuthorizer(CreateAuthorizerRequest createAuthorizerRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createAuthorizerRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateAuthorizer"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateAuthorizerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateAuthorizer") .withMarshaller(new CreateAuthorizerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createAuthorizerRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createAuthorizerRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a billing group. *

* * @param createBillingGroupRequest * @return A Java Future containing the result of the CreateBillingGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceAlreadyExistsException The resource already exists.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.CreateBillingGroup */ @Override public CompletableFuture createBillingGroup(CreateBillingGroupRequest createBillingGroupRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createBillingGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateBillingGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateBillingGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateBillingGroup") .withMarshaller(new CreateBillingGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createBillingGroupRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createBillingGroupRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates an X.509 certificate using the specified certificate signing request. *

*

* Note: The CSR must include a public key that is either an RSA key with a length of at least 2048 bits or * an ECC key from NIST P-256 or NIST P-384 curves. *

*

* Note: Reusing the same certificate signing request (CSR) results in a distinct certificate. *

*

* 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. *

*

* Assuming a set of CSRs are located inside of the directory my-csr-directory: *

*

* On Linux and OS X, the command is: *

*

* $ ls my-csr-directory/ | xargs -I {} aws iot create-certificate-from-csr --certificate-signing-request * file://my-csr-directory/{} *

*

* 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. *

*

* The aws iot create-certificate-from-csr part of the command can also be run in parallel to speed up the * certificate creation process: *

*

* $ ls my-csr-directory/ | xargs -P 10 -I {} aws iot create-certificate-from-csr --certificate-signing-request * file://my-csr-directory/{} *

*

* On Windows PowerShell, the command to create certificates for all CSRs in my-csr-directory is: *

*

* > ls -Name my-csr-directory | %{aws iot create-certificate-from-csr --certificate-signing-request * file://my-csr-directory/$_} *

*

* On a Windows command prompt, the command to create certificates for all CSRs in my-csr-directory is: *

*

* > forfiles /p my-csr-directory /c * "cmd /c aws iot create-certificate-from-csr --certificate-signing-request file://@path" *

* * @param createCertificateFromCsrRequest * The input for the CreateCertificateFromCsr operation. * @return A Java Future containing the result of the CreateCertificateFromCsr operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.CreateCertificateFromCsr */ @Override public CompletableFuture createCertificateFromCsr( CreateCertificateFromCsrRequest createCertificateFromCsrRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createCertificateFromCsrRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateCertificateFromCsr"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateCertificateFromCsrResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateCertificateFromCsr") .withMarshaller(new CreateCertificateFromCsrRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createCertificateFromCsrRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createCertificateFromCsrRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Use this API to define a Custom Metric published by your devices to Device Defender. *

* * @param createCustomMetricRequest * @return A Java Future containing the result of the CreateCustomMetric operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • LimitExceededException A limit has been exceeded.
  • *
  • ResourceAlreadyExistsException The resource already exists.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.CreateCustomMetric */ @Override public CompletableFuture createCustomMetric(CreateCustomMetricRequest createCustomMetricRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createCustomMetricRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateCustomMetric"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateCustomMetricResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateCustomMetric") .withMarshaller(new CreateCustomMetricRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createCustomMetricRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createCustomMetricRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Create a dimension that you can use to limit the scope of a metric used in a security profile for AWS IoT Device * Defender. For example, using a TOPIC_FILTER dimension, you can narrow down the scope of the metric * only to MQTT topics whose name match the pattern specified in the dimension. *

* * @param createDimensionRequest * @return A Java Future containing the result of the CreateDimension operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalFailureException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • LimitExceededException A limit has been exceeded.
  • *
  • ResourceAlreadyExistsException The resource already exists.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.CreateDimension */ @Override public CompletableFuture createDimension(CreateDimensionRequest createDimensionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createDimensionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateDimension"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateDimensionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateDimension") .withMarshaller(new CreateDimensionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createDimensionRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createDimensionRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a domain configuration. *

* * @param createDomainConfigurationRequest * @return A Java Future containing the result of the CreateDomainConfiguration operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • LimitExceededException A limit has been exceeded.
  • *
  • CertificateValidationException The certificate is invalid.
  • *
  • ResourceAlreadyExistsException The resource already exists.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.CreateDomainConfiguration */ @Override public CompletableFuture createDomainConfiguration( CreateDomainConfigurationRequest createDomainConfigurationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createDomainConfigurationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateDomainConfiguration"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateDomainConfigurationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateDomainConfiguration") .withMarshaller(new CreateDomainConfigurationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createDomainConfigurationRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createDomainConfigurationRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a dynamic thing group. *

* * @param createDynamicThingGroupRequest * @return A Java Future containing the result of the CreateDynamicThingGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceAlreadyExistsException The resource already exists.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • InvalidQueryException The query is invalid.
  • *
  • LimitExceededException A limit has been exceeded.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.CreateDynamicThingGroup */ @Override public CompletableFuture createDynamicThingGroup( CreateDynamicThingGroupRequest createDynamicThingGroupRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createDynamicThingGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateDynamicThingGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateDynamicThingGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateDynamicThingGroup") .withMarshaller(new CreateDynamicThingGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createDynamicThingGroupRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createDynamicThingGroupRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a job. *

* * @param createJobRequest * @return A Java Future containing the result of the CreateJob operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ResourceAlreadyExistsException The resource already exists.
  • *
  • LimitExceededException A limit has been exceeded.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.CreateJob */ @Override public CompletableFuture createJob(CreateJobRequest createJobRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateJob"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("CreateJob") .withMarshaller(new CreateJobRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withMetricCollector(apiCallMetricCollector) .withInput(createJobRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createJobRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a job template. *

* * @param createJobTemplateRequest * @return A Java Future containing the result of the CreateJobTemplate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ConflictException A resource with the same name already exists.
  • *
  • LimitExceededException A limit has been exceeded.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.CreateJobTemplate */ @Override public CompletableFuture createJobTemplate(CreateJobTemplateRequest createJobTemplateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createJobTemplateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateJobTemplate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateJobTemplateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateJobTemplate") .withMarshaller(new CreateJobTemplateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createJobTemplateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createJobTemplateRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a 2048-bit RSA key pair and issues an X.509 certificate using the issued public key. You can also call * CreateKeysAndCertificate over MQTT from a device, for more information, see Provisioning MQTT API. *

*

* Note 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. *

* * @param createKeysAndCertificateRequest * The input for the CreateKeysAndCertificate operation. * @return A Java Future containing the result of the CreateKeysAndCertificate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.CreateKeysAndCertificate */ @Override public CompletableFuture createKeysAndCertificate( CreateKeysAndCertificateRequest createKeysAndCertificateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createKeysAndCertificateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateKeysAndCertificate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateKeysAndCertificateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateKeysAndCertificate") .withMarshaller(new CreateKeysAndCertificateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createKeysAndCertificateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createKeysAndCertificateRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Defines an action that can be applied to audit findings by using StartAuditMitigationActionsTask. Only certain * types of mitigation actions can be applied to specific check names. For more information, see Mitigation * actions. Each mitigation action can apply only one type of change. *

* * @param createMitigationActionRequest * @return A Java Future containing the result of the CreateMitigationAction operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceAlreadyExistsException The resource already exists.
  • *
  • LimitExceededException A limit has been exceeded.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.CreateMitigationAction */ @Override public CompletableFuture createMitigationAction( CreateMitigationActionRequest createMitigationActionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createMitigationActionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateMitigationAction"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateMitigationActionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateMitigationAction") .withMarshaller(new CreateMitigationActionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createMitigationActionRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createMitigationActionRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates an AWS IoT OTAUpdate on a target group of things or groups. *

* * @param createOtaUpdateRequest * @return A Java Future containing the result of the CreateOTAUpdate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • LimitExceededException A limit has been exceeded.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ResourceAlreadyExistsException The resource already exists.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.CreateOTAUpdate */ @Override public CompletableFuture createOTAUpdate(CreateOtaUpdateRequest createOtaUpdateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createOtaUpdateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateOTAUpdate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateOtaUpdateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateOTAUpdate") .withMarshaller(new CreateOtaUpdateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createOtaUpdateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createOtaUpdateRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates an AWS IoT policy. *

*

* The created policy is the default version for the policy. This operation creates a policy version with a version * identifier of 1 and sets 1 as the policy's default version. *

* * @param createPolicyRequest * The input for the CreatePolicy operation. * @return A Java Future containing the result of the CreatePolicy operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceAlreadyExistsException The resource already exists.
  • *
  • MalformedPolicyException The policy documentation is not valid.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.CreatePolicy */ @Override public CompletableFuture createPolicy(CreatePolicyRequest createPolicyRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createPolicyRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreatePolicy"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreatePolicyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreatePolicy").withMarshaller(new CreatePolicyRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createPolicyRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createPolicyRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a 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 DeletePolicyVersion to * delete an existing version before you create a new one. *

*

* 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). *

* * @param createPolicyVersionRequest * The input for the CreatePolicyVersion operation. * @return A Java Future containing the result of the CreatePolicyVersion operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • MalformedPolicyException The policy documentation is not valid.
  • *
  • VersionsLimitExceededException The number of policy versions exceeds the limit.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.CreatePolicyVersion */ @Override public CompletableFuture createPolicyVersion( CreatePolicyVersionRequest createPolicyVersionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createPolicyVersionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreatePolicyVersion"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreatePolicyVersionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreatePolicyVersion") .withMarshaller(new CreatePolicyVersionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createPolicyVersionRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createPolicyVersionRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a provisioning claim. *

* * @param createProvisioningClaimRequest * @return A Java Future containing the result of the CreateProvisioningClaim operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.CreateProvisioningClaim */ @Override public CompletableFuture createProvisioningClaim( CreateProvisioningClaimRequest createProvisioningClaimRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createProvisioningClaimRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateProvisioningClaim"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateProvisioningClaimResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateProvisioningClaim") .withMarshaller(new CreateProvisioningClaimRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createProvisioningClaimRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createProvisioningClaimRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a fleet provisioning template. *

* * @param createProvisioningTemplateRequest * @return A Java Future containing the result of the CreateProvisioningTemplate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalFailureException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • LimitExceededException A limit has been exceeded.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ResourceAlreadyExistsException The resource already exists.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.CreateProvisioningTemplate */ @Override public CompletableFuture createProvisioningTemplate( CreateProvisioningTemplateRequest createProvisioningTemplateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createProvisioningTemplateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateProvisioningTemplate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateProvisioningTemplateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateProvisioningTemplate") .withMarshaller(new CreateProvisioningTemplateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createProvisioningTemplateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createProvisioningTemplateRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a new version of a fleet provisioning template. *

* * @param createProvisioningTemplateVersionRequest * @return A Java Future containing the result of the CreateProvisioningTemplateVersion operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • VersionsLimitExceededException The number of policy versions exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ConflictingResourceUpdateException A conflicting resource update exception. This exception is thrown * when two pending updates cause a conflict.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.CreateProvisioningTemplateVersion */ @Override public CompletableFuture createProvisioningTemplateVersion( CreateProvisioningTemplateVersionRequest createProvisioningTemplateVersionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createProvisioningTemplateVersionRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateProvisioningTemplateVersion"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, CreateProvisioningTemplateVersionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateProvisioningTemplateVersion") .withMarshaller(new CreateProvisioningTemplateVersionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createProvisioningTemplateVersionRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createProvisioningTemplateVersionRequest .overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a role alias. *

* * @param createRoleAliasRequest * @return A Java Future containing the result of the CreateRoleAlias operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceAlreadyExistsException The resource already exists.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • LimitExceededException A limit has been exceeded.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.CreateRoleAlias */ @Override public CompletableFuture createRoleAlias(CreateRoleAliasRequest createRoleAliasRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createRoleAliasRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateRoleAlias"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateRoleAliasResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateRoleAlias") .withMarshaller(new CreateRoleAliasRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createRoleAliasRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createRoleAliasRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a scheduled audit that is run at a specified time interval. *

* * @param createScheduledAuditRequest * @return A Java Future containing the result of the CreateScheduledAudit operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceAlreadyExistsException The resource already exists.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • LimitExceededException A limit has been exceeded.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.CreateScheduledAudit */ @Override public CompletableFuture createScheduledAudit( CreateScheduledAuditRequest createScheduledAuditRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createScheduledAuditRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateScheduledAudit"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateScheduledAuditResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateScheduledAudit") .withMarshaller(new CreateScheduledAuditRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createScheduledAuditRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createScheduledAuditRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a Device Defender security profile. *

* * @param createSecurityProfileRequest * @return A Java Future containing the result of the CreateSecurityProfile operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceAlreadyExistsException The resource already exists.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.CreateSecurityProfile */ @Override public CompletableFuture createSecurityProfile( CreateSecurityProfileRequest createSecurityProfileRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createSecurityProfileRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateSecurityProfile"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateSecurityProfileResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateSecurityProfile") .withMarshaller(new CreateSecurityProfileRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createSecurityProfileRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createSecurityProfileRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a stream for delivering one or more large files in chunks over MQTT. A stream transports data bytes in * chunks or blocks packaged as MQTT messages from a source like S3. You can have one or more files associated with * a stream. *

* * @param createStreamRequest * @return A Java Future containing the result of the CreateStream operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • LimitExceededException A limit has been exceeded.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ResourceAlreadyExistsException The resource already exists.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.CreateStream */ @Override public CompletableFuture createStream(CreateStreamRequest createStreamRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createStreamRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateStream"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateStreamResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateStream").withMarshaller(new CreateStreamRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createStreamRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createStreamRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a thing record in the registry. If this call is made multiple times using the same thing name and * configuration, the call will succeed. If this call is made with the same thing name but different configuration a * ResourceAlreadyExistsException is thrown. *

* *

* This is a control plane operation. See Authorization for * information about authorizing control plane actions. *

*
* * @param createThingRequest * The input for the CreateThing operation. * @return A Java Future containing the result of the CreateThing operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceAlreadyExistsException The resource already exists.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.CreateThing */ @Override public CompletableFuture createThing(CreateThingRequest createThingRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createThingRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateThing"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateThingResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateThing").withMarshaller(new CreateThingRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createThingRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createThingRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Create a thing group. *

* *

* This is a control plane operation. See Authorization for * information about authorizing control plane actions. *

*
* * @param createThingGroupRequest * @return A Java Future containing the result of the CreateThingGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceAlreadyExistsException The resource already exists.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.CreateThingGroup */ @Override public CompletableFuture createThingGroup(CreateThingGroupRequest createThingGroupRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createThingGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateThingGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateThingGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateThingGroup") .withMarshaller(new CreateThingGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createThingGroupRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createThingGroupRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a new thing type. *

* * @param createThingTypeRequest * The input for the CreateThingType operation. * @return A Java Future containing the result of the CreateThingType operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceAlreadyExistsException The resource already exists.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.CreateThingType */ @Override public CompletableFuture createThingType(CreateThingTypeRequest createThingTypeRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createThingTypeRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateThingType"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateThingTypeResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateThingType") .withMarshaller(new CreateThingTypeRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createThingTypeRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createThingTypeRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a 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. *

* * @param createTopicRuleRequest * The input for the CreateTopicRule operation. * @return A Java Future containing the result of the CreateTopicRule operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • SqlParseException The Rule-SQL expression can't be parsed correctly.
  • *
  • InternalException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceAlreadyExistsException The resource already exists.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • ConflictingResourceUpdateException A conflicting resource update exception. This exception is thrown * when two pending updates cause a conflict.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.CreateTopicRule */ @Override public CompletableFuture createTopicRule(CreateTopicRuleRequest createTopicRuleRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createTopicRuleRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateTopicRule"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateTopicRuleResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateTopicRule") .withMarshaller(new CreateTopicRuleRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createTopicRuleRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createTopicRuleRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a topic rule destination. The destination must be confirmed prior to use. *

* * @param createTopicRuleDestinationRequest * @return A Java Future containing the result of the CreateTopicRuleDestination operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceAlreadyExistsException The resource already exists.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • ConflictingResourceUpdateException A conflicting resource update exception. This exception is thrown * when two pending updates cause a conflict.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.CreateTopicRuleDestination */ @Override public CompletableFuture createTopicRuleDestination( CreateTopicRuleDestinationRequest createTopicRuleDestinationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createTopicRuleDestinationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateTopicRuleDestination"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateTopicRuleDestinationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateTopicRuleDestination") .withMarshaller(new CreateTopicRuleDestinationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createTopicRuleDestinationRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createTopicRuleDestinationRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Restores the default settings for Device Defender audits for this account. Any configuration data you entered is * deleted and all audit checks are reset to disabled. *

* * @param deleteAccountAuditConfigurationRequest * @return A Java Future containing the result of the DeleteAccountAuditConfiguration operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DeleteAccountAuditConfiguration */ @Override public CompletableFuture deleteAccountAuditConfiguration( DeleteAccountAuditConfigurationRequest deleteAccountAuditConfigurationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteAccountAuditConfigurationRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteAccountAuditConfiguration"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteAccountAuditConfigurationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteAccountAuditConfiguration") .withMarshaller(new DeleteAccountAuditConfigurationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteAccountAuditConfigurationRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteAccountAuditConfigurationRequest .overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a Device Defender audit suppression. *

* * @param deleteAuditSuppressionRequest * @return A Java Future containing the result of the DeleteAuditSuppression operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DeleteAuditSuppression */ @Override public CompletableFuture deleteAuditSuppression( DeleteAuditSuppressionRequest deleteAuditSuppressionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteAuditSuppressionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteAuditSuppression"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteAuditSuppressionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteAuditSuppression") .withMarshaller(new DeleteAuditSuppressionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteAuditSuppressionRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteAuditSuppressionRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes an authorizer. *

* * @param deleteAuthorizerRequest * @return A Java Future containing the result of the DeleteAuthorizer operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DeleteConflictException You can't delete the resource because it is attached to one or more * resources.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DeleteAuthorizer */ @Override public CompletableFuture deleteAuthorizer(DeleteAuthorizerRequest deleteAuthorizerRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteAuthorizerRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteAuthorizer"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteAuthorizerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteAuthorizer") .withMarshaller(new DeleteAuthorizerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteAuthorizerRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteAuthorizerRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes the billing group. *

* * @param deleteBillingGroupRequest * @return A Java Future containing the result of the DeleteBillingGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • VersionConflictException An exception thrown when the version of an entity specified with the * expectedVersion parameter does not match the latest version in the system.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DeleteBillingGroup */ @Override public CompletableFuture deleteBillingGroup(DeleteBillingGroupRequest deleteBillingGroupRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteBillingGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteBillingGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteBillingGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteBillingGroup") .withMarshaller(new DeleteBillingGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteBillingGroupRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteBillingGroupRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a registered CA certificate. *

* * @param deleteCaCertificateRequest * Input for the DeleteCACertificate operation. * @return A Java Future containing the result of the DeleteCACertificate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • CertificateStateException The certificate operation is not allowed.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DeleteCACertificate */ @Override public CompletableFuture deleteCACertificate( DeleteCaCertificateRequest deleteCaCertificateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteCaCertificateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteCACertificate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteCaCertificateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteCACertificate") .withMarshaller(new DeleteCaCertificateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteCaCertificateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteCaCertificateRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes the specified certificate. *

*

* A certificate cannot be deleted if it has a policy or IoT thing attached to it or if its status is set to ACTIVE. * To delete a certificate, first use the DetachPrincipalPolicy API to detach all policies. Next, use the * UpdateCertificate API to set the certificate to the INACTIVE status. *

* * @param deleteCertificateRequest * The input for the DeleteCertificate operation. * @return A Java Future containing the result of the DeleteCertificate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • CertificateStateException The certificate operation is not allowed.
  • *
  • DeleteConflictException You can't delete the resource because it is attached to one or more * resources.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DeleteCertificate */ @Override public CompletableFuture deleteCertificate(DeleteCertificateRequest deleteCertificateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteCertificateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteCertificate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteCertificateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteCertificate") .withMarshaller(new DeleteCertificateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteCertificateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteCertificateRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** * *

* Before you can delete a custom metric, you must first remove the custom metric from all security profiles it's a * part of. The security profile associated with the custom metric can be found using the ListSecurityProfiles * API with metricName set to your custom metric name. *

*
*

* Deletes a Device Defender detect custom metric. *

* * @param deleteCustomMetricRequest * @return A Java Future containing the result of the DeleteCustomMetric operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DeleteCustomMetric */ @Override public CompletableFuture deleteCustomMetric(DeleteCustomMetricRequest deleteCustomMetricRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteCustomMetricRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteCustomMetric"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteCustomMetricResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteCustomMetric") .withMarshaller(new DeleteCustomMetricRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteCustomMetricRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteCustomMetricRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Removes the specified dimension from your AWS account. *

* * @param deleteDimensionRequest * @return A Java Future containing the result of the DeleteDimension operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalFailureException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DeleteDimension */ @Override public CompletableFuture deleteDimension(DeleteDimensionRequest deleteDimensionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteDimensionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteDimension"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteDimensionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteDimension") .withMarshaller(new DeleteDimensionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteDimensionRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteDimensionRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes the specified domain configuration. *

* * @param deleteDomainConfigurationRequest * @return A Java Future containing the result of the DeleteDomainConfiguration operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DeleteDomainConfiguration */ @Override public CompletableFuture deleteDomainConfiguration( DeleteDomainConfigurationRequest deleteDomainConfigurationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteDomainConfigurationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteDomainConfiguration"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteDomainConfigurationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteDomainConfiguration") .withMarshaller(new DeleteDomainConfigurationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteDomainConfigurationRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteDomainConfigurationRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a dynamic thing group. *

* * @param deleteDynamicThingGroupRequest * @return A Java Future containing the result of the DeleteDynamicThingGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • VersionConflictException An exception thrown when the version of an entity specified with the * expectedVersion parameter does not match the latest version in the system.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DeleteDynamicThingGroup */ @Override public CompletableFuture deleteDynamicThingGroup( DeleteDynamicThingGroupRequest deleteDynamicThingGroupRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteDynamicThingGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteDynamicThingGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteDynamicThingGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteDynamicThingGroup") .withMarshaller(new DeleteDynamicThingGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteDynamicThingGroupRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteDynamicThingGroupRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a job and its related job executions. *

*

* Deleting a job may take time, depending on the number of job executions created for the job and various other * factors. While the job is being deleted, the status of the job will be shown as "DELETION_IN_PROGRESS". * Attempting to delete or cancel a job whose status is already "DELETION_IN_PROGRESS" will result in an error. *

*

* Only 10 jobs may have status "DELETION_IN_PROGRESS" at the same time, or a LimitExceededException will occur. *

* * @param deleteJobRequest * @return A Java Future containing the result of the DeleteJob operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • InvalidStateTransitionException An attempt was made to change to an invalid state, for example by * deleting a job or a job execution which is "IN_PROGRESS" without setting the force * parameter.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • LimitExceededException A limit has been exceeded.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DeleteJob */ @Override public CompletableFuture deleteJob(DeleteJobRequest deleteJobRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteJob"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("DeleteJob") .withMarshaller(new DeleteJobRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withMetricCollector(apiCallMetricCollector) .withInput(deleteJobRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteJobRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a job execution. *

* * @param deleteJobExecutionRequest * @return A Java Future containing the result of the DeleteJobExecution operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • InvalidStateTransitionException An attempt was made to change to an invalid state, for example by * deleting a job or a job execution which is "IN_PROGRESS" without setting the force * parameter.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DeleteJobExecution */ @Override public CompletableFuture deleteJobExecution(DeleteJobExecutionRequest deleteJobExecutionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteJobExecutionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteJobExecution"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteJobExecutionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteJobExecution") .withMarshaller(new DeleteJobExecutionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteJobExecutionRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteJobExecutionRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes the specified job template. *

* * @param deleteJobTemplateRequest * @return A Java Future containing the result of the DeleteJobTemplate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DeleteJobTemplate */ @Override public CompletableFuture deleteJobTemplate(DeleteJobTemplateRequest deleteJobTemplateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteJobTemplateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteJobTemplate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteJobTemplateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteJobTemplate") .withMarshaller(new DeleteJobTemplateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteJobTemplateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteJobTemplateRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a defined mitigation action from your AWS account. *

* * @param deleteMitigationActionRequest * @return A Java Future containing the result of the DeleteMitigationAction operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DeleteMitigationAction */ @Override public CompletableFuture deleteMitigationAction( DeleteMitigationActionRequest deleteMitigationActionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteMitigationActionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteMitigationAction"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteMitigationActionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteMitigationAction") .withMarshaller(new DeleteMitigationActionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteMitigationActionRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteMitigationActionRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Delete an OTA update. *

* * @param deleteOtaUpdateRequest * @return A Java Future containing the result of the DeleteOTAUpdate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • VersionConflictException An exception thrown when the version of an entity specified with the * expectedVersion parameter does not match the latest version in the system.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DeleteOTAUpdate */ @Override public CompletableFuture deleteOTAUpdate(DeleteOtaUpdateRequest deleteOtaUpdateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteOtaUpdateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteOTAUpdate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteOtaUpdateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteOTAUpdate") .withMarshaller(new DeleteOtaUpdateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteOtaUpdateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteOtaUpdateRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes the specified policy. *

*

* A policy cannot be deleted if it has non-default versions or it is attached to any certificate. *

*

* 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. *

*

* When a policy is deleted using DeletePolicy, its default version is deleted with it. *

* * @param deletePolicyRequest * The input for the DeletePolicy operation. * @return A Java Future containing the result of the DeletePolicy operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DeleteConflictException You can't delete the resource because it is attached to one or more * resources.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DeletePolicy */ @Override public CompletableFuture deletePolicy(DeletePolicyRequest deletePolicyRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deletePolicyRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeletePolicy"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeletePolicyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeletePolicy").withMarshaller(new DeletePolicyRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deletePolicyRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deletePolicyRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes 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 DeletePolicy. To find out which version of a * policy is marked as the default version, use ListPolicyVersions. *

* * @param deletePolicyVersionRequest * The input for the DeletePolicyVersion operation. * @return A Java Future containing the result of the DeletePolicyVersion operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DeleteConflictException You can't delete the resource because it is attached to one or more * resources.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DeletePolicyVersion */ @Override public CompletableFuture deletePolicyVersion( DeletePolicyVersionRequest deletePolicyVersionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deletePolicyVersionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeletePolicyVersion"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeletePolicyVersionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeletePolicyVersion") .withMarshaller(new DeletePolicyVersionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deletePolicyVersionRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deletePolicyVersionRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a fleet provisioning template. *

* * @param deleteProvisioningTemplateRequest * @return A Java Future containing the result of the DeleteProvisioningTemplate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalFailureException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • DeleteConflictException You can't delete the resource because it is attached to one or more * resources.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • ConflictingResourceUpdateException A conflicting resource update exception. This exception is thrown * when two pending updates cause a conflict.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DeleteProvisioningTemplate */ @Override public CompletableFuture deleteProvisioningTemplate( DeleteProvisioningTemplateRequest deleteProvisioningTemplateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteProvisioningTemplateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteProvisioningTemplate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteProvisioningTemplateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteProvisioningTemplate") .withMarshaller(new DeleteProvisioningTemplateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteProvisioningTemplateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteProvisioningTemplateRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a fleet provisioning template version. *

* * @param deleteProvisioningTemplateVersionRequest * @return A Java Future containing the result of the DeleteProvisioningTemplateVersion operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalFailureException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ConflictingResourceUpdateException A conflicting resource update exception. This exception is thrown * when two pending updates cause a conflict.
  • *
  • DeleteConflictException You can't delete the resource because it is attached to one or more * resources.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DeleteProvisioningTemplateVersion */ @Override public CompletableFuture deleteProvisioningTemplateVersion( DeleteProvisioningTemplateVersionRequest deleteProvisioningTemplateVersionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteProvisioningTemplateVersionRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteProvisioningTemplateVersion"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, DeleteProvisioningTemplateVersionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteProvisioningTemplateVersion") .withMarshaller(new DeleteProvisioningTemplateVersionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteProvisioningTemplateVersionRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteProvisioningTemplateVersionRequest .overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a CA certificate registration code. *

* * @param deleteRegistrationCodeRequest * The input for the DeleteRegistrationCode operation. * @return A Java Future containing the result of the DeleteRegistrationCode operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ThrottlingException The rate exceeds the limit.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DeleteRegistrationCode */ @Override public CompletableFuture deleteRegistrationCode( DeleteRegistrationCodeRequest deleteRegistrationCodeRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteRegistrationCodeRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteRegistrationCode"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteRegistrationCodeResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteRegistrationCode") .withMarshaller(new DeleteRegistrationCodeRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteRegistrationCodeRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteRegistrationCodeRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a role alias *

* * @param deleteRoleAliasRequest * @return A Java Future containing the result of the DeleteRoleAlias operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DeleteConflictException You can't delete the resource because it is attached to one or more * resources.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DeleteRoleAlias */ @Override public CompletableFuture deleteRoleAlias(DeleteRoleAliasRequest deleteRoleAliasRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteRoleAliasRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteRoleAlias"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteRoleAliasResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteRoleAlias") .withMarshaller(new DeleteRoleAliasRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteRoleAliasRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteRoleAliasRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a scheduled audit. *

* * @param deleteScheduledAuditRequest * @return A Java Future containing the result of the DeleteScheduledAudit operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DeleteScheduledAudit */ @Override public CompletableFuture deleteScheduledAudit( DeleteScheduledAuditRequest deleteScheduledAuditRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteScheduledAuditRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteScheduledAudit"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteScheduledAuditResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteScheduledAudit") .withMarshaller(new DeleteScheduledAuditRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteScheduledAuditRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteScheduledAuditRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a Device Defender security profile. *

* * @param deleteSecurityProfileRequest * @return A Java Future containing the result of the DeleteSecurityProfile operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • VersionConflictException An exception thrown when the version of an entity specified with the * expectedVersion parameter does not match the latest version in the system.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DeleteSecurityProfile */ @Override public CompletableFuture deleteSecurityProfile( DeleteSecurityProfileRequest deleteSecurityProfileRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteSecurityProfileRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteSecurityProfile"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteSecurityProfileResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteSecurityProfile") .withMarshaller(new DeleteSecurityProfileRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteSecurityProfileRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteSecurityProfileRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a stream. *

* * @param deleteStreamRequest * @return A Java Future containing the result of the DeleteStream operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • DeleteConflictException You can't delete the resource because it is attached to one or more * resources.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DeleteStream */ @Override public CompletableFuture deleteStream(DeleteStreamRequest deleteStreamRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteStreamRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteStream"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteStreamResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteStream").withMarshaller(new DeleteStreamRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteStreamRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteStreamRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes the specified thing. Returns successfully with no error if the deletion is successful or you specify a * thing that doesn't exist. *

* * @param deleteThingRequest * The input for the DeleteThing operation. * @return A Java Future containing the result of the DeleteThing operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • VersionConflictException An exception thrown when the version of an entity specified with the * expectedVersion parameter does not match the latest version in the system.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DeleteThing */ @Override public CompletableFuture deleteThing(DeleteThingRequest deleteThingRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteThingRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteThing"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteThingResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteThing").withMarshaller(new DeleteThingRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteThingRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteThingRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a thing group. *

* * @param deleteThingGroupRequest * @return A Java Future containing the result of the DeleteThingGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • VersionConflictException An exception thrown when the version of an entity specified with the * expectedVersion parameter does not match the latest version in the system.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DeleteThingGroup */ @Override public CompletableFuture deleteThingGroup(DeleteThingGroupRequest deleteThingGroupRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteThingGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteThingGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteThingGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteThingGroup") .withMarshaller(new DeleteThingGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteThingGroupRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteThingGroupRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes 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 DeprecateThingType, then remove any associated things * by calling UpdateThing to change the thing type on any associated thing, and finally use * DeleteThingType to delete the thing type. *

* * @param deleteThingTypeRequest * The input for the DeleteThingType operation. * @return A Java Future containing the result of the DeleteThingType operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DeleteThingType */ @Override public CompletableFuture deleteThingType(DeleteThingTypeRequest deleteThingTypeRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteThingTypeRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteThingType"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteThingTypeResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteThingType") .withMarshaller(new DeleteThingTypeRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteThingTypeRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteThingTypeRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes the rule. *

* * @param deleteTopicRuleRequest * The input for the DeleteTopicRule operation. * @return A Java Future containing the result of the DeleteTopicRule operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ConflictingResourceUpdateException A conflicting resource update exception. This exception is thrown * when two pending updates cause a conflict.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DeleteTopicRule */ @Override public CompletableFuture deleteTopicRule(DeleteTopicRuleRequest deleteTopicRuleRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteTopicRuleRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteTopicRule"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteTopicRuleResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteTopicRule") .withMarshaller(new DeleteTopicRuleRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteTopicRuleRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteTopicRuleRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a topic rule destination. *

* * @param deleteTopicRuleDestinationRequest * @return A Java Future containing the result of the DeleteTopicRuleDestination operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ConflictingResourceUpdateException A conflicting resource update exception. This exception is thrown * when two pending updates cause a conflict.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DeleteTopicRuleDestination */ @Override public CompletableFuture deleteTopicRuleDestination( DeleteTopicRuleDestinationRequest deleteTopicRuleDestinationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteTopicRuleDestinationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteTopicRuleDestination"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteTopicRuleDestinationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteTopicRuleDestination") .withMarshaller(new DeleteTopicRuleDestinationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteTopicRuleDestinationRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteTopicRuleDestinationRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a logging level. *

* * @param deleteV2LoggingLevelRequest * @return A Java Future containing the result of the DeleteV2LoggingLevel operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DeleteV2LoggingLevel */ @Override public CompletableFuture deleteV2LoggingLevel( DeleteV2LoggingLevelRequest deleteV2LoggingLevelRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteV2LoggingLevelRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteV2LoggingLevel"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteV2LoggingLevelResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteV2LoggingLevel") .withMarshaller(new DeleteV2LoggingLevelRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteV2LoggingLevelRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteV2LoggingLevelRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deprecates a thing type. You can not associate new things with deprecated thing type. *

* * @param deprecateThingTypeRequest * The input for the DeprecateThingType operation. * @return A Java Future containing the result of the DeprecateThingType operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DeprecateThingType */ @Override public CompletableFuture deprecateThingType(DeprecateThingTypeRequest deprecateThingTypeRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deprecateThingTypeRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeprecateThingType"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeprecateThingTypeResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeprecateThingType") .withMarshaller(new DeprecateThingTypeRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deprecateThingTypeRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deprecateThingTypeRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets information about the Device Defender audit settings for this account. Settings include how audit * notifications are sent and which audit checks are enabled or disabled. *

* * @param describeAccountAuditConfigurationRequest * @return A Java Future containing the result of the DescribeAccountAuditConfiguration operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DescribeAccountAuditConfiguration */ @Override public CompletableFuture describeAccountAuditConfiguration( DescribeAccountAuditConfigurationRequest describeAccountAuditConfigurationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeAccountAuditConfigurationRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeAccountAuditConfiguration"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, DescribeAccountAuditConfigurationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeAccountAuditConfiguration") .withMarshaller(new DescribeAccountAuditConfigurationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeAccountAuditConfigurationRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeAccountAuditConfigurationRequest .overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets information about a single audit finding. Properties include the reason for noncompliance, the severity of * the issue, and the start time when the audit that returned the finding. *

* * @param describeAuditFindingRequest * @return A Java Future containing the result of the DescribeAuditFinding operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DescribeAuditFinding */ @Override public CompletableFuture describeAuditFinding( DescribeAuditFindingRequest describeAuditFindingRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeAuditFindingRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeAuditFinding"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeAuditFindingResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeAuditFinding") .withMarshaller(new DescribeAuditFindingRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeAuditFindingRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeAuditFindingRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets information about an audit mitigation task that is used to apply mitigation actions to a set of audit * findings. Properties include the actions being applied, the audit checks to which they're being applied, the task * status, and aggregated task statistics. *

* * @param describeAuditMitigationActionsTaskRequest * @return A Java Future containing the result of the DescribeAuditMitigationActionsTask operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DescribeAuditMitigationActionsTask */ @Override public CompletableFuture describeAuditMitigationActionsTask( DescribeAuditMitigationActionsTaskRequest describeAuditMitigationActionsTaskRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeAuditMitigationActionsTaskRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeAuditMitigationActionsTask"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, DescribeAuditMitigationActionsTaskResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeAuditMitigationActionsTask") .withMarshaller(new DescribeAuditMitigationActionsTaskRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeAuditMitigationActionsTaskRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeAuditMitigationActionsTaskRequest .overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets information about a Device Defender audit suppression. *

* * @param describeAuditSuppressionRequest * @return A Java Future containing the result of the DescribeAuditSuppression operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DescribeAuditSuppression */ @Override public CompletableFuture describeAuditSuppression( DescribeAuditSuppressionRequest describeAuditSuppressionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeAuditSuppressionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeAuditSuppression"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeAuditSuppressionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeAuditSuppression") .withMarshaller(new DescribeAuditSuppressionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeAuditSuppressionRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeAuditSuppressionRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets information about a Device Defender audit. *

* * @param describeAuditTaskRequest * @return A Java Future containing the result of the DescribeAuditTask operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DescribeAuditTask */ @Override public CompletableFuture describeAuditTask(DescribeAuditTaskRequest describeAuditTaskRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeAuditTaskRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeAuditTask"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeAuditTaskResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeAuditTask") .withMarshaller(new DescribeAuditTaskRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeAuditTaskRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeAuditTaskRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes an authorizer. *

* * @param describeAuthorizerRequest * @return A Java Future containing the result of the DescribeAuthorizer operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DescribeAuthorizer */ @Override public CompletableFuture describeAuthorizer(DescribeAuthorizerRequest describeAuthorizerRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeAuthorizerRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeAuthorizer"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeAuthorizerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeAuthorizer") .withMarshaller(new DescribeAuthorizerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeAuthorizerRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeAuthorizerRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns information about a billing group. *

* * @param describeBillingGroupRequest * @return A Java Future containing the result of the DescribeBillingGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DescribeBillingGroup */ @Override public CompletableFuture describeBillingGroup( DescribeBillingGroupRequest describeBillingGroupRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeBillingGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeBillingGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeBillingGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeBillingGroup") .withMarshaller(new DescribeBillingGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeBillingGroupRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeBillingGroupRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes a registered CA certificate. *

* * @param describeCaCertificateRequest * The input for the DescribeCACertificate operation. * @return A Java Future containing the result of the DescribeCACertificate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DescribeCACertificate */ @Override public CompletableFuture describeCACertificate( DescribeCaCertificateRequest describeCaCertificateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeCaCertificateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeCACertificate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeCaCertificateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeCACertificate") .withMarshaller(new DescribeCaCertificateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeCaCertificateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeCaCertificateRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets information about the specified certificate. *

* * @param describeCertificateRequest * The input for the DescribeCertificate operation. * @return A Java Future containing the result of the DescribeCertificate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DescribeCertificate */ @Override public CompletableFuture describeCertificate( DescribeCertificateRequest describeCertificateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeCertificateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeCertificate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeCertificateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeCertificate") .withMarshaller(new DescribeCertificateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeCertificateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeCertificateRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets information about a Device Defender detect custom metric. *

* * @param describeCustomMetricRequest * @return A Java Future containing the result of the DescribeCustomMetric operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DescribeCustomMetric */ @Override public CompletableFuture describeCustomMetric( DescribeCustomMetricRequest describeCustomMetricRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeCustomMetricRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeCustomMetric"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeCustomMetricResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeCustomMetric") .withMarshaller(new DescribeCustomMetricRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeCustomMetricRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeCustomMetricRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes the default authorizer. *

* * @param describeDefaultAuthorizerRequest * @return A Java Future containing the result of the DescribeDefaultAuthorizer operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DescribeDefaultAuthorizer */ @Override public CompletableFuture describeDefaultAuthorizer( DescribeDefaultAuthorizerRequest describeDefaultAuthorizerRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeDefaultAuthorizerRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeDefaultAuthorizer"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeDefaultAuthorizerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeDefaultAuthorizer") .withMarshaller(new DescribeDefaultAuthorizerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeDefaultAuthorizerRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeDefaultAuthorizerRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets information about a Device Defender ML Detect mitigation action. *

* * @param describeDetectMitigationActionsTaskRequest * @return A Java Future containing the result of the DescribeDetectMitigationActionsTask operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DescribeDetectMitigationActionsTask */ @Override public CompletableFuture describeDetectMitigationActionsTask( DescribeDetectMitigationActionsTaskRequest describeDetectMitigationActionsTaskRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeDetectMitigationActionsTaskRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeDetectMitigationActionsTask"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, DescribeDetectMitigationActionsTaskResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeDetectMitigationActionsTask") .withMarshaller(new DescribeDetectMitigationActionsTaskRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeDetectMitigationActionsTaskRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeDetectMitigationActionsTaskRequest .overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Provides details about a dimension that is defined in your AWS account. *

* * @param describeDimensionRequest * @return A Java Future containing the result of the DescribeDimension operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalFailureException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DescribeDimension */ @Override public CompletableFuture describeDimension(DescribeDimensionRequest describeDimensionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeDimensionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeDimension"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeDimensionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeDimension") .withMarshaller(new DescribeDimensionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeDimensionRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeDimensionRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets summary information about a domain configuration. *

* * @param describeDomainConfigurationRequest * @return A Java Future containing the result of the DescribeDomainConfiguration operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DescribeDomainConfiguration */ @Override public CompletableFuture describeDomainConfiguration( DescribeDomainConfigurationRequest describeDomainConfigurationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeDomainConfigurationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeDomainConfiguration"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeDomainConfigurationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeDomainConfiguration") .withMarshaller(new DescribeDomainConfigurationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeDomainConfigurationRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeDomainConfigurationRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns a unique endpoint specific to the AWS account making the call. *

* * @param describeEndpointRequest * The input for the DescribeEndpoint operation. * @return A Java Future containing the result of the DescribeEndpoint operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalFailureException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DescribeEndpoint */ @Override public CompletableFuture describeEndpoint(DescribeEndpointRequest describeEndpointRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeEndpointRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeEndpoint"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeEndpointResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeEndpoint") .withMarshaller(new DescribeEndpointRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeEndpointRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeEndpointRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes event configurations. *

* * @param describeEventConfigurationsRequest * @return A Java Future containing the result of the DescribeEventConfigurations operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DescribeEventConfigurations */ @Override public CompletableFuture describeEventConfigurations( DescribeEventConfigurationsRequest describeEventConfigurationsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeEventConfigurationsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeEventConfigurations"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeEventConfigurationsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeEventConfigurations") .withMarshaller(new DescribeEventConfigurationsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeEventConfigurationsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeEventConfigurationsRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes a search index. *

* * @param describeIndexRequest * @return A Java Future containing the result of the DescribeIndex operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DescribeIndex */ @Override public CompletableFuture describeIndex(DescribeIndexRequest describeIndexRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeIndexRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeIndex"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DescribeIndexResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeIndex") .withMarshaller(new DescribeIndexRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeIndexRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeIndexRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes a job. *

* * @param describeJobRequest * @return A Java Future containing the result of the DescribeJob operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DescribeJob */ @Override public CompletableFuture describeJob(DescribeJobRequest describeJobRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeJob"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DescribeJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeJob").withMarshaller(new DescribeJobRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeJobRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeJobRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes a job execution. *

* * @param describeJobExecutionRequest * @return A Java Future containing the result of the DescribeJobExecution operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DescribeJobExecution */ @Override public CompletableFuture describeJobExecution( DescribeJobExecutionRequest describeJobExecutionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeJobExecutionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeJobExecution"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeJobExecutionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeJobExecution") .withMarshaller(new DescribeJobExecutionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeJobExecutionRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeJobExecutionRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns information about a job template. *

* * @param describeJobTemplateRequest * @return A Java Future containing the result of the DescribeJobTemplate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DescribeJobTemplate */ @Override public CompletableFuture describeJobTemplate( DescribeJobTemplateRequest describeJobTemplateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeJobTemplateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeJobTemplate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeJobTemplateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeJobTemplate") .withMarshaller(new DescribeJobTemplateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeJobTemplateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeJobTemplateRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets information about a mitigation action. *

* * @param describeMitigationActionRequest * @return A Java Future containing the result of the DescribeMitigationAction operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DescribeMitigationAction */ @Override public CompletableFuture describeMitigationAction( DescribeMitigationActionRequest describeMitigationActionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeMitigationActionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeMitigationAction"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeMitigationActionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeMitigationAction") .withMarshaller(new DescribeMitigationActionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeMitigationActionRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeMitigationActionRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns information about a fleet provisioning template. *

* * @param describeProvisioningTemplateRequest * @return A Java Future containing the result of the DescribeProvisioningTemplate operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalFailureException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DescribeProvisioningTemplate */ @Override public CompletableFuture describeProvisioningTemplate( DescribeProvisioningTemplateRequest describeProvisioningTemplateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeProvisioningTemplateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeProvisioningTemplate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeProvisioningTemplateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeProvisioningTemplate") .withMarshaller(new DescribeProvisioningTemplateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeProvisioningTemplateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeProvisioningTemplateRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns information about a fleet provisioning template version. *

* * @param describeProvisioningTemplateVersionRequest * @return A Java Future containing the result of the DescribeProvisioningTemplateVersion operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalFailureException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DescribeProvisioningTemplateVersion */ @Override public CompletableFuture describeProvisioningTemplateVersion( DescribeProvisioningTemplateVersionRequest describeProvisioningTemplateVersionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeProvisioningTemplateVersionRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeProvisioningTemplateVersion"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, DescribeProvisioningTemplateVersionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeProvisioningTemplateVersion") .withMarshaller(new DescribeProvisioningTemplateVersionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeProvisioningTemplateVersionRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeProvisioningTemplateVersionRequest .overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes a role alias. *

* * @param describeRoleAliasRequest * @return A Java Future containing the result of the DescribeRoleAlias operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DescribeRoleAlias */ @Override public CompletableFuture describeRoleAlias(DescribeRoleAliasRequest describeRoleAliasRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeRoleAliasRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeRoleAlias"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeRoleAliasResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeRoleAlias") .withMarshaller(new DescribeRoleAliasRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeRoleAliasRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeRoleAliasRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets information about a scheduled audit. *

* * @param describeScheduledAuditRequest * @return A Java Future containing the result of the DescribeScheduledAudit operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DescribeScheduledAudit */ @Override public CompletableFuture describeScheduledAudit( DescribeScheduledAuditRequest describeScheduledAuditRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeScheduledAuditRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeScheduledAudit"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeScheduledAuditResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeScheduledAudit") .withMarshaller(new DescribeScheduledAuditRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeScheduledAuditRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeScheduledAuditRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets information about a Device Defender security profile. *

* * @param describeSecurityProfileRequest * @return A Java Future containing the result of the DescribeSecurityProfile operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DescribeSecurityProfile */ @Override public CompletableFuture describeSecurityProfile( DescribeSecurityProfileRequest describeSecurityProfileRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeSecurityProfileRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeSecurityProfile"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeSecurityProfileResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeSecurityProfile") .withMarshaller(new DescribeSecurityProfileRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeSecurityProfileRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeSecurityProfileRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets information about a stream. *

* * @param describeStreamRequest * @return A Java Future containing the result of the DescribeStream operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DescribeStream */ @Override public CompletableFuture describeStream(DescribeStreamRequest describeStreamRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeStreamRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeStream"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeStreamResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeStream") .withMarshaller(new DescribeStreamRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeStreamRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeStreamRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets information about the specified thing. *

* * @param describeThingRequest * The input for the DescribeThing operation. * @return A Java Future containing the result of the DescribeThing operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DescribeThing */ @Override public CompletableFuture describeThing(DescribeThingRequest describeThingRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeThingRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeThing"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DescribeThingResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeThing") .withMarshaller(new DescribeThingRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeThingRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeThingRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describe a thing group. *

* * @param describeThingGroupRequest * @return A Java Future containing the result of the DescribeThingGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DescribeThingGroup */ @Override public CompletableFuture describeThingGroup(DescribeThingGroupRequest describeThingGroupRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeThingGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeThingGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeThingGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeThingGroup") .withMarshaller(new DescribeThingGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeThingGroupRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeThingGroupRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes a bulk thing provisioning task. *

* * @param describeThingRegistrationTaskRequest * @return A Java Future containing the result of the DescribeThingRegistrationTask operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DescribeThingRegistrationTask */ @Override public CompletableFuture describeThingRegistrationTask( DescribeThingRegistrationTaskRequest describeThingRegistrationTaskRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeThingRegistrationTaskRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeThingRegistrationTask"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeThingRegistrationTaskResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeThingRegistrationTask") .withMarshaller(new DescribeThingRegistrationTaskRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeThingRegistrationTaskRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeThingRegistrationTaskRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets information about the specified thing type. *

* * @param describeThingTypeRequest * The input for the DescribeThingType operation. * @return A Java Future containing the result of the DescribeThingType operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DescribeThingType */ @Override public CompletableFuture describeThingType(DescribeThingTypeRequest describeThingTypeRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeThingTypeRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeThingType"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeThingTypeResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeThingType") .withMarshaller(new DescribeThingTypeRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeThingTypeRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeThingTypeRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Detaches a policy from the specified target. *

* * @param detachPolicyRequest * @return A Java Future containing the result of the DetachPolicy operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • LimitExceededException A limit has been exceeded.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DetachPolicy */ @Override public CompletableFuture detachPolicy(DetachPolicyRequest detachPolicyRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, detachPolicyRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DetachPolicy"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DetachPolicyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DetachPolicy").withMarshaller(new DetachPolicyRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(detachPolicyRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = detachPolicyRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Disassociates a Device Defender security profile from a thing group or from this account. *

* * @param detachSecurityProfileRequest * @return A Java Future containing the result of the DetachSecurityProfile operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DetachSecurityProfile */ @Override public CompletableFuture detachSecurityProfile( DetachSecurityProfileRequest detachSecurityProfileRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, detachSecurityProfileRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DetachSecurityProfile"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DetachSecurityProfileResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DetachSecurityProfile") .withMarshaller(new DetachSecurityProfileRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(detachSecurityProfileRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = detachSecurityProfileRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Detaches the specified principal from the specified thing. A principal can be X.509 certificates, IAM users, * groups, and roles, Amazon Cognito identities or federated identities. *

* *

* This call is asynchronous. It might take several seconds for the detachment to propagate. *

*
* * @param detachThingPrincipalRequest * The input for the DetachThingPrincipal operation. * @return A Java Future containing the result of the DetachThingPrincipal operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DetachThingPrincipal */ @Override public CompletableFuture detachThingPrincipal( DetachThingPrincipalRequest detachThingPrincipalRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, detachThingPrincipalRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DetachThingPrincipal"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DetachThingPrincipalResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DetachThingPrincipal") .withMarshaller(new DetachThingPrincipalRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(detachThingPrincipalRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = detachThingPrincipalRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Disables the rule. *

* * @param disableTopicRuleRequest * The input for the DisableTopicRuleRequest operation. * @return A Java Future containing the result of the DisableTopicRule operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ConflictingResourceUpdateException A conflicting resource update exception. This exception is thrown * when two pending updates cause a conflict.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.DisableTopicRule */ @Override public CompletableFuture disableTopicRule(DisableTopicRuleRequest disableTopicRuleRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, disableTopicRuleRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DisableTopicRule"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DisableTopicRuleResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DisableTopicRule") .withMarshaller(new DisableTopicRuleRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(disableTopicRuleRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = disableTopicRuleRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Enables the rule. *

* * @param enableTopicRuleRequest * The input for the EnableTopicRuleRequest operation. * @return A Java Future containing the result of the EnableTopicRule operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ConflictingResourceUpdateException A conflicting resource update exception. This exception is thrown * when two pending updates cause a conflict.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.EnableTopicRule */ @Override public CompletableFuture enableTopicRule(EnableTopicRuleRequest enableTopicRuleRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, enableTopicRuleRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "EnableTopicRule"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, EnableTopicRuleResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("EnableTopicRule") .withMarshaller(new EnableTopicRuleRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(enableTopicRuleRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = enableTopicRuleRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns a Device Defender's ML Detect Security Profile training model's status. *

* * @param getBehaviorModelTrainingSummariesRequest * @return A Java Future containing the result of the GetBehaviorModelTrainingSummaries operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.GetBehaviorModelTrainingSummaries */ @Override public CompletableFuture getBehaviorModelTrainingSummaries( GetBehaviorModelTrainingSummariesRequest getBehaviorModelTrainingSummariesRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getBehaviorModelTrainingSummariesRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetBehaviorModelTrainingSummaries"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, GetBehaviorModelTrainingSummariesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetBehaviorModelTrainingSummaries") .withMarshaller(new GetBehaviorModelTrainingSummariesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getBehaviorModelTrainingSummariesRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getBehaviorModelTrainingSummariesRequest .overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns a Device Defender's ML Detect Security Profile training model's status. *

*
*

* This is a variant of * {@link #getBehaviorModelTrainingSummaries(software.amazon.awssdk.services.iot.model.GetBehaviorModelTrainingSummariesRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.GetBehaviorModelTrainingSummariesPublisher publisher = client.getBehaviorModelTrainingSummariesPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.GetBehaviorModelTrainingSummariesPublisher publisher = client.getBehaviorModelTrainingSummariesPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.GetBehaviorModelTrainingSummariesResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #getBehaviorModelTrainingSummaries(software.amazon.awssdk.services.iot.model.GetBehaviorModelTrainingSummariesRequest)} * operation. *

* * @param getBehaviorModelTrainingSummariesRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.GetBehaviorModelTrainingSummaries */ public GetBehaviorModelTrainingSummariesPublisher getBehaviorModelTrainingSummariesPaginator( GetBehaviorModelTrainingSummariesRequest getBehaviorModelTrainingSummariesRequest) { return new GetBehaviorModelTrainingSummariesPublisher(this, applyPaginatorUserAgent(getBehaviorModelTrainingSummariesRequest)); } /** *

* Returns the approximate count of unique values that match the query. *

* * @param getCardinalityRequest * @return A Java Future containing the result of the GetCardinality operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidQueryException The query is invalid.
  • *
  • InvalidAggregationException The aggregation is invalid.
  • *
  • IndexNotReadyException The index is not ready.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.GetCardinality */ @Override public CompletableFuture getCardinality(GetCardinalityRequest getCardinalityRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getCardinalityRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetCardinality"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetCardinalityResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetCardinality") .withMarshaller(new GetCardinalityRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getCardinalityRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getCardinalityRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets a list of the policies that have an effect on the authorization behavior of the specified device when it * connects to the AWS IoT device gateway. *

* * @param getEffectivePoliciesRequest * @return A Java Future containing the result of the GetEffectivePolicies operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • LimitExceededException A limit has been exceeded.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.GetEffectivePolicies */ @Override public CompletableFuture getEffectivePolicies( GetEffectivePoliciesRequest getEffectivePoliciesRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getEffectivePoliciesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetEffectivePolicies"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetEffectivePoliciesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetEffectivePolicies") .withMarshaller(new GetEffectivePoliciesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getEffectivePoliciesRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getEffectivePoliciesRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets the indexing configuration. *

* * @param getIndexingConfigurationRequest * @return A Java Future containing the result of the GetIndexingConfiguration operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.GetIndexingConfiguration */ @Override public CompletableFuture getIndexingConfiguration( GetIndexingConfigurationRequest getIndexingConfigurationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getIndexingConfigurationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetIndexingConfiguration"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetIndexingConfigurationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetIndexingConfiguration") .withMarshaller(new GetIndexingConfigurationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getIndexingConfigurationRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getIndexingConfigurationRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets a job document. *

* * @param getJobDocumentRequest * @return A Java Future containing the result of the GetJobDocument operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.GetJobDocument */ @Override public CompletableFuture getJobDocument(GetJobDocumentRequest getJobDocumentRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getJobDocumentRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetJobDocument"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetJobDocumentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetJobDocument") .withMarshaller(new GetJobDocumentRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getJobDocumentRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getJobDocumentRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets the logging options. *

*

* NOTE: use of this command is not recommended. Use GetV2LoggingOptions instead. *

* * @param getLoggingOptionsRequest * The input for the GetLoggingOptions operation. * @return A Java Future containing the result of the GetLoggingOptions operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.GetLoggingOptions */ @Override public CompletableFuture getLoggingOptions(GetLoggingOptionsRequest getLoggingOptionsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getLoggingOptionsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetLoggingOptions"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetLoggingOptionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetLoggingOptions") .withMarshaller(new GetLoggingOptionsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getLoggingOptionsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getLoggingOptionsRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets an OTA update. *

* * @param getOtaUpdateRequest * @return A Java Future containing the result of the GetOTAUpdate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.GetOTAUpdate */ @Override public CompletableFuture getOTAUpdate(GetOtaUpdateRequest getOtaUpdateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getOtaUpdateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetOTAUpdate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetOtaUpdateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetOTAUpdate").withMarshaller(new GetOtaUpdateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getOtaUpdateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getOtaUpdateRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Groups the aggregated values that match the query into percentile groupings. The default percentile groupings * are: 1,5,25,50,75,95,99, although you can specify your own when you call GetPercentiles. This * function returns a value for each percentile group specified (or the default percentile groupings). The * percentile group "1" contains the aggregated field value that occurs in approximately one percent of the values * that match the query. The percentile group "5" contains the aggregated field value that occurs in approximately * five percent of the values that match the query, and so on. The result is an approximation, the more values that * match the query, the more accurate the percentile values. *

* * @param getPercentilesRequest * @return A Java Future containing the result of the GetPercentiles operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidQueryException The query is invalid.
  • *
  • InvalidAggregationException The aggregation is invalid.
  • *
  • IndexNotReadyException The index is not ready.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.GetPercentiles */ @Override public CompletableFuture getPercentiles(GetPercentilesRequest getPercentilesRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getPercentilesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetPercentiles"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetPercentilesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetPercentiles") .withMarshaller(new GetPercentilesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getPercentilesRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getPercentilesRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets information about the specified policy with the policy document of the default version. *

* * @param getPolicyRequest * The input for the GetPolicy operation. * @return A Java Future containing the result of the GetPolicy operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.GetPolicy */ @Override public CompletableFuture getPolicy(GetPolicyRequest getPolicyRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getPolicyRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetPolicy"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetPolicyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("GetPolicy") .withMarshaller(new GetPolicyRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withMetricCollector(apiCallMetricCollector) .withInput(getPolicyRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getPolicyRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets information about the specified policy version. *

* * @param getPolicyVersionRequest * The input for the GetPolicyVersion operation. * @return A Java Future containing the result of the GetPolicyVersion operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.GetPolicyVersion */ @Override public CompletableFuture getPolicyVersion(GetPolicyVersionRequest getPolicyVersionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getPolicyVersionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetPolicyVersion"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetPolicyVersionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetPolicyVersion") .withMarshaller(new GetPolicyVersionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getPolicyVersionRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getPolicyVersionRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets a registration code used to register a CA certificate with AWS IoT. *

* * @param getRegistrationCodeRequest * The input to the GetRegistrationCode operation. * @return A Java Future containing the result of the GetRegistrationCode operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.GetRegistrationCode */ @Override public CompletableFuture getRegistrationCode( GetRegistrationCodeRequest getRegistrationCodeRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getRegistrationCodeRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetRegistrationCode"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetRegistrationCodeResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetRegistrationCode") .withMarshaller(new GetRegistrationCodeRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getRegistrationCodeRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getRegistrationCodeRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns the count, average, sum, minimum, maximum, sum of squares, variance, and standard deviation for the * specified aggregated field. If the aggregation field is of type String, only the count statistic is * returned. *

* * @param getStatisticsRequest * @return A Java Future containing the result of the GetStatistics operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidQueryException The query is invalid.
  • *
  • InvalidAggregationException The aggregation is invalid.
  • *
  • IndexNotReadyException The index is not ready.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.GetStatistics */ @Override public CompletableFuture getStatistics(GetStatisticsRequest getStatisticsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getStatisticsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetStatistics"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetStatisticsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetStatistics") .withMarshaller(new GetStatisticsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getStatisticsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getStatisticsRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets information about the rule. *

* * @param getTopicRuleRequest * The input for the GetTopicRule operation. * @return A Java Future containing the result of the GetTopicRule operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.GetTopicRule */ @Override public CompletableFuture getTopicRule(GetTopicRuleRequest getTopicRuleRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getTopicRuleRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetTopicRule"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetTopicRuleResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetTopicRule").withMarshaller(new GetTopicRuleRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getTopicRuleRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getTopicRuleRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets information about a topic rule destination. *

* * @param getTopicRuleDestinationRequest * @return A Java Future containing the result of the GetTopicRuleDestination operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.GetTopicRuleDestination */ @Override public CompletableFuture getTopicRuleDestination( GetTopicRuleDestinationRequest getTopicRuleDestinationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getTopicRuleDestinationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetTopicRuleDestination"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetTopicRuleDestinationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetTopicRuleDestination") .withMarshaller(new GetTopicRuleDestinationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getTopicRuleDestinationRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getTopicRuleDestinationRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets the fine grained logging options. *

* * @param getV2LoggingOptionsRequest * @return A Java Future containing the result of the GetV2LoggingOptions operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalException An unexpected error has occurred.
  • *
  • NotConfiguredException The resource is not configured.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.GetV2LoggingOptions */ @Override public CompletableFuture getV2LoggingOptions( GetV2LoggingOptionsRequest getV2LoggingOptionsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getV2LoggingOptionsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetV2LoggingOptions"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetV2LoggingOptionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetV2LoggingOptions") .withMarshaller(new GetV2LoggingOptionsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getV2LoggingOptionsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getV2LoggingOptionsRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the active violations for a given Device Defender security profile. *

* * @param listActiveViolationsRequest * @return A Java Future containing the result of the ListActiveViolations operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListActiveViolations */ @Override public CompletableFuture listActiveViolations( ListActiveViolationsRequest listActiveViolationsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listActiveViolationsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListActiveViolations"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListActiveViolationsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListActiveViolations") .withMarshaller(new ListActiveViolationsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listActiveViolationsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listActiveViolationsRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the active violations for a given Device Defender security profile. *

*
*

* This is a variant of * {@link #listActiveViolations(software.amazon.awssdk.services.iot.model.ListActiveViolationsRequest)} operation. * The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will * internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListActiveViolationsPublisher publisher = client.listActiveViolationsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListActiveViolationsPublisher publisher = client.listActiveViolationsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListActiveViolationsResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listActiveViolations(software.amazon.awssdk.services.iot.model.ListActiveViolationsRequest)} * operation. *

* * @param listActiveViolationsRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListActiveViolations */ public ListActiveViolationsPublisher listActiveViolationsPaginator(ListActiveViolationsRequest listActiveViolationsRequest) { return new ListActiveViolationsPublisher(this, applyPaginatorUserAgent(listActiveViolationsRequest)); } /** *

* Lists the policies attached to the specified thing group. *

* * @param listAttachedPoliciesRequest * @return A Java Future containing the result of the ListAttachedPolicies operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • LimitExceededException A limit has been exceeded.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListAttachedPolicies */ @Override public CompletableFuture listAttachedPolicies( ListAttachedPoliciesRequest listAttachedPoliciesRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listAttachedPoliciesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListAttachedPolicies"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListAttachedPoliciesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListAttachedPolicies") .withMarshaller(new ListAttachedPoliciesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listAttachedPoliciesRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listAttachedPoliciesRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the policies attached to the specified thing group. *

*
*

* This is a variant of * {@link #listAttachedPolicies(software.amazon.awssdk.services.iot.model.ListAttachedPoliciesRequest)} operation. * The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will * internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListAttachedPoliciesPublisher publisher = client.listAttachedPoliciesPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListAttachedPoliciesPublisher publisher = client.listAttachedPoliciesPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListAttachedPoliciesResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of pageSize won't limit the number of results you get with the paginator. * It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listAttachedPolicies(software.amazon.awssdk.services.iot.model.ListAttachedPoliciesRequest)} * operation. *

* * @param listAttachedPoliciesRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • LimitExceededException A limit has been exceeded.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListAttachedPolicies */ public ListAttachedPoliciesPublisher listAttachedPoliciesPaginator(ListAttachedPoliciesRequest listAttachedPoliciesRequest) { return new ListAttachedPoliciesPublisher(this, applyPaginatorUserAgent(listAttachedPoliciesRequest)); } /** *

* Lists the findings (results) of a Device Defender audit or of the audits performed during a specified time * period. (Findings are retained for 90 days.) *

* * @param listAuditFindingsRequest * @return A Java Future containing the result of the ListAuditFindings operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListAuditFindings */ @Override public CompletableFuture listAuditFindings(ListAuditFindingsRequest listAuditFindingsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listAuditFindingsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListAuditFindings"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListAuditFindingsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListAuditFindings") .withMarshaller(new ListAuditFindingsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listAuditFindingsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listAuditFindingsRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the findings (results) of a Device Defender audit or of the audits performed during a specified time * period. (Findings are retained for 90 days.) *

*
*

* This is a variant of * {@link #listAuditFindings(software.amazon.awssdk.services.iot.model.ListAuditFindingsRequest)} operation. The * return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will * internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListAuditFindingsPublisher publisher = client.listAuditFindingsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListAuditFindingsPublisher publisher = client.listAuditFindingsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListAuditFindingsResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listAuditFindings(software.amazon.awssdk.services.iot.model.ListAuditFindingsRequest)} operation. *

* * @param listAuditFindingsRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListAuditFindings */ public ListAuditFindingsPublisher listAuditFindingsPaginator(ListAuditFindingsRequest listAuditFindingsRequest) { return new ListAuditFindingsPublisher(this, applyPaginatorUserAgent(listAuditFindingsRequest)); } /** *

* Gets the status of audit mitigation action tasks that were executed. *

* * @param listAuditMitigationActionsExecutionsRequest * @return A Java Future containing the result of the ListAuditMitigationActionsExecutions operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListAuditMitigationActionsExecutions */ @Override public CompletableFuture listAuditMitigationActionsExecutions( ListAuditMitigationActionsExecutionsRequest listAuditMitigationActionsExecutionsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listAuditMitigationActionsExecutionsRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListAuditMitigationActionsExecutions"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, ListAuditMitigationActionsExecutionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListAuditMitigationActionsExecutions") .withMarshaller(new ListAuditMitigationActionsExecutionsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listAuditMitigationActionsExecutionsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listAuditMitigationActionsExecutionsRequest .overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture .whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets the status of audit mitigation action tasks that were executed. *

*
*

* This is a variant of * {@link #listAuditMitigationActionsExecutions(software.amazon.awssdk.services.iot.model.ListAuditMitigationActionsExecutionsRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListAuditMitigationActionsExecutionsPublisher publisher = client.listAuditMitigationActionsExecutionsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListAuditMitigationActionsExecutionsPublisher publisher = client.listAuditMitigationActionsExecutionsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListAuditMitigationActionsExecutionsResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listAuditMitigationActionsExecutions(software.amazon.awssdk.services.iot.model.ListAuditMitigationActionsExecutionsRequest)} * operation. *

* * @param listAuditMitigationActionsExecutionsRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListAuditMitigationActionsExecutions */ public ListAuditMitigationActionsExecutionsPublisher listAuditMitigationActionsExecutionsPaginator( ListAuditMitigationActionsExecutionsRequest listAuditMitigationActionsExecutionsRequest) { return new ListAuditMitigationActionsExecutionsPublisher(this, applyPaginatorUserAgent(listAuditMitigationActionsExecutionsRequest)); } /** *

* Gets a list of audit mitigation action tasks that match the specified filters. *

* * @param listAuditMitigationActionsTasksRequest * @return A Java Future containing the result of the ListAuditMitigationActionsTasks operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListAuditMitigationActionsTasks */ @Override public CompletableFuture listAuditMitigationActionsTasks( ListAuditMitigationActionsTasksRequest listAuditMitigationActionsTasksRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listAuditMitigationActionsTasksRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListAuditMitigationActionsTasks"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListAuditMitigationActionsTasksResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListAuditMitigationActionsTasks") .withMarshaller(new ListAuditMitigationActionsTasksRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listAuditMitigationActionsTasksRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listAuditMitigationActionsTasksRequest .overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets a list of audit mitigation action tasks that match the specified filters. *

*
*

* This is a variant of * {@link #listAuditMitigationActionsTasks(software.amazon.awssdk.services.iot.model.ListAuditMitigationActionsTasksRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListAuditMitigationActionsTasksPublisher publisher = client.listAuditMitigationActionsTasksPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListAuditMitigationActionsTasksPublisher publisher = client.listAuditMitigationActionsTasksPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListAuditMitigationActionsTasksResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listAuditMitigationActionsTasks(software.amazon.awssdk.services.iot.model.ListAuditMitigationActionsTasksRequest)} * operation. *

* * @param listAuditMitigationActionsTasksRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListAuditMitigationActionsTasks */ public ListAuditMitigationActionsTasksPublisher listAuditMitigationActionsTasksPaginator( ListAuditMitigationActionsTasksRequest listAuditMitigationActionsTasksRequest) { return new ListAuditMitigationActionsTasksPublisher(this, applyPaginatorUserAgent(listAuditMitigationActionsTasksRequest)); } /** *

* Lists your Device Defender audit listings. *

* * @param listAuditSuppressionsRequest * @return A Java Future containing the result of the ListAuditSuppressions operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListAuditSuppressions */ @Override public CompletableFuture listAuditSuppressions( ListAuditSuppressionsRequest listAuditSuppressionsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listAuditSuppressionsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListAuditSuppressions"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListAuditSuppressionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListAuditSuppressions") .withMarshaller(new ListAuditSuppressionsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listAuditSuppressionsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listAuditSuppressionsRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists your Device Defender audit listings. *

*
*

* This is a variant of * {@link #listAuditSuppressions(software.amazon.awssdk.services.iot.model.ListAuditSuppressionsRequest)} operation. * The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will * internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListAuditSuppressionsPublisher publisher = client.listAuditSuppressionsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListAuditSuppressionsPublisher publisher = client.listAuditSuppressionsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListAuditSuppressionsResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listAuditSuppressions(software.amazon.awssdk.services.iot.model.ListAuditSuppressionsRequest)} * operation. *

* * @param listAuditSuppressionsRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListAuditSuppressions */ public ListAuditSuppressionsPublisher listAuditSuppressionsPaginator(ListAuditSuppressionsRequest listAuditSuppressionsRequest) { return new ListAuditSuppressionsPublisher(this, applyPaginatorUserAgent(listAuditSuppressionsRequest)); } /** *

* Lists the Device Defender audits that have been performed during a given time period. *

* * @param listAuditTasksRequest * @return A Java Future containing the result of the ListAuditTasks operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListAuditTasks */ @Override public CompletableFuture listAuditTasks(ListAuditTasksRequest listAuditTasksRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listAuditTasksRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListAuditTasks"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListAuditTasksResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListAuditTasks") .withMarshaller(new ListAuditTasksRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listAuditTasksRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listAuditTasksRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the Device Defender audits that have been performed during a given time period. *

*
*

* This is a variant of {@link #listAuditTasks(software.amazon.awssdk.services.iot.model.ListAuditTasksRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListAuditTasksPublisher publisher = client.listAuditTasksPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListAuditTasksPublisher publisher = client.listAuditTasksPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListAuditTasksResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listAuditTasks(software.amazon.awssdk.services.iot.model.ListAuditTasksRequest)} operation. *

* * @param listAuditTasksRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListAuditTasks */ public ListAuditTasksPublisher listAuditTasksPaginator(ListAuditTasksRequest listAuditTasksRequest) { return new ListAuditTasksPublisher(this, applyPaginatorUserAgent(listAuditTasksRequest)); } /** *

* Lists the authorizers registered in your account. *

* * @param listAuthorizersRequest * @return A Java Future containing the result of the ListAuthorizers operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListAuthorizers */ @Override public CompletableFuture listAuthorizers(ListAuthorizersRequest listAuthorizersRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listAuthorizersRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListAuthorizers"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListAuthorizersResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListAuthorizers") .withMarshaller(new ListAuthorizersRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listAuthorizersRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listAuthorizersRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the authorizers registered in your account. *

*
*

* This is a variant of {@link #listAuthorizers(software.amazon.awssdk.services.iot.model.ListAuthorizersRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListAuthorizersPublisher publisher = client.listAuthorizersPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListAuthorizersPublisher publisher = client.listAuthorizersPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListAuthorizersResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of pageSize won't limit the number of results you get with the paginator. * It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listAuthorizers(software.amazon.awssdk.services.iot.model.ListAuthorizersRequest)} operation. *

* * @param listAuthorizersRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListAuthorizers */ public ListAuthorizersPublisher listAuthorizersPaginator(ListAuthorizersRequest listAuthorizersRequest) { return new ListAuthorizersPublisher(this, applyPaginatorUserAgent(listAuthorizersRequest)); } /** *

* Lists the billing groups you have created. *

* * @param listBillingGroupsRequest * @return A Java Future containing the result of the ListBillingGroups operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListBillingGroups */ @Override public CompletableFuture listBillingGroups(ListBillingGroupsRequest listBillingGroupsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listBillingGroupsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListBillingGroups"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListBillingGroupsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListBillingGroups") .withMarshaller(new ListBillingGroupsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listBillingGroupsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listBillingGroupsRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the billing groups you have created. *

*
*

* This is a variant of * {@link #listBillingGroups(software.amazon.awssdk.services.iot.model.ListBillingGroupsRequest)} operation. The * return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will * internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListBillingGroupsPublisher publisher = client.listBillingGroupsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListBillingGroupsPublisher publisher = client.listBillingGroupsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListBillingGroupsResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listBillingGroups(software.amazon.awssdk.services.iot.model.ListBillingGroupsRequest)} operation. *

* * @param listBillingGroupsRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListBillingGroups */ public ListBillingGroupsPublisher listBillingGroupsPaginator(ListBillingGroupsRequest listBillingGroupsRequest) { return new ListBillingGroupsPublisher(this, applyPaginatorUserAgent(listBillingGroupsRequest)); } /** *

* Lists the CA certificates registered for your AWS account. *

*

* The results are paginated with a default page size of 25. You can use the returned marker to retrieve additional * results. *

* * @param listCaCertificatesRequest * Input for the ListCACertificates operation. * @return A Java Future containing the result of the ListCACertificates operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListCACertificates */ @Override public CompletableFuture listCACertificates(ListCaCertificatesRequest listCaCertificatesRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listCaCertificatesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListCACertificates"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListCaCertificatesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListCACertificates") .withMarshaller(new ListCaCertificatesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listCaCertificatesRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listCaCertificatesRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the CA certificates registered for your AWS account. *

*

* The results are paginated with a default page size of 25. You can use the returned marker to retrieve additional * results. *

*
*

* This is a variant of * {@link #listCACertificates(software.amazon.awssdk.services.iot.model.ListCaCertificatesRequest)} operation. The * return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will * internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListCACertificatesPublisher publisher = client.listCACertificatesPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListCACertificatesPublisher publisher = client.listCACertificatesPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListCaCertificatesResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of pageSize won't limit the number of results you get with the paginator. * It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listCACertificates(software.amazon.awssdk.services.iot.model.ListCaCertificatesRequest)} operation. *

* * @param listCaCertificatesRequest * Input for the ListCACertificates operation. * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListCACertificates */ public ListCACertificatesPublisher listCACertificatesPaginator(ListCaCertificatesRequest listCaCertificatesRequest) { return new ListCACertificatesPublisher(this, applyPaginatorUserAgent(listCaCertificatesRequest)); } /** *

* Lists the certificates registered in your AWS account. *

*

* The results are paginated with a default page size of 25. You can use the returned marker to retrieve additional * results. *

* * @param listCertificatesRequest * The input for the ListCertificates operation. * @return A Java Future containing the result of the ListCertificates operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListCertificates */ @Override public CompletableFuture listCertificates(ListCertificatesRequest listCertificatesRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listCertificatesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListCertificates"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListCertificatesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListCertificates") .withMarshaller(new ListCertificatesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listCertificatesRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listCertificatesRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* List the device certificates signed by the specified CA certificate. *

* * @param listCertificatesByCaRequest * The input to the ListCertificatesByCA operation. * @return A Java Future containing the result of the ListCertificatesByCA operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListCertificatesByCA */ @Override public CompletableFuture listCertificatesByCA( ListCertificatesByCaRequest listCertificatesByCaRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listCertificatesByCaRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListCertificatesByCA"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListCertificatesByCaResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListCertificatesByCA") .withMarshaller(new ListCertificatesByCaRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listCertificatesByCaRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listCertificatesByCaRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* List the device certificates signed by the specified CA certificate. *

*
*

* This is a variant of * {@link #listCertificatesByCA(software.amazon.awssdk.services.iot.model.ListCertificatesByCaRequest)} operation. * The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will * internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListCertificatesByCAPublisher publisher = client.listCertificatesByCAPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListCertificatesByCAPublisher publisher = client.listCertificatesByCAPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListCertificatesByCaResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of pageSize won't limit the number of results you get with the paginator. * It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listCertificatesByCA(software.amazon.awssdk.services.iot.model.ListCertificatesByCaRequest)} * operation. *

* * @param listCertificatesByCaRequest * The input to the ListCertificatesByCA operation. * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListCertificatesByCA */ public ListCertificatesByCAPublisher listCertificatesByCAPaginator(ListCertificatesByCaRequest listCertificatesByCaRequest) { return new ListCertificatesByCAPublisher(this, applyPaginatorUserAgent(listCertificatesByCaRequest)); } /** *

* Lists the certificates registered in your AWS account. *

*

* The results are paginated with a default page size of 25. You can use the returned marker to retrieve additional * results. *

*
*

* This is a variant of {@link #listCertificates(software.amazon.awssdk.services.iot.model.ListCertificatesRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListCertificatesPublisher publisher = client.listCertificatesPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListCertificatesPublisher publisher = client.listCertificatesPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListCertificatesResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of pageSize won't limit the number of results you get with the paginator. * It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listCertificates(software.amazon.awssdk.services.iot.model.ListCertificatesRequest)} operation. *

* * @param listCertificatesRequest * The input for the ListCertificates operation. * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListCertificates */ public ListCertificatesPublisher listCertificatesPaginator(ListCertificatesRequest listCertificatesRequest) { return new ListCertificatesPublisher(this, applyPaginatorUserAgent(listCertificatesRequest)); } /** *

* Lists your Device Defender detect custom metrics. *

* * @param listCustomMetricsRequest * @return A Java Future containing the result of the ListCustomMetrics operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListCustomMetrics */ @Override public CompletableFuture listCustomMetrics(ListCustomMetricsRequest listCustomMetricsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listCustomMetricsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListCustomMetrics"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListCustomMetricsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListCustomMetrics") .withMarshaller(new ListCustomMetricsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listCustomMetricsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listCustomMetricsRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists your Device Defender detect custom metrics. *

*
*

* This is a variant of * {@link #listCustomMetrics(software.amazon.awssdk.services.iot.model.ListCustomMetricsRequest)} operation. The * return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will * internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListCustomMetricsPublisher publisher = client.listCustomMetricsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListCustomMetricsPublisher publisher = client.listCustomMetricsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListCustomMetricsResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listCustomMetrics(software.amazon.awssdk.services.iot.model.ListCustomMetricsRequest)} operation. *

* * @param listCustomMetricsRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListCustomMetrics */ public ListCustomMetricsPublisher listCustomMetricsPaginator(ListCustomMetricsRequest listCustomMetricsRequest) { return new ListCustomMetricsPublisher(this, applyPaginatorUserAgent(listCustomMetricsRequest)); } /** *

* Lists mitigation actions executions for a Device Defender ML Detect Security Profile. *

* * @param listDetectMitigationActionsExecutionsRequest * @return A Java Future containing the result of the ListDetectMitigationActionsExecutions operation returned by * the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListDetectMitigationActionsExecutions */ @Override public CompletableFuture listDetectMitigationActionsExecutions( ListDetectMitigationActionsExecutionsRequest listDetectMitigationActionsExecutionsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listDetectMitigationActionsExecutionsRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListDetectMitigationActionsExecutions"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, ListDetectMitigationActionsExecutionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListDetectMitigationActionsExecutions") .withMarshaller(new ListDetectMitigationActionsExecutionsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listDetectMitigationActionsExecutionsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listDetectMitigationActionsExecutionsRequest .overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture .whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists mitigation actions executions for a Device Defender ML Detect Security Profile. *

*
*

* This is a variant of * {@link #listDetectMitigationActionsExecutions(software.amazon.awssdk.services.iot.model.ListDetectMitigationActionsExecutionsRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListDetectMitigationActionsExecutionsPublisher publisher = client.listDetectMitigationActionsExecutionsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListDetectMitigationActionsExecutionsPublisher publisher = client.listDetectMitigationActionsExecutionsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListDetectMitigationActionsExecutionsResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listDetectMitigationActionsExecutions(software.amazon.awssdk.services.iot.model.ListDetectMitigationActionsExecutionsRequest)} * operation. *

* * @param listDetectMitigationActionsExecutionsRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListDetectMitigationActionsExecutions */ public ListDetectMitigationActionsExecutionsPublisher listDetectMitigationActionsExecutionsPaginator( ListDetectMitigationActionsExecutionsRequest listDetectMitigationActionsExecutionsRequest) { return new ListDetectMitigationActionsExecutionsPublisher(this, applyPaginatorUserAgent(listDetectMitigationActionsExecutionsRequest)); } /** *

* List of Device Defender ML Detect mitigation actions tasks. *

* * @param listDetectMitigationActionsTasksRequest * @return A Java Future containing the result of the ListDetectMitigationActionsTasks operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListDetectMitigationActionsTasks */ @Override public CompletableFuture listDetectMitigationActionsTasks( ListDetectMitigationActionsTasksRequest listDetectMitigationActionsTasksRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listDetectMitigationActionsTasksRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListDetectMitigationActionsTasks"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, ListDetectMitigationActionsTasksResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListDetectMitigationActionsTasks") .withMarshaller(new ListDetectMitigationActionsTasksRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listDetectMitigationActionsTasksRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listDetectMitigationActionsTasksRequest .overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* List of Device Defender ML Detect mitigation actions tasks. *

*
*

* This is a variant of * {@link #listDetectMitigationActionsTasks(software.amazon.awssdk.services.iot.model.ListDetectMitigationActionsTasksRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListDetectMitigationActionsTasksPublisher publisher = client.listDetectMitigationActionsTasksPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListDetectMitigationActionsTasksPublisher publisher = client.listDetectMitigationActionsTasksPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListDetectMitigationActionsTasksResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listDetectMitigationActionsTasks(software.amazon.awssdk.services.iot.model.ListDetectMitigationActionsTasksRequest)} * operation. *

* * @param listDetectMitigationActionsTasksRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListDetectMitigationActionsTasks */ public ListDetectMitigationActionsTasksPublisher listDetectMitigationActionsTasksPaginator( ListDetectMitigationActionsTasksRequest listDetectMitigationActionsTasksRequest) { return new ListDetectMitigationActionsTasksPublisher(this, applyPaginatorUserAgent(listDetectMitigationActionsTasksRequest)); } /** *

* List the set of dimensions that are defined for your AWS account. *

* * @param listDimensionsRequest * @return A Java Future containing the result of the ListDimensions operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalFailureException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListDimensions */ @Override public CompletableFuture listDimensions(ListDimensionsRequest listDimensionsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listDimensionsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListDimensions"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListDimensionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListDimensions") .withMarshaller(new ListDimensionsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listDimensionsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listDimensionsRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* List the set of dimensions that are defined for your AWS account. *

*
*

* This is a variant of {@link #listDimensions(software.amazon.awssdk.services.iot.model.ListDimensionsRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListDimensionsPublisher publisher = client.listDimensionsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListDimensionsPublisher publisher = client.listDimensionsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListDimensionsResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listDimensions(software.amazon.awssdk.services.iot.model.ListDimensionsRequest)} operation. *

* * @param listDimensionsRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalFailureException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListDimensions */ public ListDimensionsPublisher listDimensionsPaginator(ListDimensionsRequest listDimensionsRequest) { return new ListDimensionsPublisher(this, applyPaginatorUserAgent(listDimensionsRequest)); } /** *

* Gets a list of domain configurations for the user. This list is sorted alphabetically by domain configuration * name. *

* * @param listDomainConfigurationsRequest * @return A Java Future containing the result of the ListDomainConfigurations operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListDomainConfigurations */ @Override public CompletableFuture listDomainConfigurations( ListDomainConfigurationsRequest listDomainConfigurationsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listDomainConfigurationsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListDomainConfigurations"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListDomainConfigurationsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListDomainConfigurations") .withMarshaller(new ListDomainConfigurationsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listDomainConfigurationsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listDomainConfigurationsRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets a list of domain configurations for the user. This list is sorted alphabetically by domain configuration * name. *

*
*

* This is a variant of * {@link #listDomainConfigurations(software.amazon.awssdk.services.iot.model.ListDomainConfigurationsRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListDomainConfigurationsPublisher publisher = client.listDomainConfigurationsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListDomainConfigurationsPublisher publisher = client.listDomainConfigurationsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListDomainConfigurationsResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of pageSize won't limit the number of results you get with the paginator. * It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listDomainConfigurations(software.amazon.awssdk.services.iot.model.ListDomainConfigurationsRequest)} * operation. *

* * @param listDomainConfigurationsRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListDomainConfigurations */ public ListDomainConfigurationsPublisher listDomainConfigurationsPaginator( ListDomainConfigurationsRequest listDomainConfigurationsRequest) { return new ListDomainConfigurationsPublisher(this, applyPaginatorUserAgent(listDomainConfigurationsRequest)); } /** *

* Lists the search indices. *

* * @param listIndicesRequest * @return A Java Future containing the result of the ListIndices operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListIndices */ @Override public CompletableFuture listIndices(ListIndicesRequest listIndicesRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listIndicesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListIndices"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListIndicesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListIndices").withMarshaller(new ListIndicesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listIndicesRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listIndicesRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the search indices. *

*
*

* This is a variant of {@link #listIndices(software.amazon.awssdk.services.iot.model.ListIndicesRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListIndicesPublisher publisher = client.listIndicesPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListIndicesPublisher publisher = client.listIndicesPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListIndicesResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listIndices(software.amazon.awssdk.services.iot.model.ListIndicesRequest)} operation. *

* * @param listIndicesRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListIndices */ public ListIndicesPublisher listIndicesPaginator(ListIndicesRequest listIndicesRequest) { return new ListIndicesPublisher(this, applyPaginatorUserAgent(listIndicesRequest)); } /** *

* Lists the job executions for a job. *

* * @param listJobExecutionsForJobRequest * @return A Java Future containing the result of the ListJobExecutionsForJob operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListJobExecutionsForJob */ @Override public CompletableFuture listJobExecutionsForJob( ListJobExecutionsForJobRequest listJobExecutionsForJobRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listJobExecutionsForJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListJobExecutionsForJob"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListJobExecutionsForJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListJobExecutionsForJob") .withMarshaller(new ListJobExecutionsForJobRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listJobExecutionsForJobRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listJobExecutionsForJobRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the job executions for a job. *

*
*

* This is a variant of * {@link #listJobExecutionsForJob(software.amazon.awssdk.services.iot.model.ListJobExecutionsForJobRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListJobExecutionsForJobPublisher publisher = client.listJobExecutionsForJobPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListJobExecutionsForJobPublisher publisher = client.listJobExecutionsForJobPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListJobExecutionsForJobResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listJobExecutionsForJob(software.amazon.awssdk.services.iot.model.ListJobExecutionsForJobRequest)} * operation. *

* * @param listJobExecutionsForJobRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListJobExecutionsForJob */ public ListJobExecutionsForJobPublisher listJobExecutionsForJobPaginator( ListJobExecutionsForJobRequest listJobExecutionsForJobRequest) { return new ListJobExecutionsForJobPublisher(this, applyPaginatorUserAgent(listJobExecutionsForJobRequest)); } /** *

* Lists the job executions for the specified thing. *

* * @param listJobExecutionsForThingRequest * @return A Java Future containing the result of the ListJobExecutionsForThing operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListJobExecutionsForThing */ @Override public CompletableFuture listJobExecutionsForThing( ListJobExecutionsForThingRequest listJobExecutionsForThingRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listJobExecutionsForThingRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListJobExecutionsForThing"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListJobExecutionsForThingResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListJobExecutionsForThing") .withMarshaller(new ListJobExecutionsForThingRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listJobExecutionsForThingRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listJobExecutionsForThingRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the job executions for the specified thing. *

*
*

* This is a variant of * {@link #listJobExecutionsForThing(software.amazon.awssdk.services.iot.model.ListJobExecutionsForThingRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListJobExecutionsForThingPublisher publisher = client.listJobExecutionsForThingPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListJobExecutionsForThingPublisher publisher = client.listJobExecutionsForThingPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListJobExecutionsForThingResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listJobExecutionsForThing(software.amazon.awssdk.services.iot.model.ListJobExecutionsForThingRequest)} * operation. *

* * @param listJobExecutionsForThingRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListJobExecutionsForThing */ public ListJobExecutionsForThingPublisher listJobExecutionsForThingPaginator( ListJobExecutionsForThingRequest listJobExecutionsForThingRequest) { return new ListJobExecutionsForThingPublisher(this, applyPaginatorUserAgent(listJobExecutionsForThingRequest)); } /** *

* Returns a list of job templates. *

* * @param listJobTemplatesRequest * @return A Java Future containing the result of the ListJobTemplates operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListJobTemplates */ @Override public CompletableFuture listJobTemplates(ListJobTemplatesRequest listJobTemplatesRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listJobTemplatesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListJobTemplates"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListJobTemplatesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListJobTemplates") .withMarshaller(new ListJobTemplatesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listJobTemplatesRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listJobTemplatesRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists jobs. *

* * @param listJobsRequest * @return A Java Future containing the result of the ListJobs operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListJobs */ @Override public CompletableFuture listJobs(ListJobsRequest listJobsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listJobsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListJobs"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListJobsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("ListJobs") .withMarshaller(new ListJobsRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withMetricCollector(apiCallMetricCollector) .withInput(listJobsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listJobsRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists jobs. *

*
*

* This is a variant of {@link #listJobs(software.amazon.awssdk.services.iot.model.ListJobsRequest)} operation. The * return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will * internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListJobsPublisher publisher = client.listJobsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListJobsPublisher publisher = client.listJobsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListJobsResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listJobs(software.amazon.awssdk.services.iot.model.ListJobsRequest)} operation. *

* * @param listJobsRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListJobs */ public ListJobsPublisher listJobsPaginator(ListJobsRequest listJobsRequest) { return new ListJobsPublisher(this, applyPaginatorUserAgent(listJobsRequest)); } /** *

* Gets a list of all mitigation actions that match the specified filter criteria. *

* * @param listMitigationActionsRequest * @return A Java Future containing the result of the ListMitigationActions operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListMitigationActions */ @Override public CompletableFuture listMitigationActions( ListMitigationActionsRequest listMitigationActionsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listMitigationActionsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListMitigationActions"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListMitigationActionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListMitigationActions") .withMarshaller(new ListMitigationActionsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listMitigationActionsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listMitigationActionsRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets a list of all mitigation actions that match the specified filter criteria. *

*
*

* This is a variant of * {@link #listMitigationActions(software.amazon.awssdk.services.iot.model.ListMitigationActionsRequest)} operation. * The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will * internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListMitigationActionsPublisher publisher = client.listMitigationActionsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListMitigationActionsPublisher publisher = client.listMitigationActionsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListMitigationActionsResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listMitigationActions(software.amazon.awssdk.services.iot.model.ListMitigationActionsRequest)} * operation. *

* * @param listMitigationActionsRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListMitigationActions */ public ListMitigationActionsPublisher listMitigationActionsPaginator(ListMitigationActionsRequest listMitigationActionsRequest) { return new ListMitigationActionsPublisher(this, applyPaginatorUserAgent(listMitigationActionsRequest)); } /** *

* Lists OTA updates. *

* * @param listOtaUpdatesRequest * @return A Java Future containing the result of the ListOTAUpdates operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListOTAUpdates */ @Override public CompletableFuture listOTAUpdates(ListOtaUpdatesRequest listOtaUpdatesRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listOtaUpdatesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListOTAUpdates"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListOtaUpdatesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListOTAUpdates") .withMarshaller(new ListOtaUpdatesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listOtaUpdatesRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listOtaUpdatesRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists OTA updates. *

*
*

* This is a variant of {@link #listOTAUpdates(software.amazon.awssdk.services.iot.model.ListOtaUpdatesRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListOTAUpdatesPublisher publisher = client.listOTAUpdatesPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListOTAUpdatesPublisher publisher = client.listOTAUpdatesPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListOtaUpdatesResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listOTAUpdates(software.amazon.awssdk.services.iot.model.ListOtaUpdatesRequest)} operation. *

* * @param listOtaUpdatesRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListOTAUpdates */ public ListOTAUpdatesPublisher listOTAUpdatesPaginator(ListOtaUpdatesRequest listOtaUpdatesRequest) { return new ListOTAUpdatesPublisher(this, applyPaginatorUserAgent(listOtaUpdatesRequest)); } /** *

* Lists certificates that are being transferred but not yet accepted. *

* * @param listOutgoingCertificatesRequest * The input to the ListOutgoingCertificates operation. * @return A Java Future containing the result of the ListOutgoingCertificates operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListOutgoingCertificates */ @Override public CompletableFuture listOutgoingCertificates( ListOutgoingCertificatesRequest listOutgoingCertificatesRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listOutgoingCertificatesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListOutgoingCertificates"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListOutgoingCertificatesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListOutgoingCertificates") .withMarshaller(new ListOutgoingCertificatesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listOutgoingCertificatesRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listOutgoingCertificatesRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists certificates that are being transferred but not yet accepted. *

*
*

* This is a variant of * {@link #listOutgoingCertificates(software.amazon.awssdk.services.iot.model.ListOutgoingCertificatesRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListOutgoingCertificatesPublisher publisher = client.listOutgoingCertificatesPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListOutgoingCertificatesPublisher publisher = client.listOutgoingCertificatesPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListOutgoingCertificatesResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of pageSize won't limit the number of results you get with the paginator. * It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listOutgoingCertificates(software.amazon.awssdk.services.iot.model.ListOutgoingCertificatesRequest)} * operation. *

* * @param listOutgoingCertificatesRequest * The input to the ListOutgoingCertificates operation. * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListOutgoingCertificates */ public ListOutgoingCertificatesPublisher listOutgoingCertificatesPaginator( ListOutgoingCertificatesRequest listOutgoingCertificatesRequest) { return new ListOutgoingCertificatesPublisher(this, applyPaginatorUserAgent(listOutgoingCertificatesRequest)); } /** *

* Lists your policies. *

* * @param listPoliciesRequest * The input for the ListPolicies operation. * @return A Java Future containing the result of the ListPolicies operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListPolicies */ @Override public CompletableFuture listPolicies(ListPoliciesRequest listPoliciesRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listPoliciesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListPolicies"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListPoliciesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListPolicies").withMarshaller(new ListPoliciesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listPoliciesRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listPoliciesRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists your policies. *

*
*

* This is a variant of {@link #listPolicies(software.amazon.awssdk.services.iot.model.ListPoliciesRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListPoliciesPublisher publisher = client.listPoliciesPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListPoliciesPublisher publisher = client.listPoliciesPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListPoliciesResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of pageSize won't limit the number of results you get with the paginator. * It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listPolicies(software.amazon.awssdk.services.iot.model.ListPoliciesRequest)} operation. *

* * @param listPoliciesRequest * The input for the ListPolicies operation. * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListPolicies */ public ListPoliciesPublisher listPoliciesPaginator(ListPoliciesRequest listPoliciesRequest) { return new ListPoliciesPublisher(this, applyPaginatorUserAgent(listPoliciesRequest)); } /** *

* Lists the versions of the specified policy and identifies the default version. *

* * @param listPolicyVersionsRequest * The input for the ListPolicyVersions operation. * @return A Java Future containing the result of the ListPolicyVersions operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListPolicyVersions */ @Override public CompletableFuture listPolicyVersions(ListPolicyVersionsRequest listPolicyVersionsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listPolicyVersionsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListPolicyVersions"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListPolicyVersionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListPolicyVersions") .withMarshaller(new ListPolicyVersionsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listPolicyVersionsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listPolicyVersionsRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the things associated with the specified principal. A principal can be X.509 certificates, IAM users, * groups, and roles, Amazon Cognito identities or federated identities. *

* * @param listPrincipalThingsRequest * The input for the ListPrincipalThings operation. * @return A Java Future containing the result of the ListPrincipalThings operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListPrincipalThings */ @Override public CompletableFuture listPrincipalThings( ListPrincipalThingsRequest listPrincipalThingsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listPrincipalThingsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListPrincipalThings"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListPrincipalThingsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListPrincipalThings") .withMarshaller(new ListPrincipalThingsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listPrincipalThingsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listPrincipalThingsRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the things associated with the specified principal. A principal can be X.509 certificates, IAM users, * groups, and roles, Amazon Cognito identities or federated identities. *

*
*

* This is a variant of * {@link #listPrincipalThings(software.amazon.awssdk.services.iot.model.ListPrincipalThingsRequest)} operation. The * return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will * internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListPrincipalThingsPublisher publisher = client.listPrincipalThingsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListPrincipalThingsPublisher publisher = client.listPrincipalThingsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListPrincipalThingsResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listPrincipalThings(software.amazon.awssdk.services.iot.model.ListPrincipalThingsRequest)} operation. *

* * @param listPrincipalThingsRequest * The input for the ListPrincipalThings operation. * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListPrincipalThings */ public ListPrincipalThingsPublisher listPrincipalThingsPaginator(ListPrincipalThingsRequest listPrincipalThingsRequest) { return new ListPrincipalThingsPublisher(this, applyPaginatorUserAgent(listPrincipalThingsRequest)); } /** *

* A list of fleet provisioning template versions. *

* * @param listProvisioningTemplateVersionsRequest * @return A Java Future containing the result of the ListProvisioningTemplateVersions operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalFailureException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListProvisioningTemplateVersions */ @Override public CompletableFuture listProvisioningTemplateVersions( ListProvisioningTemplateVersionsRequest listProvisioningTemplateVersionsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listProvisioningTemplateVersionsRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListProvisioningTemplateVersions"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, ListProvisioningTemplateVersionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListProvisioningTemplateVersions") .withMarshaller(new ListProvisioningTemplateVersionsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listProvisioningTemplateVersionsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listProvisioningTemplateVersionsRequest .overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* A list of fleet provisioning template versions. *

*
*

* This is a variant of * {@link #listProvisioningTemplateVersions(software.amazon.awssdk.services.iot.model.ListProvisioningTemplateVersionsRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListProvisioningTemplateVersionsPublisher publisher = client.listProvisioningTemplateVersionsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListProvisioningTemplateVersionsPublisher publisher = client.listProvisioningTemplateVersionsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListProvisioningTemplateVersionsResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listProvisioningTemplateVersions(software.amazon.awssdk.services.iot.model.ListProvisioningTemplateVersionsRequest)} * operation. *

* * @param listProvisioningTemplateVersionsRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalFailureException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListProvisioningTemplateVersions */ public ListProvisioningTemplateVersionsPublisher listProvisioningTemplateVersionsPaginator( ListProvisioningTemplateVersionsRequest listProvisioningTemplateVersionsRequest) { return new ListProvisioningTemplateVersionsPublisher(this, applyPaginatorUserAgent(listProvisioningTemplateVersionsRequest)); } /** *

* Lists the fleet provisioning templates in your AWS account. *

* * @param listProvisioningTemplatesRequest * @return A Java Future containing the result of the ListProvisioningTemplates operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalFailureException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListProvisioningTemplates */ @Override public CompletableFuture listProvisioningTemplates( ListProvisioningTemplatesRequest listProvisioningTemplatesRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listProvisioningTemplatesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListProvisioningTemplates"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListProvisioningTemplatesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListProvisioningTemplates") .withMarshaller(new ListProvisioningTemplatesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listProvisioningTemplatesRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listProvisioningTemplatesRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the fleet provisioning templates in your AWS account. *

*
*

* This is a variant of * {@link #listProvisioningTemplates(software.amazon.awssdk.services.iot.model.ListProvisioningTemplatesRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListProvisioningTemplatesPublisher publisher = client.listProvisioningTemplatesPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListProvisioningTemplatesPublisher publisher = client.listProvisioningTemplatesPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListProvisioningTemplatesResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listProvisioningTemplates(software.amazon.awssdk.services.iot.model.ListProvisioningTemplatesRequest)} * operation. *

* * @param listProvisioningTemplatesRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalFailureException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListProvisioningTemplates */ public ListProvisioningTemplatesPublisher listProvisioningTemplatesPaginator( ListProvisioningTemplatesRequest listProvisioningTemplatesRequest) { return new ListProvisioningTemplatesPublisher(this, applyPaginatorUserAgent(listProvisioningTemplatesRequest)); } /** *

* Lists the role aliases registered in your account. *

* * @param listRoleAliasesRequest * @return A Java Future containing the result of the ListRoleAliases operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListRoleAliases */ @Override public CompletableFuture listRoleAliases(ListRoleAliasesRequest listRoleAliasesRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listRoleAliasesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListRoleAliases"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListRoleAliasesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListRoleAliases") .withMarshaller(new ListRoleAliasesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listRoleAliasesRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listRoleAliasesRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the role aliases registered in your account. *

*
*

* This is a variant of {@link #listRoleAliases(software.amazon.awssdk.services.iot.model.ListRoleAliasesRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListRoleAliasesPublisher publisher = client.listRoleAliasesPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListRoleAliasesPublisher publisher = client.listRoleAliasesPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListRoleAliasesResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of pageSize won't limit the number of results you get with the paginator. * It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listRoleAliases(software.amazon.awssdk.services.iot.model.ListRoleAliasesRequest)} operation. *

* * @param listRoleAliasesRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListRoleAliases */ public ListRoleAliasesPublisher listRoleAliasesPaginator(ListRoleAliasesRequest listRoleAliasesRequest) { return new ListRoleAliasesPublisher(this, applyPaginatorUserAgent(listRoleAliasesRequest)); } /** *

* Lists all of your scheduled audits. *

* * @param listScheduledAuditsRequest * @return A Java Future containing the result of the ListScheduledAudits operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListScheduledAudits */ @Override public CompletableFuture listScheduledAudits( ListScheduledAuditsRequest listScheduledAuditsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listScheduledAuditsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListScheduledAudits"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListScheduledAuditsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListScheduledAudits") .withMarshaller(new ListScheduledAuditsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listScheduledAuditsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listScheduledAuditsRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists all of your scheduled audits. *

*
*

* This is a variant of * {@link #listScheduledAudits(software.amazon.awssdk.services.iot.model.ListScheduledAuditsRequest)} operation. The * return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will * internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListScheduledAuditsPublisher publisher = client.listScheduledAuditsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListScheduledAuditsPublisher publisher = client.listScheduledAuditsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListScheduledAuditsResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listScheduledAudits(software.amazon.awssdk.services.iot.model.ListScheduledAuditsRequest)} operation. *

* * @param listScheduledAuditsRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListScheduledAudits */ public ListScheduledAuditsPublisher listScheduledAuditsPaginator(ListScheduledAuditsRequest listScheduledAuditsRequest) { return new ListScheduledAuditsPublisher(this, applyPaginatorUserAgent(listScheduledAuditsRequest)); } /** *

* Lists the Device Defender security profiles you've created. You can filter security profiles by dimension or * custom metric. *

* *

* dimensionName and metricName cannot be used in the same request. *

*
* * @param listSecurityProfilesRequest * @return A Java Future containing the result of the ListSecurityProfiles operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListSecurityProfiles */ @Override public CompletableFuture listSecurityProfiles( ListSecurityProfilesRequest listSecurityProfilesRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listSecurityProfilesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListSecurityProfiles"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListSecurityProfilesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListSecurityProfiles") .withMarshaller(new ListSecurityProfilesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listSecurityProfilesRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listSecurityProfilesRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the Device Defender security profiles attached to a target (thing group). *

* * @param listSecurityProfilesForTargetRequest * @return A Java Future containing the result of the ListSecurityProfilesForTarget operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListSecurityProfilesForTarget */ @Override public CompletableFuture listSecurityProfilesForTarget( ListSecurityProfilesForTargetRequest listSecurityProfilesForTargetRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listSecurityProfilesForTargetRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListSecurityProfilesForTarget"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListSecurityProfilesForTargetResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListSecurityProfilesForTarget") .withMarshaller(new ListSecurityProfilesForTargetRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listSecurityProfilesForTargetRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listSecurityProfilesForTargetRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the Device Defender security profiles attached to a target (thing group). *

*
*

* This is a variant of * {@link #listSecurityProfilesForTarget(software.amazon.awssdk.services.iot.model.ListSecurityProfilesForTargetRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListSecurityProfilesForTargetPublisher publisher = client.listSecurityProfilesForTargetPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListSecurityProfilesForTargetPublisher publisher = client.listSecurityProfilesForTargetPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListSecurityProfilesForTargetResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listSecurityProfilesForTarget(software.amazon.awssdk.services.iot.model.ListSecurityProfilesForTargetRequest)} * operation. *

* * @param listSecurityProfilesForTargetRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListSecurityProfilesForTarget */ public ListSecurityProfilesForTargetPublisher listSecurityProfilesForTargetPaginator( ListSecurityProfilesForTargetRequest listSecurityProfilesForTargetRequest) { return new ListSecurityProfilesForTargetPublisher(this, applyPaginatorUserAgent(listSecurityProfilesForTargetRequest)); } /** *

* Lists the Device Defender security profiles you've created. You can filter security profiles by dimension or * custom metric. *

* *

* dimensionName and metricName cannot be used in the same request. *

*

*

* This is a variant of * {@link #listSecurityProfiles(software.amazon.awssdk.services.iot.model.ListSecurityProfilesRequest)} operation. * The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will * internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListSecurityProfilesPublisher publisher = client.listSecurityProfilesPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListSecurityProfilesPublisher publisher = client.listSecurityProfilesPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListSecurityProfilesResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listSecurityProfiles(software.amazon.awssdk.services.iot.model.ListSecurityProfilesRequest)} * operation. *

* * @param listSecurityProfilesRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListSecurityProfiles */ public ListSecurityProfilesPublisher listSecurityProfilesPaginator(ListSecurityProfilesRequest listSecurityProfilesRequest) { return new ListSecurityProfilesPublisher(this, applyPaginatorUserAgent(listSecurityProfilesRequest)); } /** *

* Lists all of the streams in your AWS account. *

* * @param listStreamsRequest * @return A Java Future containing the result of the ListStreams operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListStreams */ @Override public CompletableFuture listStreams(ListStreamsRequest listStreamsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listStreamsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListStreams"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListStreamsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListStreams").withMarshaller(new ListStreamsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listStreamsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listStreamsRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists all of the streams in your AWS account. *

*
*

* This is a variant of {@link #listStreams(software.amazon.awssdk.services.iot.model.ListStreamsRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListStreamsPublisher publisher = client.listStreamsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListStreamsPublisher publisher = client.listStreamsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListStreamsResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listStreams(software.amazon.awssdk.services.iot.model.ListStreamsRequest)} operation. *

* * @param listStreamsRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListStreams */ public ListStreamsPublisher listStreamsPaginator(ListStreamsRequest listStreamsRequest) { return new ListStreamsPublisher(this, applyPaginatorUserAgent(listStreamsRequest)); } /** *

* Lists the tags (metadata) you have assigned to the resource. *

* * @param listTagsForResourceRequest * @return A Java Future containing the result of the ListTagsForResource operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListTagsForResource */ @Override public CompletableFuture listTagsForResource( ListTagsForResourceRequest listTagsForResourceRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listTagsForResourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTagsForResource"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListTagsForResourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListTagsForResource") .withMarshaller(new ListTagsForResourceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listTagsForResourceRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listTagsForResourceRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the tags (metadata) you have assigned to the resource. *

*
*

* This is a variant of * {@link #listTagsForResource(software.amazon.awssdk.services.iot.model.ListTagsForResourceRequest)} operation. The * return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will * internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListTagsForResourcePublisher publisher = client.listTagsForResourcePaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListTagsForResourcePublisher publisher = client.listTagsForResourcePaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListTagsForResourceResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of null won't limit the number of results you get with the paginator. It * only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listTagsForResource(software.amazon.awssdk.services.iot.model.ListTagsForResourceRequest)} operation. *

* * @param listTagsForResourceRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListTagsForResource */ public ListTagsForResourcePublisher listTagsForResourcePaginator(ListTagsForResourceRequest listTagsForResourceRequest) { return new ListTagsForResourcePublisher(this, applyPaginatorUserAgent(listTagsForResourceRequest)); } /** *

* List targets for the specified policy. *

* * @param listTargetsForPolicyRequest * @return A Java Future containing the result of the ListTargetsForPolicy operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • LimitExceededException A limit has been exceeded.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListTargetsForPolicy */ @Override public CompletableFuture listTargetsForPolicy( ListTargetsForPolicyRequest listTargetsForPolicyRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listTargetsForPolicyRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTargetsForPolicy"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListTargetsForPolicyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListTargetsForPolicy") .withMarshaller(new ListTargetsForPolicyRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listTargetsForPolicyRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listTargetsForPolicyRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* List targets for the specified policy. *

*
*

* This is a variant of * {@link #listTargetsForPolicy(software.amazon.awssdk.services.iot.model.ListTargetsForPolicyRequest)} operation. * The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will * internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListTargetsForPolicyPublisher publisher = client.listTargetsForPolicyPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListTargetsForPolicyPublisher publisher = client.listTargetsForPolicyPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListTargetsForPolicyResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of pageSize won't limit the number of results you get with the paginator. * It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listTargetsForPolicy(software.amazon.awssdk.services.iot.model.ListTargetsForPolicyRequest)} * operation. *

* * @param listTargetsForPolicyRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • LimitExceededException A limit has been exceeded.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListTargetsForPolicy */ public ListTargetsForPolicyPublisher listTargetsForPolicyPaginator(ListTargetsForPolicyRequest listTargetsForPolicyRequest) { return new ListTargetsForPolicyPublisher(this, applyPaginatorUserAgent(listTargetsForPolicyRequest)); } /** *

* Lists the targets (thing groups) associated with a given Device Defender security profile. *

* * @param listTargetsForSecurityProfileRequest * @return A Java Future containing the result of the ListTargetsForSecurityProfile operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListTargetsForSecurityProfile */ @Override public CompletableFuture listTargetsForSecurityProfile( ListTargetsForSecurityProfileRequest listTargetsForSecurityProfileRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listTargetsForSecurityProfileRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTargetsForSecurityProfile"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListTargetsForSecurityProfileResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListTargetsForSecurityProfile") .withMarshaller(new ListTargetsForSecurityProfileRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listTargetsForSecurityProfileRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listTargetsForSecurityProfileRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the targets (thing groups) associated with a given Device Defender security profile. *

*
*

* This is a variant of * {@link #listTargetsForSecurityProfile(software.amazon.awssdk.services.iot.model.ListTargetsForSecurityProfileRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListTargetsForSecurityProfilePublisher publisher = client.listTargetsForSecurityProfilePaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListTargetsForSecurityProfilePublisher publisher = client.listTargetsForSecurityProfilePaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListTargetsForSecurityProfileResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listTargetsForSecurityProfile(software.amazon.awssdk.services.iot.model.ListTargetsForSecurityProfileRequest)} * operation. *

* * @param listTargetsForSecurityProfileRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListTargetsForSecurityProfile */ public ListTargetsForSecurityProfilePublisher listTargetsForSecurityProfilePaginator( ListTargetsForSecurityProfileRequest listTargetsForSecurityProfileRequest) { return new ListTargetsForSecurityProfilePublisher(this, applyPaginatorUserAgent(listTargetsForSecurityProfileRequest)); } /** *

* List the thing groups in your account. *

* * @param listThingGroupsRequest * @return A Java Future containing the result of the ListThingGroups operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListThingGroups */ @Override public CompletableFuture listThingGroups(ListThingGroupsRequest listThingGroupsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listThingGroupsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListThingGroups"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListThingGroupsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListThingGroups") .withMarshaller(new ListThingGroupsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listThingGroupsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listThingGroupsRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* List the thing groups to which the specified thing belongs. *

* * @param listThingGroupsForThingRequest * @return A Java Future containing the result of the ListThingGroupsForThing operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListThingGroupsForThing */ @Override public CompletableFuture listThingGroupsForThing( ListThingGroupsForThingRequest listThingGroupsForThingRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listThingGroupsForThingRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListThingGroupsForThing"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListThingGroupsForThingResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListThingGroupsForThing") .withMarshaller(new ListThingGroupsForThingRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listThingGroupsForThingRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listThingGroupsForThingRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* List the thing groups to which the specified thing belongs. *

*
*

* This is a variant of * {@link #listThingGroupsForThing(software.amazon.awssdk.services.iot.model.ListThingGroupsForThingRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListThingGroupsForThingPublisher publisher = client.listThingGroupsForThingPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListThingGroupsForThingPublisher publisher = client.listThingGroupsForThingPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListThingGroupsForThingResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listThingGroupsForThing(software.amazon.awssdk.services.iot.model.ListThingGroupsForThingRequest)} * operation. *

* * @param listThingGroupsForThingRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListThingGroupsForThing */ public ListThingGroupsForThingPublisher listThingGroupsForThingPaginator( ListThingGroupsForThingRequest listThingGroupsForThingRequest) { return new ListThingGroupsForThingPublisher(this, applyPaginatorUserAgent(listThingGroupsForThingRequest)); } /** *

* List the thing groups in your account. *

*
*

* This is a variant of {@link #listThingGroups(software.amazon.awssdk.services.iot.model.ListThingGroupsRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListThingGroupsPublisher publisher = client.listThingGroupsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListThingGroupsPublisher publisher = client.listThingGroupsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListThingGroupsResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listThingGroups(software.amazon.awssdk.services.iot.model.ListThingGroupsRequest)} operation. *

* * @param listThingGroupsRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListThingGroups */ public ListThingGroupsPublisher listThingGroupsPaginator(ListThingGroupsRequest listThingGroupsRequest) { return new ListThingGroupsPublisher(this, applyPaginatorUserAgent(listThingGroupsRequest)); } /** *

* Lists the principals associated with the specified thing. A principal can be X.509 certificates, IAM users, * groups, and roles, Amazon Cognito identities or federated identities. *

* * @param listThingPrincipalsRequest * The input for the ListThingPrincipal operation. * @return A Java Future containing the result of the ListThingPrincipals operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListThingPrincipals */ @Override public CompletableFuture listThingPrincipals( ListThingPrincipalsRequest listThingPrincipalsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listThingPrincipalsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListThingPrincipals"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListThingPrincipalsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListThingPrincipals") .withMarshaller(new ListThingPrincipalsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listThingPrincipalsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listThingPrincipalsRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the principals associated with the specified thing. A principal can be X.509 certificates, IAM users, * groups, and roles, Amazon Cognito identities or federated identities. *

*
*

* This is a variant of * {@link #listThingPrincipals(software.amazon.awssdk.services.iot.model.ListThingPrincipalsRequest)} operation. The * return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will * internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListThingPrincipalsPublisher publisher = client.listThingPrincipalsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListThingPrincipalsPublisher publisher = client.listThingPrincipalsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListThingPrincipalsResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listThingPrincipals(software.amazon.awssdk.services.iot.model.ListThingPrincipalsRequest)} operation. *

* * @param listThingPrincipalsRequest * The input for the ListThingPrincipal operation. * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListThingPrincipals */ public ListThingPrincipalsPublisher listThingPrincipalsPaginator(ListThingPrincipalsRequest listThingPrincipalsRequest) { return new ListThingPrincipalsPublisher(this, applyPaginatorUserAgent(listThingPrincipalsRequest)); } /** *

* Information about the thing registration tasks. *

* * @param listThingRegistrationTaskReportsRequest * @return A Java Future containing the result of the ListThingRegistrationTaskReports operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListThingRegistrationTaskReports */ @Override public CompletableFuture listThingRegistrationTaskReports( ListThingRegistrationTaskReportsRequest listThingRegistrationTaskReportsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listThingRegistrationTaskReportsRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListThingRegistrationTaskReports"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, ListThingRegistrationTaskReportsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListThingRegistrationTaskReports") .withMarshaller(new ListThingRegistrationTaskReportsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listThingRegistrationTaskReportsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listThingRegistrationTaskReportsRequest .overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Information about the thing registration tasks. *

*
*

* This is a variant of * {@link #listThingRegistrationTaskReports(software.amazon.awssdk.services.iot.model.ListThingRegistrationTaskReportsRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListThingRegistrationTaskReportsPublisher publisher = client.listThingRegistrationTaskReportsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListThingRegistrationTaskReportsPublisher publisher = client.listThingRegistrationTaskReportsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListThingRegistrationTaskReportsResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listThingRegistrationTaskReports(software.amazon.awssdk.services.iot.model.ListThingRegistrationTaskReportsRequest)} * operation. *

* * @param listThingRegistrationTaskReportsRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListThingRegistrationTaskReports */ public ListThingRegistrationTaskReportsPublisher listThingRegistrationTaskReportsPaginator( ListThingRegistrationTaskReportsRequest listThingRegistrationTaskReportsRequest) { return new ListThingRegistrationTaskReportsPublisher(this, applyPaginatorUserAgent(listThingRegistrationTaskReportsRequest)); } /** *

* List bulk thing provisioning tasks. *

* * @param listThingRegistrationTasksRequest * @return A Java Future containing the result of the ListThingRegistrationTasks operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListThingRegistrationTasks */ @Override public CompletableFuture listThingRegistrationTasks( ListThingRegistrationTasksRequest listThingRegistrationTasksRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listThingRegistrationTasksRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListThingRegistrationTasks"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListThingRegistrationTasksResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListThingRegistrationTasks") .withMarshaller(new ListThingRegistrationTasksRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listThingRegistrationTasksRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listThingRegistrationTasksRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* List bulk thing provisioning tasks. *

*
*

* This is a variant of * {@link #listThingRegistrationTasks(software.amazon.awssdk.services.iot.model.ListThingRegistrationTasksRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListThingRegistrationTasksPublisher publisher = client.listThingRegistrationTasksPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListThingRegistrationTasksPublisher publisher = client.listThingRegistrationTasksPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListThingRegistrationTasksResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listThingRegistrationTasks(software.amazon.awssdk.services.iot.model.ListThingRegistrationTasksRequest)} * operation. *

* * @param listThingRegistrationTasksRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListThingRegistrationTasks */ public ListThingRegistrationTasksPublisher listThingRegistrationTasksPaginator( ListThingRegistrationTasksRequest listThingRegistrationTasksRequest) { return new ListThingRegistrationTasksPublisher(this, applyPaginatorUserAgent(listThingRegistrationTasksRequest)); } /** *

* Lists the existing thing types. *

* * @param listThingTypesRequest * The input for the ListThingTypes operation. * @return A Java Future containing the result of the ListThingTypes operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListThingTypes */ @Override public CompletableFuture listThingTypes(ListThingTypesRequest listThingTypesRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listThingTypesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListThingTypes"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListThingTypesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListThingTypes") .withMarshaller(new ListThingTypesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listThingTypesRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listThingTypesRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the existing thing types. *

*
*

* This is a variant of {@link #listThingTypes(software.amazon.awssdk.services.iot.model.ListThingTypesRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListThingTypesPublisher publisher = client.listThingTypesPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListThingTypesPublisher publisher = client.listThingTypesPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListThingTypesResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listThingTypes(software.amazon.awssdk.services.iot.model.ListThingTypesRequest)} operation. *

* * @param listThingTypesRequest * The input for the ListThingTypes operation. * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListThingTypes */ public ListThingTypesPublisher listThingTypesPaginator(ListThingTypesRequest listThingTypesRequest) { return new ListThingTypesPublisher(this, applyPaginatorUserAgent(listThingTypesRequest)); } /** *

* Lists your things. Use the attributeName and attributeValue parameters to filter your things. For * example, calling ListThings with attributeName=Color and attributeValue=Red retrieves all things in * the registry that contain an attribute Color with the value Red. *

* *

* You will not be charged for calling this API if an Access denied error is returned. You will also * not be charged if no attributes or pagination token was provided in request and no pagination token and no * results were returned. *

*
* * @param listThingsRequest * The input for the ListThings operation. * @return A Java Future containing the result of the ListThings operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListThings */ @Override public CompletableFuture listThings(ListThingsRequest listThingsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listThingsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListThings"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListThingsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("ListThings") .withMarshaller(new ListThingsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listThingsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listThingsRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the things you have added to the given billing group. *

* * @param listThingsInBillingGroupRequest * @return A Java Future containing the result of the ListThingsInBillingGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListThingsInBillingGroup */ @Override public CompletableFuture listThingsInBillingGroup( ListThingsInBillingGroupRequest listThingsInBillingGroupRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listThingsInBillingGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListThingsInBillingGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListThingsInBillingGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListThingsInBillingGroup") .withMarshaller(new ListThingsInBillingGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listThingsInBillingGroupRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listThingsInBillingGroupRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the things you have added to the given billing group. *

*
*

* This is a variant of * {@link #listThingsInBillingGroup(software.amazon.awssdk.services.iot.model.ListThingsInBillingGroupRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListThingsInBillingGroupPublisher publisher = client.listThingsInBillingGroupPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListThingsInBillingGroupPublisher publisher = client.listThingsInBillingGroupPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListThingsInBillingGroupResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listThingsInBillingGroup(software.amazon.awssdk.services.iot.model.ListThingsInBillingGroupRequest)} * operation. *

* * @param listThingsInBillingGroupRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListThingsInBillingGroup */ public ListThingsInBillingGroupPublisher listThingsInBillingGroupPaginator( ListThingsInBillingGroupRequest listThingsInBillingGroupRequest) { return new ListThingsInBillingGroupPublisher(this, applyPaginatorUserAgent(listThingsInBillingGroupRequest)); } /** *

* Lists the things in the specified group. *

* * @param listThingsInThingGroupRequest * @return A Java Future containing the result of the ListThingsInThingGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListThingsInThingGroup */ @Override public CompletableFuture listThingsInThingGroup( ListThingsInThingGroupRequest listThingsInThingGroupRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listThingsInThingGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListThingsInThingGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListThingsInThingGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListThingsInThingGroup") .withMarshaller(new ListThingsInThingGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listThingsInThingGroupRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listThingsInThingGroupRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the things in the specified group. *

*
*

* This is a variant of * {@link #listThingsInThingGroup(software.amazon.awssdk.services.iot.model.ListThingsInThingGroupRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListThingsInThingGroupPublisher publisher = client.listThingsInThingGroupPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListThingsInThingGroupPublisher publisher = client.listThingsInThingGroupPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListThingsInThingGroupResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listThingsInThingGroup(software.amazon.awssdk.services.iot.model.ListThingsInThingGroupRequest)} * operation. *

* * @param listThingsInThingGroupRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListThingsInThingGroup */ public ListThingsInThingGroupPublisher listThingsInThingGroupPaginator( ListThingsInThingGroupRequest listThingsInThingGroupRequest) { return new ListThingsInThingGroupPublisher(this, applyPaginatorUserAgent(listThingsInThingGroupRequest)); } /** *

* Lists your things. Use the attributeName and attributeValue parameters to filter your things. For * example, calling ListThings with attributeName=Color and attributeValue=Red retrieves all things in * the registry that contain an attribute Color with the value Red. *

* *

* You will not be charged for calling this API if an Access denied error is returned. You will also * not be charged if no attributes or pagination token was provided in request and no pagination token and no * results were returned. *

*

*

* This is a variant of {@link #listThings(software.amazon.awssdk.services.iot.model.ListThingsRequest)} operation. * The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will * internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListThingsPublisher publisher = client.listThingsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListThingsPublisher publisher = client.listThingsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListThingsResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listThings(software.amazon.awssdk.services.iot.model.ListThingsRequest)} operation. *

* * @param listThingsRequest * The input for the ListThings operation. * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListThings */ public ListThingsPublisher listThingsPaginator(ListThingsRequest listThingsRequest) { return new ListThingsPublisher(this, applyPaginatorUserAgent(listThingsRequest)); } /** *

* Lists all the topic rule destinations in your AWS account. *

* * @param listTopicRuleDestinationsRequest * @return A Java Future containing the result of the ListTopicRuleDestinations operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListTopicRuleDestinations */ @Override public CompletableFuture listTopicRuleDestinations( ListTopicRuleDestinationsRequest listTopicRuleDestinationsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listTopicRuleDestinationsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTopicRuleDestinations"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListTopicRuleDestinationsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListTopicRuleDestinations") .withMarshaller(new ListTopicRuleDestinationsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listTopicRuleDestinationsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listTopicRuleDestinationsRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists all the topic rule destinations in your AWS account. *

*
*

* This is a variant of * {@link #listTopicRuleDestinations(software.amazon.awssdk.services.iot.model.ListTopicRuleDestinationsRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListTopicRuleDestinationsPublisher publisher = client.listTopicRuleDestinationsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListTopicRuleDestinationsPublisher publisher = client.listTopicRuleDestinationsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListTopicRuleDestinationsResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listTopicRuleDestinations(software.amazon.awssdk.services.iot.model.ListTopicRuleDestinationsRequest)} * operation. *

* * @param listTopicRuleDestinationsRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListTopicRuleDestinations */ public ListTopicRuleDestinationsPublisher listTopicRuleDestinationsPaginator( ListTopicRuleDestinationsRequest listTopicRuleDestinationsRequest) { return new ListTopicRuleDestinationsPublisher(this, applyPaginatorUserAgent(listTopicRuleDestinationsRequest)); } /** *

* Lists the rules for the specific topic. *

* * @param listTopicRulesRequest * The input for the ListTopicRules operation. * @return A Java Future containing the result of the ListTopicRules operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListTopicRules */ @Override public CompletableFuture listTopicRules(ListTopicRulesRequest listTopicRulesRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listTopicRulesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTopicRules"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListTopicRulesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListTopicRules") .withMarshaller(new ListTopicRulesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listTopicRulesRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listTopicRulesRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the rules for the specific topic. *

*
*

* This is a variant of {@link #listTopicRules(software.amazon.awssdk.services.iot.model.ListTopicRulesRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListTopicRulesPublisher publisher = client.listTopicRulesPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListTopicRulesPublisher publisher = client.listTopicRulesPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListTopicRulesResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listTopicRules(software.amazon.awssdk.services.iot.model.ListTopicRulesRequest)} operation. *

* * @param listTopicRulesRequest * The input for the ListTopicRules operation. * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListTopicRules */ public ListTopicRulesPublisher listTopicRulesPaginator(ListTopicRulesRequest listTopicRulesRequest) { return new ListTopicRulesPublisher(this, applyPaginatorUserAgent(listTopicRulesRequest)); } /** *

* Lists logging levels. *

* * @param listV2LoggingLevelsRequest * @return A Java Future containing the result of the ListV2LoggingLevels operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalException An unexpected error has occurred.
  • *
  • NotConfiguredException The resource is not configured.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListV2LoggingLevels */ @Override public CompletableFuture listV2LoggingLevels( ListV2LoggingLevelsRequest listV2LoggingLevelsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listV2LoggingLevelsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListV2LoggingLevels"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListV2LoggingLevelsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListV2LoggingLevels") .withMarshaller(new ListV2LoggingLevelsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listV2LoggingLevelsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listV2LoggingLevelsRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists logging levels. *

*
*

* This is a variant of * {@link #listV2LoggingLevels(software.amazon.awssdk.services.iot.model.ListV2LoggingLevelsRequest)} operation. The * return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will * internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListV2LoggingLevelsPublisher publisher = client.listV2LoggingLevelsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListV2LoggingLevelsPublisher publisher = client.listV2LoggingLevelsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListV2LoggingLevelsResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listV2LoggingLevels(software.amazon.awssdk.services.iot.model.ListV2LoggingLevelsRequest)} operation. *

* * @param listV2LoggingLevelsRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalException An unexpected error has occurred.
  • *
  • NotConfiguredException The resource is not configured.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListV2LoggingLevels */ public ListV2LoggingLevelsPublisher listV2LoggingLevelsPaginator(ListV2LoggingLevelsRequest listV2LoggingLevelsRequest) { return new ListV2LoggingLevelsPublisher(this, applyPaginatorUserAgent(listV2LoggingLevelsRequest)); } /** *

* Lists the Device Defender security profile violations discovered during the given time period. You can use * filters to limit the results to those alerts issued for a particular security profile, behavior, or thing * (device). *

* * @param listViolationEventsRequest * @return A Java Future containing the result of the ListViolationEvents operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListViolationEvents */ @Override public CompletableFuture listViolationEvents( ListViolationEventsRequest listViolationEventsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listViolationEventsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListViolationEvents"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListViolationEventsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListViolationEvents") .withMarshaller(new ListViolationEventsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listViolationEventsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listViolationEventsRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the Device Defender security profile violations discovered during the given time period. You can use * filters to limit the results to those alerts issued for a particular security profile, behavior, or thing * (device). *

*
*

* This is a variant of * {@link #listViolationEvents(software.amazon.awssdk.services.iot.model.ListViolationEventsRequest)} operation. The * return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will * internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListViolationEventsPublisher publisher = client.listViolationEventsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.iot.paginators.ListViolationEventsPublisher publisher = client.listViolationEventsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.iot.model.ListViolationEventsResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listViolationEvents(software.amazon.awssdk.services.iot.model.ListViolationEventsRequest)} operation. *

* * @param listViolationEventsRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ListViolationEvents */ public ListViolationEventsPublisher listViolationEventsPaginator(ListViolationEventsRequest listViolationEventsRequest) { return new ListViolationEventsPublisher(this, applyPaginatorUserAgent(listViolationEventsRequest)); } /** *

* 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. 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. *

* * @param registerCaCertificateRequest * The input to the RegisterCACertificate operation. * @return A Java Future containing the result of the RegisterCACertificate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceAlreadyExistsException The resource already exists.
  • *
  • RegistrationCodeValidationException The registration code is invalid.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • CertificateValidationException The certificate is invalid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • LimitExceededException A limit has been exceeded.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.RegisterCACertificate */ @Override public CompletableFuture registerCACertificate( RegisterCaCertificateRequest registerCaCertificateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, registerCaCertificateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "RegisterCACertificate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, RegisterCaCertificateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("RegisterCACertificate") .withMarshaller(new RegisterCaCertificateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(registerCaCertificateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = registerCaCertificateRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* 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. *

* * @param registerCertificateRequest * The input to the RegisterCertificate operation. * @return A Java Future containing the result of the RegisterCertificate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceAlreadyExistsException The resource already exists.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • CertificateValidationException The certificate is invalid.
  • *
  • CertificateStateException The certificate operation is not allowed.
  • *
  • 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.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.RegisterCertificate */ @Override public CompletableFuture registerCertificate( RegisterCertificateRequest registerCertificateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, registerCertificateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "RegisterCertificate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, RegisterCertificateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("RegisterCertificate") .withMarshaller(new RegisterCertificateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(registerCertificateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = registerCertificateRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Register a certificate that does not have a certificate authority (CA). *

* * @param registerCertificateWithoutCaRequest * @return A Java Future containing the result of the RegisterCertificateWithoutCA operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceAlreadyExistsException The resource already exists.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • CertificateStateException The certificate operation is not allowed.
  • *
  • CertificateValidationException The certificate is invalid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.RegisterCertificateWithoutCA */ @Override public CompletableFuture registerCertificateWithoutCA( RegisterCertificateWithoutCaRequest registerCertificateWithoutCaRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, registerCertificateWithoutCaRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "RegisterCertificateWithoutCA"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, RegisterCertificateWithoutCaResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("RegisterCertificateWithoutCA") .withMarshaller(new RegisterCertificateWithoutCaRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(registerCertificateWithoutCaRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = registerCertificateWithoutCaRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Provisions a thing in the device registry. RegisterThing calls other AWS IoT control plane APIs. These calls * might exceed your account level AWS IoT Throttling * Limits and cause throttle errors. Please contact AWS * Customer Support to raise your throttling limits if necessary. *

* * @param registerThingRequest * @return A Java Future containing the result of the RegisterThing operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • ConflictingResourceUpdateException A conflicting resource update exception. This exception is thrown * when two pending updates cause a conflict.
  • *
  • ResourceRegistrationFailureException The resource registration failed.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.RegisterThing */ @Override public CompletableFuture registerThing(RegisterThingRequest registerThingRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, registerThingRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "RegisterThing"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, RegisterThingResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("RegisterThing") .withMarshaller(new RegisterThingRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(registerThingRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = registerThingRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Rejects a pending certificate transfer. After AWS IoT rejects a certificate transfer, the certificate status * changes from PENDING_TRANSFER to INACTIVE. *

*

* To check for pending certificate transfers, call ListCertificates to enumerate your certificates. *

*

* 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. *

* * @param rejectCertificateTransferRequest * The input for the RejectCertificateTransfer operation. * @return A Java Future containing the result of the RejectCertificateTransfer operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • TransferAlreadyCompletedException You can't revert the certificate transfer because the transfer is * already complete.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.RejectCertificateTransfer */ @Override public CompletableFuture rejectCertificateTransfer( RejectCertificateTransferRequest rejectCertificateTransferRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, rejectCertificateTransferRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "RejectCertificateTransfer"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, RejectCertificateTransferResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("RejectCertificateTransfer") .withMarshaller(new RejectCertificateTransferRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(rejectCertificateTransferRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = rejectCertificateTransferRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Removes the given thing from the billing group. *

* * @param removeThingFromBillingGroupRequest * @return A Java Future containing the result of the RemoveThingFromBillingGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.RemoveThingFromBillingGroup */ @Override public CompletableFuture removeThingFromBillingGroup( RemoveThingFromBillingGroupRequest removeThingFromBillingGroupRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, removeThingFromBillingGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "RemoveThingFromBillingGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, RemoveThingFromBillingGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("RemoveThingFromBillingGroup") .withMarshaller(new RemoveThingFromBillingGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(removeThingFromBillingGroupRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = removeThingFromBillingGroupRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Remove the specified thing from the specified group. *

*

* You must specify either a thingGroupArn or a thingGroupName to identify the thing group * and either a thingArn or a thingName to identify the thing to remove from the thing * group. *

* * @param removeThingFromThingGroupRequest * @return A Java Future containing the result of the RemoveThingFromThingGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.RemoveThingFromThingGroup */ @Override public CompletableFuture removeThingFromThingGroup( RemoveThingFromThingGroupRequest removeThingFromThingGroupRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, removeThingFromThingGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "RemoveThingFromThingGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, RemoveThingFromThingGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("RemoveThingFromThingGroup") .withMarshaller(new RemoveThingFromThingGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(removeThingFromThingGroupRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = removeThingFromThingGroupRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Replaces the 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. *

* * @param replaceTopicRuleRequest * The input for the ReplaceTopicRule operation. * @return A Java Future containing the result of the ReplaceTopicRule operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • SqlParseException The Rule-SQL expression can't be parsed correctly.
  • *
  • InternalException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ConflictingResourceUpdateException A conflicting resource update exception. This exception is thrown * when two pending updates cause a conflict.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ReplaceTopicRule */ @Override public CompletableFuture replaceTopicRule(ReplaceTopicRuleRequest replaceTopicRuleRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, replaceTopicRuleRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ReplaceTopicRule"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ReplaceTopicRuleResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ReplaceTopicRule") .withMarshaller(new ReplaceTopicRuleRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(replaceTopicRuleRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = replaceTopicRuleRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* The query search index. *

* * @param searchIndexRequest * @return A Java Future containing the result of the SearchIndex operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidQueryException The query is invalid.
  • *
  • IndexNotReadyException The index is not ready.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.SearchIndex */ @Override public CompletableFuture searchIndex(SearchIndexRequest searchIndexRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, searchIndexRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "SearchIndex"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, SearchIndexResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("SearchIndex").withMarshaller(new SearchIndexRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(searchIndexRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = searchIndexRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Sets the default authorizer. This will be used if a websocket connection is made without specifying an * authorizer. *

* * @param setDefaultAuthorizerRequest * @return A Java Future containing the result of the SetDefaultAuthorizer operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceAlreadyExistsException The resource already exists.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.SetDefaultAuthorizer */ @Override public CompletableFuture setDefaultAuthorizer( SetDefaultAuthorizerRequest setDefaultAuthorizerRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, setDefaultAuthorizerRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "SetDefaultAuthorizer"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, SetDefaultAuthorizerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("SetDefaultAuthorizer") .withMarshaller(new SetDefaultAuthorizerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(setDefaultAuthorizerRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = setDefaultAuthorizerRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* 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. *

* * @param setDefaultPolicyVersionRequest * The input for the SetDefaultPolicyVersion operation. * @return A Java Future containing the result of the SetDefaultPolicyVersion operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.SetDefaultPolicyVersion */ @Override public CompletableFuture setDefaultPolicyVersion( SetDefaultPolicyVersionRequest setDefaultPolicyVersionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, setDefaultPolicyVersionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "SetDefaultPolicyVersion"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, SetDefaultPolicyVersionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("SetDefaultPolicyVersion") .withMarshaller(new SetDefaultPolicyVersionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(setDefaultPolicyVersionRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = setDefaultPolicyVersionRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Sets the logging options. *

*

* NOTE: use of this command is not recommended. Use SetV2LoggingOptions instead. *

* * @param setLoggingOptionsRequest * The input for the SetLoggingOptions operation. * @return A Java Future containing the result of the SetLoggingOptions operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.SetLoggingOptions */ @Override public CompletableFuture setLoggingOptions(SetLoggingOptionsRequest setLoggingOptionsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, setLoggingOptionsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "SetLoggingOptions"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, SetLoggingOptionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("SetLoggingOptions") .withMarshaller(new SetLoggingOptionsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(setLoggingOptionsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = setLoggingOptionsRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Sets the logging level. *

* * @param setV2LoggingLevelRequest * @return A Java Future containing the result of the SetV2LoggingLevel operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalException An unexpected error has occurred.
  • *
  • NotConfiguredException The resource is not configured.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • LimitExceededException A limit has been exceeded.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.SetV2LoggingLevel */ @Override public CompletableFuture setV2LoggingLevel(SetV2LoggingLevelRequest setV2LoggingLevelRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, setV2LoggingLevelRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "SetV2LoggingLevel"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, SetV2LoggingLevelResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("SetV2LoggingLevel") .withMarshaller(new SetV2LoggingLevelRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(setV2LoggingLevelRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = setV2LoggingLevelRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Sets the logging options for the V2 logging service. *

* * @param setV2LoggingOptionsRequest * @return A Java Future containing the result of the SetV2LoggingOptions operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.SetV2LoggingOptions */ @Override public CompletableFuture setV2LoggingOptions( SetV2LoggingOptionsRequest setV2LoggingOptionsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, setV2LoggingOptionsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "SetV2LoggingOptions"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, SetV2LoggingOptionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("SetV2LoggingOptions") .withMarshaller(new SetV2LoggingOptionsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(setV2LoggingOptionsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = setV2LoggingOptionsRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Starts a task that applies a set of mitigation actions to the specified target. *

* * @param startAuditMitigationActionsTaskRequest * @return A Java Future containing the result of the StartAuditMitigationActionsTask operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • TaskAlreadyExistsException This exception occurs if you attempt to start a task with the same task-id * as an existing task but with a different clientRequestToken.
  • *
  • LimitExceededException A limit has been exceeded.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.StartAuditMitigationActionsTask */ @Override public CompletableFuture startAuditMitigationActionsTask( StartAuditMitigationActionsTaskRequest startAuditMitigationActionsTaskRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, startAuditMitigationActionsTaskRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartAuditMitigationActionsTask"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, StartAuditMitigationActionsTaskResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("StartAuditMitigationActionsTask") .withMarshaller(new StartAuditMitigationActionsTaskRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(startAuditMitigationActionsTaskRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = startAuditMitigationActionsTaskRequest .overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Starts a Device Defender ML Detect mitigation actions task. *

* * @param startDetectMitigationActionsTaskRequest * @return A Java Future containing the result of the StartDetectMitigationActionsTask operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • TaskAlreadyExistsException This exception occurs if you attempt to start a task with the same task-id * as an existing task but with a different clientRequestToken.
  • *
  • LimitExceededException A limit has been exceeded.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.StartDetectMitigationActionsTask */ @Override public CompletableFuture startDetectMitigationActionsTask( StartDetectMitigationActionsTaskRequest startDetectMitigationActionsTaskRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, startDetectMitigationActionsTaskRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartDetectMitigationActionsTask"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, StartDetectMitigationActionsTaskResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("StartDetectMitigationActionsTask") .withMarshaller(new StartDetectMitigationActionsTaskRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(startDetectMitigationActionsTaskRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = startDetectMitigationActionsTaskRequest .overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Starts an on-demand Device Defender audit. *

* * @param startOnDemandAuditTaskRequest * @return A Java Future containing the result of the StartOnDemandAuditTask operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • LimitExceededException A limit has been exceeded.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.StartOnDemandAuditTask */ @Override public CompletableFuture startOnDemandAuditTask( StartOnDemandAuditTaskRequest startOnDemandAuditTaskRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, startOnDemandAuditTaskRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartOnDemandAuditTask"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, StartOnDemandAuditTaskResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("StartOnDemandAuditTask") .withMarshaller(new StartOnDemandAuditTaskRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(startOnDemandAuditTaskRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = startOnDemandAuditTaskRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a bulk thing provisioning task. *

* * @param startThingRegistrationTaskRequest * @return A Java Future containing the result of the StartThingRegistrationTask operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.StartThingRegistrationTask */ @Override public CompletableFuture startThingRegistrationTask( StartThingRegistrationTaskRequest startThingRegistrationTaskRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, startThingRegistrationTaskRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartThingRegistrationTask"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, StartThingRegistrationTaskResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("StartThingRegistrationTask") .withMarshaller(new StartThingRegistrationTaskRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(startThingRegistrationTaskRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = startThingRegistrationTaskRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Cancels a bulk thing provisioning task. *

* * @param stopThingRegistrationTaskRequest * @return A Java Future containing the result of the StopThingRegistrationTask operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.StopThingRegistrationTask */ @Override public CompletableFuture stopThingRegistrationTask( StopThingRegistrationTaskRequest stopThingRegistrationTaskRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, stopThingRegistrationTaskRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StopThingRegistrationTask"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, StopThingRegistrationTaskResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("StopThingRegistrationTask") .withMarshaller(new StopThingRegistrationTaskRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(stopThingRegistrationTaskRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = stopThingRegistrationTaskRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Adds to or modifies the tags of the given resource. Tags are metadata which can be used to manage a resource. *

* * @param tagResourceRequest * @return A Java Future containing the result of the TagResource operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • LimitExceededException A limit has been exceeded.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.TagResource */ @Override public CompletableFuture tagResource(TagResourceRequest tagResourceRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, tagResourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "TagResource"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, TagResourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("TagResource").withMarshaller(new TagResourceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(tagResourceRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = tagResourceRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Tests if a specified principal is authorized to perform an AWS IoT action on a specified resource. Use this to * test and debug the authorization behavior of devices that connect to the AWS IoT device gateway. *

* * @param testAuthorizationRequest * @return A Java Future containing the result of the TestAuthorization operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • LimitExceededException A limit has been exceeded.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.TestAuthorization */ @Override public CompletableFuture testAuthorization(TestAuthorizationRequest testAuthorizationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, testAuthorizationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "TestAuthorization"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, TestAuthorizationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("TestAuthorization") .withMarshaller(new TestAuthorizationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(testAuthorizationRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = testAuthorizationRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Tests a custom authorization behavior by invoking a specified custom authorizer. Use this to test and debug the * custom authorization behavior of devices that connect to the AWS IoT device gateway. *

* * @param testInvokeAuthorizerRequest * @return A Java Future containing the result of the TestInvokeAuthorizer operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • InvalidResponseException The response is invalid.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.TestInvokeAuthorizer */ @Override public CompletableFuture testInvokeAuthorizer( TestInvokeAuthorizerRequest testInvokeAuthorizerRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, testInvokeAuthorizerRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "TestInvokeAuthorizer"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, TestInvokeAuthorizerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("TestInvokeAuthorizer") .withMarshaller(new TestInvokeAuthorizerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(testInvokeAuthorizerRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = testInvokeAuthorizerRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Transfers the specified certificate to the specified AWS account. *

*

* You can cancel the transfer until it is acknowledged by the recipient. *

*

* No notification is sent to the transfer destination's account. It is up to the caller to notify the transfer * target. *

*

* The certificate being transferred must not be in the ACTIVE state. You can use the UpdateCertificate API to * deactivate it. *

*

* The certificate must not have any policies attached to it. You can use the DetachPrincipalPolicy API to detach * them. *

* * @param transferCertificateRequest * The input for the TransferCertificate operation. * @return A Java Future containing the result of the TransferCertificate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • CertificateStateException The certificate operation is not allowed.
  • *
  • TransferConflictException You can't transfer the certificate because authorization policies are still * attached.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.TransferCertificate */ @Override public CompletableFuture transferCertificate( TransferCertificateRequest transferCertificateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, transferCertificateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "TransferCertificate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, TransferCertificateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("TransferCertificate") .withMarshaller(new TransferCertificateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(transferCertificateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = transferCertificateRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Removes the given tags (metadata) from the resource. *

* * @param untagResourceRequest * @return A Java Future containing the result of the UntagResource operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.UntagResource */ @Override public CompletableFuture untagResource(UntagResourceRequest untagResourceRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, untagResourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UntagResource"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UntagResourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UntagResource") .withMarshaller(new UntagResourceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(untagResourceRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = untagResourceRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Configures or reconfigures the Device Defender audit settings for this account. Settings include how audit * notifications are sent and which audit checks are enabled or disabled. *

* * @param updateAccountAuditConfigurationRequest * @return A Java Future containing the result of the UpdateAccountAuditConfiguration operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.UpdateAccountAuditConfiguration */ @Override public CompletableFuture updateAccountAuditConfiguration( UpdateAccountAuditConfigurationRequest updateAccountAuditConfigurationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateAccountAuditConfigurationRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateAccountAuditConfiguration"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateAccountAuditConfigurationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateAccountAuditConfiguration") .withMarshaller(new UpdateAccountAuditConfigurationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateAccountAuditConfigurationRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateAccountAuditConfigurationRequest .overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates a Device Defender audit suppression. *

* * @param updateAuditSuppressionRequest * @return A Java Future containing the result of the UpdateAuditSuppression operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.UpdateAuditSuppression */ @Override public CompletableFuture updateAuditSuppression( UpdateAuditSuppressionRequest updateAuditSuppressionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateAuditSuppressionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateAuditSuppression"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateAuditSuppressionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateAuditSuppression") .withMarshaller(new UpdateAuditSuppressionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateAuditSuppressionRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateAuditSuppressionRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates an authorizer. *

* * @param updateAuthorizerRequest * @return A Java Future containing the result of the UpdateAuthorizer operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • LimitExceededException A limit has been exceeded.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.UpdateAuthorizer */ @Override public CompletableFuture updateAuthorizer(UpdateAuthorizerRequest updateAuthorizerRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateAuthorizerRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateAuthorizer"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateAuthorizerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateAuthorizer") .withMarshaller(new UpdateAuthorizerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateAuthorizerRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateAuthorizerRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates information about the billing group. *

* * @param updateBillingGroupRequest * @return A Java Future containing the result of the UpdateBillingGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • VersionConflictException An exception thrown when the version of an entity specified with the * expectedVersion parameter does not match the latest version in the system.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.UpdateBillingGroup */ @Override public CompletableFuture updateBillingGroup(UpdateBillingGroupRequest updateBillingGroupRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateBillingGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateBillingGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateBillingGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateBillingGroup") .withMarshaller(new UpdateBillingGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateBillingGroupRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateBillingGroupRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates a registered CA certificate. *

* * @param updateCaCertificateRequest * The input to the UpdateCACertificate operation. * @return A Java Future containing the result of the UpdateCACertificate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.UpdateCACertificate */ @Override public CompletableFuture updateCACertificate( UpdateCaCertificateRequest updateCaCertificateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateCaCertificateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateCACertificate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateCaCertificateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateCACertificate") .withMarshaller(new UpdateCaCertificateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateCaCertificateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateCaCertificateRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the status of the specified certificate. This operation is idempotent. *

*

* Certificates must be in the ACTIVE state to authenticate devices that use a certificate to connect to AWS IoT. *

*

* Within a few minutes of updating a certificate from the ACTIVE state to any other state, AWS IoT disconnects all * devices that used that certificate to connect. Devices cannot use a certificate that is not in the ACTIVE state * to reconnect. *

* * @param updateCertificateRequest * The input for the UpdateCertificate operation. * @return A Java Future containing the result of the UpdateCertificate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • CertificateStateException The certificate operation is not allowed.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.UpdateCertificate */ @Override public CompletableFuture updateCertificate(UpdateCertificateRequest updateCertificateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateCertificateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateCertificate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateCertificateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateCertificate") .withMarshaller(new UpdateCertificateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateCertificateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateCertificateRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates a Device Defender detect custom metric. *

* * @param updateCustomMetricRequest * @return A Java Future containing the result of the UpdateCustomMetric operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.UpdateCustomMetric */ @Override public CompletableFuture updateCustomMetric(UpdateCustomMetricRequest updateCustomMetricRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateCustomMetricRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateCustomMetric"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateCustomMetricResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateCustomMetric") .withMarshaller(new UpdateCustomMetricRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateCustomMetricRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateCustomMetricRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the definition for a dimension. You cannot change the type of a dimension after it is created (you can * delete it and recreate it). *

* * @param updateDimensionRequest * @return A Java Future containing the result of the UpdateDimension operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalFailureException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.UpdateDimension */ @Override public CompletableFuture updateDimension(UpdateDimensionRequest updateDimensionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateDimensionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateDimension"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateDimensionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateDimension") .withMarshaller(new UpdateDimensionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateDimensionRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateDimensionRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates values stored in the domain configuration. Domain configurations for default endpoints can't be updated. *

* * @param updateDomainConfigurationRequest * @return A Java Future containing the result of the UpdateDomainConfiguration operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • CertificateValidationException The certificate is invalid.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.UpdateDomainConfiguration */ @Override public CompletableFuture updateDomainConfiguration( UpdateDomainConfigurationRequest updateDomainConfigurationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateDomainConfigurationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateDomainConfiguration"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateDomainConfigurationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateDomainConfiguration") .withMarshaller(new UpdateDomainConfigurationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateDomainConfigurationRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateDomainConfigurationRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates a dynamic thing group. *

* * @param updateDynamicThingGroupRequest * @return A Java Future containing the result of the UpdateDynamicThingGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • VersionConflictException An exception thrown when the version of an entity specified with the * expectedVersion parameter does not match the latest version in the system.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidQueryException The query is invalid.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.UpdateDynamicThingGroup */ @Override public CompletableFuture updateDynamicThingGroup( UpdateDynamicThingGroupRequest updateDynamicThingGroupRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateDynamicThingGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateDynamicThingGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateDynamicThingGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateDynamicThingGroup") .withMarshaller(new UpdateDynamicThingGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateDynamicThingGroupRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateDynamicThingGroupRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the event configurations. *

* * @param updateEventConfigurationsRequest * @return A Java Future containing the result of the UpdateEventConfigurations operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.UpdateEventConfigurations */ @Override public CompletableFuture updateEventConfigurations( UpdateEventConfigurationsRequest updateEventConfigurationsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateEventConfigurationsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateEventConfigurations"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateEventConfigurationsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateEventConfigurations") .withMarshaller(new UpdateEventConfigurationsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateEventConfigurationsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateEventConfigurationsRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the search configuration. *

* * @param updateIndexingConfigurationRequest * @return A Java Future containing the result of the UpdateIndexingConfiguration operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.UpdateIndexingConfiguration */ @Override public CompletableFuture updateIndexingConfiguration( UpdateIndexingConfigurationRequest updateIndexingConfigurationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateIndexingConfigurationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateIndexingConfiguration"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateIndexingConfigurationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateIndexingConfiguration") .withMarshaller(new UpdateIndexingConfigurationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateIndexingConfigurationRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateIndexingConfigurationRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates supported fields of the specified job. *

* * @param updateJobRequest * @return A Java Future containing the result of the UpdateJob operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.UpdateJob */ @Override public CompletableFuture updateJob(UpdateJobRequest updateJobRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateJob"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("UpdateJob") .withMarshaller(new UpdateJobRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withMetricCollector(apiCallMetricCollector) .withInput(updateJobRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateJobRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the definition for the specified mitigation action. *

* * @param updateMitigationActionRequest * @return A Java Future containing the result of the UpdateMitigationAction operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.UpdateMitigationAction */ @Override public CompletableFuture updateMitigationAction( UpdateMitigationActionRequest updateMitigationActionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateMitigationActionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateMitigationAction"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateMitigationActionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateMitigationAction") .withMarshaller(new UpdateMitigationActionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateMitigationActionRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateMitigationActionRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates a fleet provisioning template. *

* * @param updateProvisioningTemplateRequest * @return A Java Future containing the result of the UpdateProvisioningTemplate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalFailureException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ConflictingResourceUpdateException A conflicting resource update exception. This exception is thrown * when two pending updates cause a conflict.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.UpdateProvisioningTemplate */ @Override public CompletableFuture updateProvisioningTemplate( UpdateProvisioningTemplateRequest updateProvisioningTemplateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateProvisioningTemplateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateProvisioningTemplate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateProvisioningTemplateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateProvisioningTemplate") .withMarshaller(new UpdateProvisioningTemplateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateProvisioningTemplateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateProvisioningTemplateRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates a role alias. *

* * @param updateRoleAliasRequest * @return A Java Future containing the result of the UpdateRoleAlias operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.UpdateRoleAlias */ @Override public CompletableFuture updateRoleAlias(UpdateRoleAliasRequest updateRoleAliasRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateRoleAliasRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateRoleAlias"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateRoleAliasResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateRoleAlias") .withMarshaller(new UpdateRoleAliasRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateRoleAliasRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateRoleAliasRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates a scheduled audit, including which checks are performed and how often the audit takes place. *

* * @param updateScheduledAuditRequest * @return A Java Future containing the result of the UpdateScheduledAudit operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.UpdateScheduledAudit */ @Override public CompletableFuture updateScheduledAudit( UpdateScheduledAuditRequest updateScheduledAuditRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateScheduledAuditRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateScheduledAudit"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateScheduledAuditResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateScheduledAudit") .withMarshaller(new UpdateScheduledAuditRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateScheduledAuditRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateScheduledAuditRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates a Device Defender security profile. *

* * @param updateSecurityProfileRequest * @return A Java Future containing the result of the UpdateSecurityProfile operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • VersionConflictException An exception thrown when the version of an entity specified with the * expectedVersion parameter does not match the latest version in the system.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.UpdateSecurityProfile */ @Override public CompletableFuture updateSecurityProfile( UpdateSecurityProfileRequest updateSecurityProfileRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateSecurityProfileRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateSecurityProfile"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateSecurityProfileResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateSecurityProfile") .withMarshaller(new UpdateSecurityProfileRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateSecurityProfileRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateSecurityProfileRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates an existing stream. The stream version will be incremented by one. *

* * @param updateStreamRequest * @return A Java Future containing the result of the UpdateStream operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.UpdateStream */ @Override public CompletableFuture updateStream(UpdateStreamRequest updateStreamRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateStreamRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateStream"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateStreamResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateStream").withMarshaller(new UpdateStreamRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateStreamRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateStreamRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the data for a thing. *

* * @param updateThingRequest * The input for the UpdateThing operation. * @return A Java Future containing the result of the UpdateThing operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • VersionConflictException An exception thrown when the version of an entity specified with the * expectedVersion parameter does not match the latest version in the system.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.UpdateThing */ @Override public CompletableFuture updateThing(UpdateThingRequest updateThingRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateThingRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateThing"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateThingResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateThing").withMarshaller(new UpdateThingRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateThingRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateThingRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Update a thing group. *

* * @param updateThingGroupRequest * @return A Java Future containing the result of the UpdateThingGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • VersionConflictException An exception thrown when the version of an entity specified with the * expectedVersion parameter does not match the latest version in the system.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.UpdateThingGroup */ @Override public CompletableFuture updateThingGroup(UpdateThingGroupRequest updateThingGroupRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateThingGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateThingGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateThingGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateThingGroup") .withMarshaller(new UpdateThingGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateThingGroupRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateThingGroupRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the groups to which the thing belongs. *

* * @param updateThingGroupsForThingRequest * @return A Java Future containing the result of the UpdateThingGroupsForThing operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • ResourceNotFoundException The specified resource does not exist.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.UpdateThingGroupsForThing */ @Override public CompletableFuture updateThingGroupsForThing( UpdateThingGroupsForThingRequest updateThingGroupsForThingRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateThingGroupsForThingRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateThingGroupsForThing"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateThingGroupsForThingResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateThingGroupsForThing") .withMarshaller(new UpdateThingGroupsForThingRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateThingGroupsForThingRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateThingGroupsForThingRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates a topic rule destination. You use this to change the status, endpoint URL, or confirmation URL of the * destination. *

* * @param updateTopicRuleDestinationRequest * @return A Java Future containing the result of the UpdateTopicRuleDestination operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalException An unexpected error has occurred.
  • *
  • InvalidRequestException The request is not valid.
  • *
  • ServiceUnavailableException The service is temporarily unavailable.
  • *
  • UnauthorizedException You are not authorized to perform this operation.
  • *
  • ConflictingResourceUpdateException A conflicting resource update exception. This exception is thrown * when two pending updates cause a conflict.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.UpdateTopicRuleDestination */ @Override public CompletableFuture updateTopicRuleDestination( UpdateTopicRuleDestinationRequest updateTopicRuleDestinationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateTopicRuleDestinationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateTopicRuleDestination"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateTopicRuleDestinationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateTopicRuleDestination") .withMarshaller(new UpdateTopicRuleDestinationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateTopicRuleDestinationRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateTopicRuleDestinationRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Validates a Device Defender security profile behaviors specification. *

* * @param validateSecurityProfileBehaviorsRequest * @return A Java Future containing the result of the ValidateSecurityProfileBehaviors operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRequestException The request is not valid.
  • *
  • ThrottlingException The rate exceeds the limit.
  • *
  • InternalFailureException An unexpected error has occurred.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • IotException Base class for all service exceptions. Unknown exceptions will be thrown as an instance * of this type.
  • *
* @sample IotAsyncClient.ValidateSecurityProfileBehaviors */ @Override public CompletableFuture validateSecurityProfileBehaviors( ValidateSecurityProfileBehaviorsRequest validateSecurityProfileBehaviorsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, validateSecurityProfileBehaviorsRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoT"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ValidateSecurityProfileBehaviors"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, ValidateSecurityProfileBehaviorsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ValidateSecurityProfileBehaviors") .withMarshaller(new ValidateSecurityProfileBehaviorsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(validateSecurityProfileBehaviorsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = validateSecurityProfileBehaviorsRequest .overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } @Override public void close() { clientHandler.close(); } private > T init(T builder) { return builder .clientConfiguration(clientConfiguration) .defaultServiceExceptionSupplier(IotException::builder) .protocol(AwsJsonProtocol.REST_JSON) .protocolVersion("1.1") .registerModeledException( ExceptionMetadata.builder().errorCode("InternalFailureException") .exceptionBuilderSupplier(InternalFailureException::builder).httpStatusCode(500).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("LimitExceededException") .exceptionBuilderSupplier(LimitExceededException::builder).httpStatusCode(410).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("TransferAlreadyCompletedException") .exceptionBuilderSupplier(TransferAlreadyCompletedException::builder).httpStatusCode(410).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("NotConfiguredException") .exceptionBuilderSupplier(NotConfiguredException::builder).httpStatusCode(404).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ThrottlingException") .exceptionBuilderSupplier(ThrottlingException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ConflictException") .exceptionBuilderSupplier(ConflictException::builder).httpStatusCode(409).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("MalformedPolicyException") .exceptionBuilderSupplier(MalformedPolicyException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidQueryException") .exceptionBuilderSupplier(InvalidQueryException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidStateTransitionException") .exceptionBuilderSupplier(InvalidStateTransitionException::builder).httpStatusCode(409).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ResourceRegistrationFailureException") .exceptionBuilderSupplier(ResourceRegistrationFailureException::builder).httpStatusCode(400) .build()) .registerModeledException( ExceptionMetadata.builder().errorCode("DeleteConflictException") .exceptionBuilderSupplier(DeleteConflictException::builder).httpStatusCode(409).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidRequestException") .exceptionBuilderSupplier(InvalidRequestException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("CertificateConflictException") .exceptionBuilderSupplier(CertificateConflictException::builder).httpStatusCode(409).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("RegistrationCodeValidationException") .exceptionBuilderSupplier(RegistrationCodeValidationException::builder).httpStatusCode(400) .build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidResponseException") .exceptionBuilderSupplier(InvalidResponseException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidAggregationException") .exceptionBuilderSupplier(InvalidAggregationException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ResourceNotFoundException") .exceptionBuilderSupplier(ResourceNotFoundException::builder).httpStatusCode(404).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("SqlParseException") .exceptionBuilderSupplier(SqlParseException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ConflictingResourceUpdateException") .exceptionBuilderSupplier(ConflictingResourceUpdateException::builder).httpStatusCode(409) .build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ResourceAlreadyExistsException") .exceptionBuilderSupplier(ResourceAlreadyExistsException::builder).httpStatusCode(409).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InternalException") .exceptionBuilderSupplier(InternalException::builder).httpStatusCode(500).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("VersionsLimitExceededException") .exceptionBuilderSupplier(VersionsLimitExceededException::builder).httpStatusCode(409).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("TransferConflictException") .exceptionBuilderSupplier(TransferConflictException::builder).httpStatusCode(409).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("IndexNotReadyException") .exceptionBuilderSupplier(IndexNotReadyException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("UnauthorizedException") .exceptionBuilderSupplier(UnauthorizedException::builder).httpStatusCode(401).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("CertificateStateException") .exceptionBuilderSupplier(CertificateStateException::builder).httpStatusCode(406).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("VersionConflictException") .exceptionBuilderSupplier(VersionConflictException::builder).httpStatusCode(409).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("TaskAlreadyExistsException") .exceptionBuilderSupplier(TaskAlreadyExistsException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ServiceUnavailableException") .exceptionBuilderSupplier(ServiceUnavailableException::builder).httpStatusCode(503).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("CertificateValidationException") .exceptionBuilderSupplier(CertificateValidationException::builder).httpStatusCode(400).build()); } private static List resolveMetricPublishers(SdkClientConfiguration clientConfiguration, RequestOverrideConfiguration requestOverrideConfiguration) { List publishers = null; if (requestOverrideConfiguration != null) { publishers = requestOverrideConfiguration.metricPublishers(); } if (publishers == null || publishers.isEmpty()) { publishers = clientConfiguration.option(SdkClientOption.METRIC_PUBLISHERS); } if (publishers == null) { publishers = Collections.emptyList(); } return publishers; } private T applyPaginatorUserAgent(T request) { Consumer userAgentApplier = b -> b.addApiName(ApiName.builder() .version(VersionInfo.SDK_VERSION).name("PAGINATED").build()); AwsRequestOverrideConfiguration overrideConfiguration = request.overrideConfiguration() .map(c -> c.toBuilder().applyMutation(userAgentApplier).build()) .orElse((AwsRequestOverrideConfiguration.builder().applyMutation(userAgentApplier).build())); return (T) request.toBuilder().overrideConfiguration(overrideConfiguration).build(); } private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory, JsonOperationMetadata operationMetadata) { return protocolFactory.createErrorResponseHandler(operationMetadata); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy