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

software.amazon.awssdk.services.macie2.DefaultMacie2AsyncClient 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.macie2;

import java.util.Collections;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ScheduledExecutorService;
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.macie2.model.AcceptInvitationRequest;
import software.amazon.awssdk.services.macie2.model.AcceptInvitationResponse;
import software.amazon.awssdk.services.macie2.model.AccessDeniedException;
import software.amazon.awssdk.services.macie2.model.BatchGetCustomDataIdentifiersRequest;
import software.amazon.awssdk.services.macie2.model.BatchGetCustomDataIdentifiersResponse;
import software.amazon.awssdk.services.macie2.model.ConflictException;
import software.amazon.awssdk.services.macie2.model.CreateAllowListRequest;
import software.amazon.awssdk.services.macie2.model.CreateAllowListResponse;
import software.amazon.awssdk.services.macie2.model.CreateClassificationJobRequest;
import software.amazon.awssdk.services.macie2.model.CreateClassificationJobResponse;
import software.amazon.awssdk.services.macie2.model.CreateCustomDataIdentifierRequest;
import software.amazon.awssdk.services.macie2.model.CreateCustomDataIdentifierResponse;
import software.amazon.awssdk.services.macie2.model.CreateFindingsFilterRequest;
import software.amazon.awssdk.services.macie2.model.CreateFindingsFilterResponse;
import software.amazon.awssdk.services.macie2.model.CreateInvitationsRequest;
import software.amazon.awssdk.services.macie2.model.CreateInvitationsResponse;
import software.amazon.awssdk.services.macie2.model.CreateMemberRequest;
import software.amazon.awssdk.services.macie2.model.CreateMemberResponse;
import software.amazon.awssdk.services.macie2.model.CreateSampleFindingsRequest;
import software.amazon.awssdk.services.macie2.model.CreateSampleFindingsResponse;
import software.amazon.awssdk.services.macie2.model.DeclineInvitationsRequest;
import software.amazon.awssdk.services.macie2.model.DeclineInvitationsResponse;
import software.amazon.awssdk.services.macie2.model.DeleteAllowListRequest;
import software.amazon.awssdk.services.macie2.model.DeleteAllowListResponse;
import software.amazon.awssdk.services.macie2.model.DeleteCustomDataIdentifierRequest;
import software.amazon.awssdk.services.macie2.model.DeleteCustomDataIdentifierResponse;
import software.amazon.awssdk.services.macie2.model.DeleteFindingsFilterRequest;
import software.amazon.awssdk.services.macie2.model.DeleteFindingsFilterResponse;
import software.amazon.awssdk.services.macie2.model.DeleteInvitationsRequest;
import software.amazon.awssdk.services.macie2.model.DeleteInvitationsResponse;
import software.amazon.awssdk.services.macie2.model.DeleteMemberRequest;
import software.amazon.awssdk.services.macie2.model.DeleteMemberResponse;
import software.amazon.awssdk.services.macie2.model.DescribeBucketsRequest;
import software.amazon.awssdk.services.macie2.model.DescribeBucketsResponse;
import software.amazon.awssdk.services.macie2.model.DescribeClassificationJobRequest;
import software.amazon.awssdk.services.macie2.model.DescribeClassificationJobResponse;
import software.amazon.awssdk.services.macie2.model.DescribeOrganizationConfigurationRequest;
import software.amazon.awssdk.services.macie2.model.DescribeOrganizationConfigurationResponse;
import software.amazon.awssdk.services.macie2.model.DisableMacieRequest;
import software.amazon.awssdk.services.macie2.model.DisableMacieResponse;
import software.amazon.awssdk.services.macie2.model.DisableOrganizationAdminAccountRequest;
import software.amazon.awssdk.services.macie2.model.DisableOrganizationAdminAccountResponse;
import software.amazon.awssdk.services.macie2.model.DisassociateFromAdministratorAccountRequest;
import software.amazon.awssdk.services.macie2.model.DisassociateFromAdministratorAccountResponse;
import software.amazon.awssdk.services.macie2.model.DisassociateFromMasterAccountRequest;
import software.amazon.awssdk.services.macie2.model.DisassociateFromMasterAccountResponse;
import software.amazon.awssdk.services.macie2.model.DisassociateMemberRequest;
import software.amazon.awssdk.services.macie2.model.DisassociateMemberResponse;
import software.amazon.awssdk.services.macie2.model.EnableMacieRequest;
import software.amazon.awssdk.services.macie2.model.EnableMacieResponse;
import software.amazon.awssdk.services.macie2.model.EnableOrganizationAdminAccountRequest;
import software.amazon.awssdk.services.macie2.model.EnableOrganizationAdminAccountResponse;
import software.amazon.awssdk.services.macie2.model.GetAdministratorAccountRequest;
import software.amazon.awssdk.services.macie2.model.GetAdministratorAccountResponse;
import software.amazon.awssdk.services.macie2.model.GetAllowListRequest;
import software.amazon.awssdk.services.macie2.model.GetAllowListResponse;
import software.amazon.awssdk.services.macie2.model.GetAutomatedDiscoveryConfigurationRequest;
import software.amazon.awssdk.services.macie2.model.GetAutomatedDiscoveryConfigurationResponse;
import software.amazon.awssdk.services.macie2.model.GetBucketStatisticsRequest;
import software.amazon.awssdk.services.macie2.model.GetBucketStatisticsResponse;
import software.amazon.awssdk.services.macie2.model.GetClassificationExportConfigurationRequest;
import software.amazon.awssdk.services.macie2.model.GetClassificationExportConfigurationResponse;
import software.amazon.awssdk.services.macie2.model.GetClassificationScopeRequest;
import software.amazon.awssdk.services.macie2.model.GetClassificationScopeResponse;
import software.amazon.awssdk.services.macie2.model.GetCustomDataIdentifierRequest;
import software.amazon.awssdk.services.macie2.model.GetCustomDataIdentifierResponse;
import software.amazon.awssdk.services.macie2.model.GetFindingStatisticsRequest;
import software.amazon.awssdk.services.macie2.model.GetFindingStatisticsResponse;
import software.amazon.awssdk.services.macie2.model.GetFindingsFilterRequest;
import software.amazon.awssdk.services.macie2.model.GetFindingsFilterResponse;
import software.amazon.awssdk.services.macie2.model.GetFindingsPublicationConfigurationRequest;
import software.amazon.awssdk.services.macie2.model.GetFindingsPublicationConfigurationResponse;
import software.amazon.awssdk.services.macie2.model.GetFindingsRequest;
import software.amazon.awssdk.services.macie2.model.GetFindingsResponse;
import software.amazon.awssdk.services.macie2.model.GetInvitationsCountRequest;
import software.amazon.awssdk.services.macie2.model.GetInvitationsCountResponse;
import software.amazon.awssdk.services.macie2.model.GetMacieSessionRequest;
import software.amazon.awssdk.services.macie2.model.GetMacieSessionResponse;
import software.amazon.awssdk.services.macie2.model.GetMasterAccountRequest;
import software.amazon.awssdk.services.macie2.model.GetMasterAccountResponse;
import software.amazon.awssdk.services.macie2.model.GetMemberRequest;
import software.amazon.awssdk.services.macie2.model.GetMemberResponse;
import software.amazon.awssdk.services.macie2.model.GetResourceProfileRequest;
import software.amazon.awssdk.services.macie2.model.GetResourceProfileResponse;
import software.amazon.awssdk.services.macie2.model.GetRevealConfigurationRequest;
import software.amazon.awssdk.services.macie2.model.GetRevealConfigurationResponse;
import software.amazon.awssdk.services.macie2.model.GetSensitiveDataOccurrencesAvailabilityRequest;
import software.amazon.awssdk.services.macie2.model.GetSensitiveDataOccurrencesAvailabilityResponse;
import software.amazon.awssdk.services.macie2.model.GetSensitiveDataOccurrencesRequest;
import software.amazon.awssdk.services.macie2.model.GetSensitiveDataOccurrencesResponse;
import software.amazon.awssdk.services.macie2.model.GetSensitivityInspectionTemplateRequest;
import software.amazon.awssdk.services.macie2.model.GetSensitivityInspectionTemplateResponse;
import software.amazon.awssdk.services.macie2.model.GetUsageStatisticsRequest;
import software.amazon.awssdk.services.macie2.model.GetUsageStatisticsResponse;
import software.amazon.awssdk.services.macie2.model.GetUsageTotalsRequest;
import software.amazon.awssdk.services.macie2.model.GetUsageTotalsResponse;
import software.amazon.awssdk.services.macie2.model.InternalServerException;
import software.amazon.awssdk.services.macie2.model.ListAllowListsRequest;
import software.amazon.awssdk.services.macie2.model.ListAllowListsResponse;
import software.amazon.awssdk.services.macie2.model.ListClassificationJobsRequest;
import software.amazon.awssdk.services.macie2.model.ListClassificationJobsResponse;
import software.amazon.awssdk.services.macie2.model.ListClassificationScopesRequest;
import software.amazon.awssdk.services.macie2.model.ListClassificationScopesResponse;
import software.amazon.awssdk.services.macie2.model.ListCustomDataIdentifiersRequest;
import software.amazon.awssdk.services.macie2.model.ListCustomDataIdentifiersResponse;
import software.amazon.awssdk.services.macie2.model.ListFindingsFiltersRequest;
import software.amazon.awssdk.services.macie2.model.ListFindingsFiltersResponse;
import software.amazon.awssdk.services.macie2.model.ListFindingsRequest;
import software.amazon.awssdk.services.macie2.model.ListFindingsResponse;
import software.amazon.awssdk.services.macie2.model.ListInvitationsRequest;
import software.amazon.awssdk.services.macie2.model.ListInvitationsResponse;
import software.amazon.awssdk.services.macie2.model.ListManagedDataIdentifiersRequest;
import software.amazon.awssdk.services.macie2.model.ListManagedDataIdentifiersResponse;
import software.amazon.awssdk.services.macie2.model.ListMembersRequest;
import software.amazon.awssdk.services.macie2.model.ListMembersResponse;
import software.amazon.awssdk.services.macie2.model.ListOrganizationAdminAccountsRequest;
import software.amazon.awssdk.services.macie2.model.ListOrganizationAdminAccountsResponse;
import software.amazon.awssdk.services.macie2.model.ListResourceProfileArtifactsRequest;
import software.amazon.awssdk.services.macie2.model.ListResourceProfileArtifactsResponse;
import software.amazon.awssdk.services.macie2.model.ListResourceProfileDetectionsRequest;
import software.amazon.awssdk.services.macie2.model.ListResourceProfileDetectionsResponse;
import software.amazon.awssdk.services.macie2.model.ListSensitivityInspectionTemplatesRequest;
import software.amazon.awssdk.services.macie2.model.ListSensitivityInspectionTemplatesResponse;
import software.amazon.awssdk.services.macie2.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.macie2.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.macie2.model.Macie2Exception;
import software.amazon.awssdk.services.macie2.model.Macie2Request;
import software.amazon.awssdk.services.macie2.model.PutClassificationExportConfigurationRequest;
import software.amazon.awssdk.services.macie2.model.PutClassificationExportConfigurationResponse;
import software.amazon.awssdk.services.macie2.model.PutFindingsPublicationConfigurationRequest;
import software.amazon.awssdk.services.macie2.model.PutFindingsPublicationConfigurationResponse;
import software.amazon.awssdk.services.macie2.model.ResourceNotFoundException;
import software.amazon.awssdk.services.macie2.model.SearchResourcesRequest;
import software.amazon.awssdk.services.macie2.model.SearchResourcesResponse;
import software.amazon.awssdk.services.macie2.model.ServiceQuotaExceededException;
import software.amazon.awssdk.services.macie2.model.TagResourceRequest;
import software.amazon.awssdk.services.macie2.model.TagResourceResponse;
import software.amazon.awssdk.services.macie2.model.TestCustomDataIdentifierRequest;
import software.amazon.awssdk.services.macie2.model.TestCustomDataIdentifierResponse;
import software.amazon.awssdk.services.macie2.model.ThrottlingException;
import software.amazon.awssdk.services.macie2.model.UnprocessableEntityException;
import software.amazon.awssdk.services.macie2.model.UntagResourceRequest;
import software.amazon.awssdk.services.macie2.model.UntagResourceResponse;
import software.amazon.awssdk.services.macie2.model.UpdateAllowListRequest;
import software.amazon.awssdk.services.macie2.model.UpdateAllowListResponse;
import software.amazon.awssdk.services.macie2.model.UpdateAutomatedDiscoveryConfigurationRequest;
import software.amazon.awssdk.services.macie2.model.UpdateAutomatedDiscoveryConfigurationResponse;
import software.amazon.awssdk.services.macie2.model.UpdateClassificationJobRequest;
import software.amazon.awssdk.services.macie2.model.UpdateClassificationJobResponse;
import software.amazon.awssdk.services.macie2.model.UpdateClassificationScopeRequest;
import software.amazon.awssdk.services.macie2.model.UpdateClassificationScopeResponse;
import software.amazon.awssdk.services.macie2.model.UpdateFindingsFilterRequest;
import software.amazon.awssdk.services.macie2.model.UpdateFindingsFilterResponse;
import software.amazon.awssdk.services.macie2.model.UpdateMacieSessionRequest;
import software.amazon.awssdk.services.macie2.model.UpdateMacieSessionResponse;
import software.amazon.awssdk.services.macie2.model.UpdateMemberSessionRequest;
import software.amazon.awssdk.services.macie2.model.UpdateMemberSessionResponse;
import software.amazon.awssdk.services.macie2.model.UpdateOrganizationConfigurationRequest;
import software.amazon.awssdk.services.macie2.model.UpdateOrganizationConfigurationResponse;
import software.amazon.awssdk.services.macie2.model.UpdateResourceProfileDetectionsRequest;
import software.amazon.awssdk.services.macie2.model.UpdateResourceProfileDetectionsResponse;
import software.amazon.awssdk.services.macie2.model.UpdateResourceProfileRequest;
import software.amazon.awssdk.services.macie2.model.UpdateResourceProfileResponse;
import software.amazon.awssdk.services.macie2.model.UpdateRevealConfigurationRequest;
import software.amazon.awssdk.services.macie2.model.UpdateRevealConfigurationResponse;
import software.amazon.awssdk.services.macie2.model.UpdateSensitivityInspectionTemplateRequest;
import software.amazon.awssdk.services.macie2.model.UpdateSensitivityInspectionTemplateResponse;
import software.amazon.awssdk.services.macie2.model.ValidationException;
import software.amazon.awssdk.services.macie2.paginators.DescribeBucketsPublisher;
import software.amazon.awssdk.services.macie2.paginators.GetUsageStatisticsPublisher;
import software.amazon.awssdk.services.macie2.paginators.ListAllowListsPublisher;
import software.amazon.awssdk.services.macie2.paginators.ListClassificationJobsPublisher;
import software.amazon.awssdk.services.macie2.paginators.ListClassificationScopesPublisher;
import software.amazon.awssdk.services.macie2.paginators.ListCustomDataIdentifiersPublisher;
import software.amazon.awssdk.services.macie2.paginators.ListFindingsFiltersPublisher;
import software.amazon.awssdk.services.macie2.paginators.ListFindingsPublisher;
import software.amazon.awssdk.services.macie2.paginators.ListInvitationsPublisher;
import software.amazon.awssdk.services.macie2.paginators.ListManagedDataIdentifiersPublisher;
import software.amazon.awssdk.services.macie2.paginators.ListMembersPublisher;
import software.amazon.awssdk.services.macie2.paginators.ListOrganizationAdminAccountsPublisher;
import software.amazon.awssdk.services.macie2.paginators.ListResourceProfileArtifactsPublisher;
import software.amazon.awssdk.services.macie2.paginators.ListResourceProfileDetectionsPublisher;
import software.amazon.awssdk.services.macie2.paginators.ListSensitivityInspectionTemplatesPublisher;
import software.amazon.awssdk.services.macie2.paginators.SearchResourcesPublisher;
import software.amazon.awssdk.services.macie2.transform.AcceptInvitationRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.BatchGetCustomDataIdentifiersRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.CreateAllowListRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.CreateClassificationJobRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.CreateCustomDataIdentifierRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.CreateFindingsFilterRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.CreateInvitationsRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.CreateMemberRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.CreateSampleFindingsRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.DeclineInvitationsRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.DeleteAllowListRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.DeleteCustomDataIdentifierRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.DeleteFindingsFilterRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.DeleteInvitationsRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.DeleteMemberRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.DescribeBucketsRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.DescribeClassificationJobRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.DescribeOrganizationConfigurationRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.DisableMacieRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.DisableOrganizationAdminAccountRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.DisassociateFromAdministratorAccountRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.DisassociateFromMasterAccountRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.DisassociateMemberRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.EnableMacieRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.EnableOrganizationAdminAccountRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.GetAdministratorAccountRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.GetAllowListRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.GetAutomatedDiscoveryConfigurationRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.GetBucketStatisticsRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.GetClassificationExportConfigurationRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.GetClassificationScopeRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.GetCustomDataIdentifierRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.GetFindingStatisticsRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.GetFindingsFilterRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.GetFindingsPublicationConfigurationRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.GetFindingsRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.GetInvitationsCountRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.GetMacieSessionRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.GetMasterAccountRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.GetMemberRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.GetResourceProfileRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.GetRevealConfigurationRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.GetSensitiveDataOccurrencesAvailabilityRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.GetSensitiveDataOccurrencesRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.GetSensitivityInspectionTemplateRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.GetUsageStatisticsRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.GetUsageTotalsRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.ListAllowListsRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.ListClassificationJobsRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.ListClassificationScopesRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.ListCustomDataIdentifiersRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.ListFindingsFiltersRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.ListFindingsRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.ListInvitationsRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.ListManagedDataIdentifiersRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.ListMembersRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.ListOrganizationAdminAccountsRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.ListResourceProfileArtifactsRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.ListResourceProfileDetectionsRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.ListSensitivityInspectionTemplatesRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.PutClassificationExportConfigurationRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.PutFindingsPublicationConfigurationRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.SearchResourcesRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.TestCustomDataIdentifierRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.UpdateAllowListRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.UpdateAutomatedDiscoveryConfigurationRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.UpdateClassificationJobRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.UpdateClassificationScopeRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.UpdateFindingsFilterRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.UpdateMacieSessionRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.UpdateMemberSessionRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.UpdateOrganizationConfigurationRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.UpdateResourceProfileDetectionsRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.UpdateResourceProfileRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.UpdateRevealConfigurationRequestMarshaller;
import software.amazon.awssdk.services.macie2.transform.UpdateSensitivityInspectionTemplateRequestMarshaller;
import software.amazon.awssdk.services.macie2.waiters.Macie2AsyncWaiter;
import software.amazon.awssdk.utils.CompletableFutureUtils;

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

    private final AsyncClientHandler clientHandler;

    private final AwsJsonProtocolFactory protocolFactory;

    private final SdkClientConfiguration clientConfiguration;

    private final ScheduledExecutorService executorService;

    protected DefaultMacie2AsyncClient(SdkClientConfiguration clientConfiguration) {
        this.clientHandler = new AwsAsyncClientHandler(clientConfiguration);
        this.clientConfiguration = clientConfiguration;
        this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
        this.executorService = clientConfiguration.option(SdkClientOption.SCHEDULED_EXECUTOR_SERVICE);
    }

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

    /**
     * 

* Accepts an Amazon Macie membership invitation that was received from a specific account. *

* * @param acceptInvitationRequest * @return A Java Future containing the result of the AcceptInvitation operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.AcceptInvitation * @see AWS API * Documentation */ @Override public CompletableFuture acceptInvitation(AcceptInvitationRequest acceptInvitationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, acceptInvitationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AcceptInvitation"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AcceptInvitationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AcceptInvitation") .withMarshaller(new AcceptInvitationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(acceptInvitationRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about one or more custom data identifiers. *

* * @param batchGetCustomDataIdentifiersRequest * @return A Java Future containing the result of the BatchGetCustomDataIdentifiers operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.BatchGetCustomDataIdentifiers * @see AWS API Documentation */ @Override public CompletableFuture batchGetCustomDataIdentifiers( BatchGetCustomDataIdentifiersRequest batchGetCustomDataIdentifiersRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, batchGetCustomDataIdentifiersRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "BatchGetCustomDataIdentifiers"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, BatchGetCustomDataIdentifiersResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("BatchGetCustomDataIdentifiers") .withMarshaller(new BatchGetCustomDataIdentifiersRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(batchGetCustomDataIdentifiersRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 and defines the settings for an allow list. *

* * @param createAllowListRequest * @return A Java Future containing the result of the CreateAllowList operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.CreateAllowList * @see AWS API * Documentation */ @Override public CompletableFuture createAllowList(CreateAllowListRequest createAllowListRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createAllowListRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateAllowList"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateAllowListResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateAllowList") .withMarshaller(new CreateAllowListRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createAllowListRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 and defines the settings for a classification job. *

* * @param createClassificationJobRequest * @return A Java Future containing the result of the CreateClassificationJob operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.CreateClassificationJob * @see AWS API Documentation */ @Override public CompletableFuture createClassificationJob( CreateClassificationJobRequest createClassificationJobRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createClassificationJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateClassificationJob"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateClassificationJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateClassificationJob") .withMarshaller(new CreateClassificationJobRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createClassificationJobRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 and defines the criteria and other settings for a custom data identifier. *

* * @param createCustomDataIdentifierRequest * @return A Java Future containing the result of the CreateCustomDataIdentifier operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.CreateCustomDataIdentifier * @see AWS API Documentation */ @Override public CompletableFuture createCustomDataIdentifier( CreateCustomDataIdentifierRequest createCustomDataIdentifierRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createCustomDataIdentifierRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateCustomDataIdentifier"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateCustomDataIdentifierResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateCustomDataIdentifier") .withMarshaller(new CreateCustomDataIdentifierRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createCustomDataIdentifierRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 and defines the criteria and other settings for a findings filter. *

* * @param createFindingsFilterRequest * @return A Java Future containing the result of the CreateFindingsFilter operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.CreateFindingsFilter * @see AWS * API Documentation */ @Override public CompletableFuture createFindingsFilter( CreateFindingsFilterRequest createFindingsFilterRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createFindingsFilterRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateFindingsFilter"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateFindingsFilterResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateFindingsFilter") .withMarshaller(new CreateFindingsFilterRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createFindingsFilterRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Sends an Amazon Macie membership invitation to one or more accounts. *

* * @param createInvitationsRequest * @return A Java Future containing the result of the CreateInvitations operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.CreateInvitations * @see AWS API * Documentation */ @Override public CompletableFuture createInvitations(CreateInvitationsRequest createInvitationsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createInvitationsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateInvitations"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateInvitationsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateInvitations") .withMarshaller(new CreateInvitationsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createInvitationsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 an account with an Amazon Macie administrator account. *

* * @param createMemberRequest * @return A Java Future containing the result of the CreateMember operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.CreateMember * @see AWS API * Documentation */ @Override public CompletableFuture createMember(CreateMemberRequest createMemberRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createMemberRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateMember"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateMemberResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateMember").withMarshaller(new CreateMemberRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createMemberRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 sample findings. *

* * @param createSampleFindingsRequest * @return A Java Future containing the result of the CreateSampleFindings operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.CreateSampleFindings * @see AWS * API Documentation */ @Override public CompletableFuture createSampleFindings( CreateSampleFindingsRequest createSampleFindingsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createSampleFindingsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateSampleFindings"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateSampleFindingsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateSampleFindings") .withMarshaller(new CreateSampleFindingsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createSampleFindingsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Declines Amazon Macie membership invitations that were received from specific accounts. *

* * @param declineInvitationsRequest * @return A Java Future containing the result of the DeclineInvitations operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.DeclineInvitations * @see AWS API * Documentation */ @Override public CompletableFuture declineInvitations(DeclineInvitationsRequest declineInvitationsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, declineInvitationsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeclineInvitations"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeclineInvitationsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeclineInvitations") .withMarshaller(new DeclineInvitationsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(declineInvitationsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 allow list. *

* * @param deleteAllowListRequest * @return A Java Future containing the result of the DeleteAllowList operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.DeleteAllowList * @see AWS API * Documentation */ @Override public CompletableFuture deleteAllowList(DeleteAllowListRequest deleteAllowListRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteAllowListRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteAllowList"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteAllowListResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteAllowList") .withMarshaller(new DeleteAllowListRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteAllowListRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Soft deletes a custom data identifier. *

* * @param deleteCustomDataIdentifierRequest * @return A Java Future containing the result of the DeleteCustomDataIdentifier operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.DeleteCustomDataIdentifier * @see AWS API Documentation */ @Override public CompletableFuture deleteCustomDataIdentifier( DeleteCustomDataIdentifierRequest deleteCustomDataIdentifierRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteCustomDataIdentifierRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteCustomDataIdentifier"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteCustomDataIdentifierResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteCustomDataIdentifier") .withMarshaller(new DeleteCustomDataIdentifierRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteCustomDataIdentifierRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 findings filter. *

* * @param deleteFindingsFilterRequest * @return A Java Future containing the result of the DeleteFindingsFilter operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.DeleteFindingsFilter * @see AWS * API Documentation */ @Override public CompletableFuture deleteFindingsFilter( DeleteFindingsFilterRequest deleteFindingsFilterRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteFindingsFilterRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteFindingsFilter"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteFindingsFilterResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteFindingsFilter") .withMarshaller(new DeleteFindingsFilterRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteFindingsFilterRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 Amazon Macie membership invitations that were received from specific accounts. *

* * @param deleteInvitationsRequest * @return A Java Future containing the result of the DeleteInvitations operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.DeleteInvitations * @see AWS API * Documentation */ @Override public CompletableFuture deleteInvitations(DeleteInvitationsRequest deleteInvitationsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteInvitationsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteInvitations"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteInvitationsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteInvitations") .withMarshaller(new DeleteInvitationsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteInvitationsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 association between an Amazon Macie administrator account and an account. *

* * @param deleteMemberRequest * @return A Java Future containing the result of the DeleteMember operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.DeleteMember * @see AWS API * Documentation */ @Override public CompletableFuture deleteMember(DeleteMemberRequest deleteMemberRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteMemberRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteMember"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteMemberResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteMember").withMarshaller(new DeleteMemberRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteMemberRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves (queries) statistical data and other information about one or more S3 buckets that Amazon Macie * monitors and analyzes for an account. *

* * @param describeBucketsRequest * @return A Java Future containing the result of the DescribeBuckets operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.DescribeBuckets * @see AWS API * Documentation */ @Override public CompletableFuture describeBuckets(DescribeBucketsRequest describeBucketsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeBucketsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeBuckets"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeBucketsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeBuckets") .withMarshaller(new DescribeBucketsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeBucketsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves (queries) statistical data and other information about one or more S3 buckets that Amazon Macie * monitors and analyzes for an account. *

*
*

* This is a variant of * {@link #describeBuckets(software.amazon.awssdk.services.macie2.model.DescribeBucketsRequest)} 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.macie2.paginators.DescribeBucketsPublisher publisher = client.describeBucketsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.macie2.paginators.DescribeBucketsPublisher publisher = client.describeBucketsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.macie2.model.DescribeBucketsResponse 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 #describeBuckets(software.amazon.awssdk.services.macie2.model.DescribeBucketsRequest)} operation. *

* * @param describeBucketsRequest * @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. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.DescribeBuckets * @see AWS API * Documentation */ public DescribeBucketsPublisher describeBucketsPaginator(DescribeBucketsRequest describeBucketsRequest) { return new DescribeBucketsPublisher(this, applyPaginatorUserAgent(describeBucketsRequest)); } /** *

* Retrieves the status and settings for a classification job. *

* * @param describeClassificationJobRequest * @return A Java Future containing the result of the DescribeClassificationJob operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.DescribeClassificationJob * @see AWS API Documentation */ @Override public CompletableFuture describeClassificationJob( DescribeClassificationJobRequest describeClassificationJobRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeClassificationJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeClassificationJob"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeClassificationJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeClassificationJob") .withMarshaller(new DescribeClassificationJobRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeClassificationJobRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves the Amazon Macie configuration settings for an organization in Organizations. *

* * @param describeOrganizationConfigurationRequest * @return A Java Future containing the result of the DescribeOrganizationConfiguration operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.DescribeOrganizationConfiguration * @see AWS API Documentation */ @Override public CompletableFuture describeOrganizationConfiguration( DescribeOrganizationConfigurationRequest describeOrganizationConfigurationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeOrganizationConfigurationRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeOrganizationConfiguration"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, DescribeOrganizationConfigurationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeOrganizationConfiguration") .withMarshaller(new DescribeOrganizationConfigurationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeOrganizationConfigurationRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 Amazon Macie and deletes all settings and resources for a Macie account. *

* * @param disableMacieRequest * @return A Java Future containing the result of the DisableMacie operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.DisableMacie * @see AWS API * Documentation */ @Override public CompletableFuture disableMacie(DisableMacieRequest disableMacieRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, disableMacieRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DisableMacie"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DisableMacieResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DisableMacie").withMarshaller(new DisableMacieRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(disableMacieRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 an account as the delegated Amazon Macie administrator account for an organization in Organizations. *

* * @param disableOrganizationAdminAccountRequest * @return A Java Future containing the result of the DisableOrganizationAdminAccount operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.DisableOrganizationAdminAccount * @see AWS API Documentation */ @Override public CompletableFuture disableOrganizationAdminAccount( DisableOrganizationAdminAccountRequest disableOrganizationAdminAccountRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, disableOrganizationAdminAccountRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DisableOrganizationAdminAccount"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DisableOrganizationAdminAccountResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DisableOrganizationAdminAccount") .withMarshaller(new DisableOrganizationAdminAccountRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(disableOrganizationAdminAccountRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 member account from its Amazon Macie administrator account. *

* * @param disassociateFromAdministratorAccountRequest * @return A Java Future containing the result of the DisassociateFromAdministratorAccount operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.DisassociateFromAdministratorAccount * @see AWS API Documentation */ @Override public CompletableFuture disassociateFromAdministratorAccount( DisassociateFromAdministratorAccountRequest disassociateFromAdministratorAccountRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, disassociateFromAdministratorAccountRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DisassociateFromAdministratorAccount"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, DisassociateFromAdministratorAccountResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DisassociateFromAdministratorAccount") .withMarshaller(new DisassociateFromAdministratorAccountRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(disassociateFromAdministratorAccountRequest)); CompletableFuture whenCompleted = executeFuture .whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* (Deprecated) Disassociates a member account from its Amazon Macie administrator account. This operation has been * replaced by the DisassociateFromAdministratorAccount * operation. *

* * @param disassociateFromMasterAccountRequest * @return A Java Future containing the result of the DisassociateFromMasterAccount operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.DisassociateFromMasterAccount * @see AWS API Documentation */ @Override public CompletableFuture disassociateFromMasterAccount( DisassociateFromMasterAccountRequest disassociateFromMasterAccountRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, disassociateFromMasterAccountRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DisassociateFromMasterAccount"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DisassociateFromMasterAccountResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DisassociateFromMasterAccount") .withMarshaller(new DisassociateFromMasterAccountRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(disassociateFromMasterAccountRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 an Amazon Macie administrator account from a member account. *

* * @param disassociateMemberRequest * @return A Java Future containing the result of the DisassociateMember operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.DisassociateMember * @see AWS API * Documentation */ @Override public CompletableFuture disassociateMember(DisassociateMemberRequest disassociateMemberRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, disassociateMemberRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DisassociateMember"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DisassociateMemberResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DisassociateMember") .withMarshaller(new DisassociateMemberRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(disassociateMemberRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 Amazon Macie and specifies the configuration settings for a Macie account. *

* * @param enableMacieRequest * @return A Java Future containing the result of the EnableMacie operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.EnableMacie * @see AWS API * Documentation */ @Override public CompletableFuture enableMacie(EnableMacieRequest enableMacieRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, enableMacieRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "EnableMacie"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, EnableMacieResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("EnableMacie").withMarshaller(new EnableMacieRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(enableMacieRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Designates an account as the delegated Amazon Macie administrator account for an organization in Organizations. *

* * @param enableOrganizationAdminAccountRequest * @return A Java Future containing the result of the EnableOrganizationAdminAccount operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.EnableOrganizationAdminAccount * @see AWS API Documentation */ @Override public CompletableFuture enableOrganizationAdminAccount( EnableOrganizationAdminAccountRequest enableOrganizationAdminAccountRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, enableOrganizationAdminAccountRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "EnableOrganizationAdminAccount"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, EnableOrganizationAdminAccountResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("EnableOrganizationAdminAccount") .withMarshaller(new EnableOrganizationAdminAccountRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(enableOrganizationAdminAccountRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about the Amazon Macie administrator account for an account. *

* * @param getAdministratorAccountRequest * @return A Java Future containing the result of the GetAdministratorAccount operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.GetAdministratorAccount * @see AWS API Documentation */ @Override public CompletableFuture getAdministratorAccount( GetAdministratorAccountRequest getAdministratorAccountRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getAdministratorAccountRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetAdministratorAccount"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetAdministratorAccountResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetAdministratorAccount") .withMarshaller(new GetAdministratorAccountRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getAdministratorAccountRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves the settings and status of an allow list. *

* * @param getAllowListRequest * @return A Java Future containing the result of the GetAllowList operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.GetAllowList * @see AWS API * Documentation */ @Override public CompletableFuture getAllowList(GetAllowListRequest getAllowListRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getAllowListRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetAllowList"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetAllowListResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetAllowList").withMarshaller(new GetAllowListRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getAllowListRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves the configuration settings and status of automated sensitive data discovery for an account. *

* * @param getAutomatedDiscoveryConfigurationRequest * @return A Java Future containing the result of the GetAutomatedDiscoveryConfiguration operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.GetAutomatedDiscoveryConfiguration * @see AWS API Documentation */ @Override public CompletableFuture getAutomatedDiscoveryConfiguration( GetAutomatedDiscoveryConfigurationRequest getAutomatedDiscoveryConfigurationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getAutomatedDiscoveryConfigurationRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetAutomatedDiscoveryConfiguration"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, GetAutomatedDiscoveryConfigurationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetAutomatedDiscoveryConfiguration") .withMarshaller(new GetAutomatedDiscoveryConfigurationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getAutomatedDiscoveryConfigurationRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves (queries) aggregated statistical data about all the S3 buckets that Amazon Macie monitors and analyzes * for an account. *

* * @param getBucketStatisticsRequest * @return A Java Future containing the result of the GetBucketStatistics operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.GetBucketStatistics * @see AWS * API Documentation */ @Override public CompletableFuture getBucketStatistics( GetBucketStatisticsRequest getBucketStatisticsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getBucketStatisticsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetBucketStatistics"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetBucketStatisticsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetBucketStatistics") .withMarshaller(new GetBucketStatisticsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getBucketStatisticsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves the configuration settings for storing data classification results. *

* * @param getClassificationExportConfigurationRequest * @return A Java Future containing the result of the GetClassificationExportConfiguration operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.GetClassificationExportConfiguration * @see AWS API Documentation */ @Override public CompletableFuture getClassificationExportConfiguration( GetClassificationExportConfigurationRequest getClassificationExportConfigurationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getClassificationExportConfigurationRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetClassificationExportConfiguration"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, GetClassificationExportConfigurationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetClassificationExportConfiguration") .withMarshaller(new GetClassificationExportConfigurationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getClassificationExportConfigurationRequest)); CompletableFuture whenCompleted = executeFuture .whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves the classification scope settings for an account. *

* * @param getClassificationScopeRequest * @return A Java Future containing the result of the GetClassificationScope operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.GetClassificationScope * @see AWS * API Documentation */ @Override public CompletableFuture getClassificationScope( GetClassificationScopeRequest getClassificationScopeRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getClassificationScopeRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetClassificationScope"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetClassificationScopeResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetClassificationScope") .withMarshaller(new GetClassificationScopeRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getClassificationScopeRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves the criteria and other settings for a custom data identifier. *

* * @param getCustomDataIdentifierRequest * @return A Java Future containing the result of the GetCustomDataIdentifier operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.GetCustomDataIdentifier * @see AWS API Documentation */ @Override public CompletableFuture getCustomDataIdentifier( GetCustomDataIdentifierRequest getCustomDataIdentifierRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getCustomDataIdentifierRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetCustomDataIdentifier"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetCustomDataIdentifierResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetCustomDataIdentifier") .withMarshaller(new GetCustomDataIdentifierRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getCustomDataIdentifierRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves (queries) aggregated statistical data about findings. *

* * @param getFindingStatisticsRequest * @return A Java Future containing the result of the GetFindingStatistics operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.GetFindingStatistics * @see AWS * API Documentation */ @Override public CompletableFuture getFindingStatistics( GetFindingStatisticsRequest getFindingStatisticsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getFindingStatisticsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetFindingStatistics"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetFindingStatisticsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetFindingStatistics") .withMarshaller(new GetFindingStatisticsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getFindingStatisticsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves the details of one or more findings. *

* * @param getFindingsRequest * @return A Java Future containing the result of the GetFindings operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.GetFindings * @see AWS API * Documentation */ @Override public CompletableFuture getFindings(GetFindingsRequest getFindingsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getFindingsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetFindings"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetFindingsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetFindings").withMarshaller(new GetFindingsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getFindingsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves the criteria and other settings for a findings filter. *

* * @param getFindingsFilterRequest * @return A Java Future containing the result of the GetFindingsFilter operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.GetFindingsFilter * @see AWS API * Documentation */ @Override public CompletableFuture getFindingsFilter(GetFindingsFilterRequest getFindingsFilterRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getFindingsFilterRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetFindingsFilter"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetFindingsFilterResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetFindingsFilter") .withMarshaller(new GetFindingsFilterRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getFindingsFilterRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves the configuration settings for publishing findings to Security Hub. *

* * @param getFindingsPublicationConfigurationRequest * @return A Java Future containing the result of the GetFindingsPublicationConfiguration operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.GetFindingsPublicationConfiguration * @see AWS API Documentation */ @Override public CompletableFuture getFindingsPublicationConfiguration( GetFindingsPublicationConfigurationRequest getFindingsPublicationConfigurationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getFindingsPublicationConfigurationRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetFindingsPublicationConfiguration"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, GetFindingsPublicationConfigurationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetFindingsPublicationConfiguration") .withMarshaller(new GetFindingsPublicationConfigurationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getFindingsPublicationConfigurationRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves the count of Amazon Macie membership invitations that were received by an account. *

* * @param getInvitationsCountRequest * @return A Java Future containing the result of the GetInvitationsCount operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.GetInvitationsCount * @see AWS * API Documentation */ @Override public CompletableFuture getInvitationsCount( GetInvitationsCountRequest getInvitationsCountRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getInvitationsCountRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetInvitationsCount"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetInvitationsCountResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetInvitationsCount") .withMarshaller(new GetInvitationsCountRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getInvitationsCountRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves the status and configuration settings for an Amazon Macie account. *

* * @param getMacieSessionRequest * @return A Java Future containing the result of the GetMacieSession operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.GetMacieSession * @see AWS API * Documentation */ @Override public CompletableFuture getMacieSession(GetMacieSessionRequest getMacieSessionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getMacieSessionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetMacieSession"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetMacieSessionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetMacieSession") .withMarshaller(new GetMacieSessionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getMacieSessionRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* (Deprecated) Retrieves information about the Amazon Macie administrator account for an account. This operation * has been replaced by the GetAdministratorAccount operation. *

* * @param getMasterAccountRequest * @return A Java Future containing the result of the GetMasterAccount operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.GetMasterAccount * @see AWS API * Documentation */ @Override public CompletableFuture getMasterAccount(GetMasterAccountRequest getMasterAccountRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getMasterAccountRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetMasterAccount"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetMasterAccountResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetMasterAccount") .withMarshaller(new GetMasterAccountRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getMasterAccountRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about an account that's associated with an Amazon Macie administrator account. *

* * @param getMemberRequest * @return A Java Future containing the result of the GetMember operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.GetMember * @see AWS API * Documentation */ @Override public CompletableFuture getMember(GetMemberRequest getMemberRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getMemberRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetMember"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetMemberResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("GetMember") .withMarshaller(new GetMemberRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withMetricCollector(apiCallMetricCollector) .withInput(getMemberRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves (queries) sensitive data discovery statistics and the sensitivity score for an S3 bucket. *

* * @param getResourceProfileRequest * @return A Java Future containing the result of the GetResourceProfile operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.GetResourceProfile * @see AWS API * Documentation */ @Override public CompletableFuture getResourceProfile(GetResourceProfileRequest getResourceProfileRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getResourceProfileRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetResourceProfile"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetResourceProfileResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetResourceProfile") .withMarshaller(new GetResourceProfileRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getResourceProfileRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves the status and configuration settings for retrieving occurrences of sensitive data reported by * findings. *

* * @param getRevealConfigurationRequest * @return A Java Future containing the result of the GetRevealConfiguration operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.GetRevealConfiguration * @see AWS * API Documentation */ @Override public CompletableFuture getRevealConfiguration( GetRevealConfigurationRequest getRevealConfigurationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getRevealConfigurationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetRevealConfiguration"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetRevealConfigurationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetRevealConfiguration") .withMarshaller(new GetRevealConfigurationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getRevealConfigurationRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves occurrences of sensitive data reported by a finding. *

* * @param getSensitiveDataOccurrencesRequest * @return A Java Future containing the result of the GetSensitiveDataOccurrences operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • UnprocessableEntityException The request failed because it contains instructions that Amazon Macie * can't process (Unprocessable Entity).
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.GetSensitiveDataOccurrences * @see AWS API Documentation */ @Override public CompletableFuture getSensitiveDataOccurrences( GetSensitiveDataOccurrencesRequest getSensitiveDataOccurrencesRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getSensitiveDataOccurrencesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetSensitiveDataOccurrences"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetSensitiveDataOccurrencesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetSensitiveDataOccurrences") .withMarshaller(new GetSensitiveDataOccurrencesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getSensitiveDataOccurrencesRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Checks whether occurrences of sensitive data can be retrieved for a finding. *

* * @param getSensitiveDataOccurrencesAvailabilityRequest * @return A Java Future containing the result of the GetSensitiveDataOccurrencesAvailability operation returned by * the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.GetSensitiveDataOccurrencesAvailability * @see AWS API Documentation */ @Override public CompletableFuture getSensitiveDataOccurrencesAvailability( GetSensitiveDataOccurrencesAvailabilityRequest getSensitiveDataOccurrencesAvailabilityRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getSensitiveDataOccurrencesAvailabilityRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetSensitiveDataOccurrencesAvailability"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, GetSensitiveDataOccurrencesAvailabilityResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetSensitiveDataOccurrencesAvailability") .withMarshaller(new GetSensitiveDataOccurrencesAvailabilityRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector) .withInput(getSensitiveDataOccurrencesAvailabilityRequest)); CompletableFuture whenCompleted = executeFuture .whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves the settings for the sensitivity inspection template for an account. *

* * @param getSensitivityInspectionTemplateRequest * @return A Java Future containing the result of the GetSensitivityInspectionTemplate operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.GetSensitivityInspectionTemplate * @see AWS API Documentation */ @Override public CompletableFuture getSensitivityInspectionTemplate( GetSensitivityInspectionTemplateRequest getSensitivityInspectionTemplateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getSensitivityInspectionTemplateRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetSensitivityInspectionTemplate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, GetSensitivityInspectionTemplateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetSensitivityInspectionTemplate") .withMarshaller(new GetSensitivityInspectionTemplateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getSensitivityInspectionTemplateRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves (queries) quotas and aggregated usage data for one or more accounts. *

* * @param getUsageStatisticsRequest * @return A Java Future containing the result of the GetUsageStatistics operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.GetUsageStatistics * @see AWS API * Documentation */ @Override public CompletableFuture getUsageStatistics(GetUsageStatisticsRequest getUsageStatisticsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getUsageStatisticsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetUsageStatistics"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetUsageStatisticsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetUsageStatistics") .withMarshaller(new GetUsageStatisticsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getUsageStatisticsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves (queries) quotas and aggregated usage data for one or more accounts. *

*
*

* This is a variant of * {@link #getUsageStatistics(software.amazon.awssdk.services.macie2.model.GetUsageStatisticsRequest)} 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.macie2.paginators.GetUsageStatisticsPublisher publisher = client.getUsageStatisticsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.macie2.paginators.GetUsageStatisticsPublisher publisher = client.getUsageStatisticsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.macie2.model.GetUsageStatisticsResponse 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 #getUsageStatistics(software.amazon.awssdk.services.macie2.model.GetUsageStatisticsRequest)} * operation. *

* * @param getUsageStatisticsRequest * @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. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.GetUsageStatistics * @see AWS API * Documentation */ public GetUsageStatisticsPublisher getUsageStatisticsPaginator(GetUsageStatisticsRequest getUsageStatisticsRequest) { return new GetUsageStatisticsPublisher(this, applyPaginatorUserAgent(getUsageStatisticsRequest)); } /** *

* Retrieves (queries) aggregated usage data for an account. *

* * @param getUsageTotalsRequest * @return A Java Future containing the result of the GetUsageTotals operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.GetUsageTotals * @see AWS API * Documentation */ @Override public CompletableFuture getUsageTotals(GetUsageTotalsRequest getUsageTotalsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getUsageTotalsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetUsageTotals"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetUsageTotalsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetUsageTotals") .withMarshaller(new GetUsageTotalsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getUsageTotalsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves a subset of information about all the allow lists for an account. *

* * @param listAllowListsRequest * @return A Java Future containing the result of the ListAllowLists operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.ListAllowLists * @see AWS API * Documentation */ @Override public CompletableFuture listAllowLists(ListAllowListsRequest listAllowListsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listAllowListsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListAllowLists"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListAllowListsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListAllowLists") .withMarshaller(new ListAllowListsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listAllowListsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves a subset of information about all the allow lists for an account. *

*
*

* This is a variant of {@link #listAllowLists(software.amazon.awssdk.services.macie2.model.ListAllowListsRequest)} * 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.macie2.paginators.ListAllowListsPublisher publisher = client.listAllowListsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.macie2.paginators.ListAllowListsPublisher publisher = client.listAllowListsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.macie2.model.ListAllowListsResponse 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 #listAllowLists(software.amazon.awssdk.services.macie2.model.ListAllowListsRequest)} operation. *

* * @param listAllowListsRequest * @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. *
    *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.ListAllowLists * @see AWS API * Documentation */ public ListAllowListsPublisher listAllowListsPaginator(ListAllowListsRequest listAllowListsRequest) { return new ListAllowListsPublisher(this, applyPaginatorUserAgent(listAllowListsRequest)); } /** *

* Retrieves a subset of information about one or more classification jobs. *

* * @param listClassificationJobsRequest * @return A Java Future containing the result of the ListClassificationJobs operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.ListClassificationJobs * @see AWS * API Documentation */ @Override public CompletableFuture listClassificationJobs( ListClassificationJobsRequest listClassificationJobsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listClassificationJobsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListClassificationJobs"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListClassificationJobsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListClassificationJobs") .withMarshaller(new ListClassificationJobsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listClassificationJobsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves a subset of information about one or more classification jobs. *

*
*

* This is a variant of * {@link #listClassificationJobs(software.amazon.awssdk.services.macie2.model.ListClassificationJobsRequest)} * 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.macie2.paginators.ListClassificationJobsPublisher publisher = client.listClassificationJobsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.macie2.paginators.ListClassificationJobsPublisher publisher = client.listClassificationJobsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.macie2.model.ListClassificationJobsResponse 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 #listClassificationJobs(software.amazon.awssdk.services.macie2.model.ListClassificationJobsRequest)} * operation. *

* * @param listClassificationJobsRequest * @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. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.ListClassificationJobs * @see AWS * API Documentation */ public ListClassificationJobsPublisher listClassificationJobsPaginator( ListClassificationJobsRequest listClassificationJobsRequest) { return new ListClassificationJobsPublisher(this, applyPaginatorUserAgent(listClassificationJobsRequest)); } /** *

* Retrieves a subset of information about the classification scope for an account. *

* * @param listClassificationScopesRequest * @return A Java Future containing the result of the ListClassificationScopes operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.ListClassificationScopes * @see AWS API Documentation */ @Override public CompletableFuture listClassificationScopes( ListClassificationScopesRequest listClassificationScopesRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listClassificationScopesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListClassificationScopes"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListClassificationScopesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListClassificationScopes") .withMarshaller(new ListClassificationScopesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listClassificationScopesRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves a subset of information about the classification scope for an account. *

*
*

* This is a variant of * {@link #listClassificationScopes(software.amazon.awssdk.services.macie2.model.ListClassificationScopesRequest)} * 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.macie2.paginators.ListClassificationScopesPublisher publisher = client.listClassificationScopesPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.macie2.paginators.ListClassificationScopesPublisher publisher = client.listClassificationScopesPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.macie2.model.ListClassificationScopesResponse 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 #listClassificationScopes(software.amazon.awssdk.services.macie2.model.ListClassificationScopesRequest)} * operation. *

* * @param listClassificationScopesRequest * @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. *
    *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.ListClassificationScopes * @see AWS API Documentation */ public ListClassificationScopesPublisher listClassificationScopesPaginator( ListClassificationScopesRequest listClassificationScopesRequest) { return new ListClassificationScopesPublisher(this, applyPaginatorUserAgent(listClassificationScopesRequest)); } /** *

* Retrieves a subset of information about all the custom data identifiers for an account. *

* * @param listCustomDataIdentifiersRequest * @return A Java Future containing the result of the ListCustomDataIdentifiers operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.ListCustomDataIdentifiers * @see AWS API Documentation */ @Override public CompletableFuture listCustomDataIdentifiers( ListCustomDataIdentifiersRequest listCustomDataIdentifiersRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listCustomDataIdentifiersRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListCustomDataIdentifiers"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListCustomDataIdentifiersResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListCustomDataIdentifiers") .withMarshaller(new ListCustomDataIdentifiersRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listCustomDataIdentifiersRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves a subset of information about all the custom data identifiers for an account. *

*
*

* This is a variant of * {@link #listCustomDataIdentifiers(software.amazon.awssdk.services.macie2.model.ListCustomDataIdentifiersRequest)} * 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.macie2.paginators.ListCustomDataIdentifiersPublisher publisher = client.listCustomDataIdentifiersPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.macie2.paginators.ListCustomDataIdentifiersPublisher publisher = client.listCustomDataIdentifiersPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.macie2.model.ListCustomDataIdentifiersResponse 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 #listCustomDataIdentifiers(software.amazon.awssdk.services.macie2.model.ListCustomDataIdentifiersRequest)} * operation. *

* * @param listCustomDataIdentifiersRequest * @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. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.ListCustomDataIdentifiers * @see AWS API Documentation */ public ListCustomDataIdentifiersPublisher listCustomDataIdentifiersPaginator( ListCustomDataIdentifiersRequest listCustomDataIdentifiersRequest) { return new ListCustomDataIdentifiersPublisher(this, applyPaginatorUserAgent(listCustomDataIdentifiersRequest)); } /** *

* Retrieves a subset of information about one or more findings. *

* * @param listFindingsRequest * @return A Java Future containing the result of the ListFindings operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.ListFindings * @see AWS API * Documentation */ @Override public CompletableFuture listFindings(ListFindingsRequest listFindingsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listFindingsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListFindings"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListFindingsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListFindings").withMarshaller(new ListFindingsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listFindingsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves a subset of information about all the findings filters for an account. *

* * @param listFindingsFiltersRequest * @return A Java Future containing the result of the ListFindingsFilters operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.ListFindingsFilters * @see AWS * API Documentation */ @Override public CompletableFuture listFindingsFilters( ListFindingsFiltersRequest listFindingsFiltersRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listFindingsFiltersRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListFindingsFilters"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListFindingsFiltersResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListFindingsFilters") .withMarshaller(new ListFindingsFiltersRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listFindingsFiltersRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves a subset of information about all the findings filters for an account. *

*
*

* This is a variant of * {@link #listFindingsFilters(software.amazon.awssdk.services.macie2.model.ListFindingsFiltersRequest)} 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.macie2.paginators.ListFindingsFiltersPublisher publisher = client.listFindingsFiltersPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.macie2.paginators.ListFindingsFiltersPublisher publisher = client.listFindingsFiltersPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.macie2.model.ListFindingsFiltersResponse 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 #listFindingsFilters(software.amazon.awssdk.services.macie2.model.ListFindingsFiltersRequest)} * operation. *

* * @param listFindingsFiltersRequest * @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. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.ListFindingsFilters * @see AWS * API Documentation */ public ListFindingsFiltersPublisher listFindingsFiltersPaginator(ListFindingsFiltersRequest listFindingsFiltersRequest) { return new ListFindingsFiltersPublisher(this, applyPaginatorUserAgent(listFindingsFiltersRequest)); } /** *

* Retrieves a subset of information about one or more findings. *

*
*

* This is a variant of {@link #listFindings(software.amazon.awssdk.services.macie2.model.ListFindingsRequest)} * 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.macie2.paginators.ListFindingsPublisher publisher = client.listFindingsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.macie2.paginators.ListFindingsPublisher publisher = client.listFindingsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.macie2.model.ListFindingsResponse 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 #listFindings(software.amazon.awssdk.services.macie2.model.ListFindingsRequest)} operation. *

* * @param listFindingsRequest * @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. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.ListFindings * @see AWS API * Documentation */ public ListFindingsPublisher listFindingsPaginator(ListFindingsRequest listFindingsRequest) { return new ListFindingsPublisher(this, applyPaginatorUserAgent(listFindingsRequest)); } /** *

* Retrieves information about the Amazon Macie membership invitations that were received by an account. *

* * @param listInvitationsRequest * @return A Java Future containing the result of the ListInvitations operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.ListInvitations * @see AWS API * Documentation */ @Override public CompletableFuture listInvitations(ListInvitationsRequest listInvitationsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listInvitationsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListInvitations"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListInvitationsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListInvitations") .withMarshaller(new ListInvitationsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listInvitationsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about the Amazon Macie membership invitations that were received by an account. *

*
*

* This is a variant of * {@link #listInvitations(software.amazon.awssdk.services.macie2.model.ListInvitationsRequest)} 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.macie2.paginators.ListInvitationsPublisher publisher = client.listInvitationsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.macie2.paginators.ListInvitationsPublisher publisher = client.listInvitationsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.macie2.model.ListInvitationsResponse 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 #listInvitations(software.amazon.awssdk.services.macie2.model.ListInvitationsRequest)} operation. *

* * @param listInvitationsRequest * @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. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.ListInvitations * @see AWS API * Documentation */ public ListInvitationsPublisher listInvitationsPaginator(ListInvitationsRequest listInvitationsRequest) { return new ListInvitationsPublisher(this, applyPaginatorUserAgent(listInvitationsRequest)); } /** *

* Retrieves information about all the managed data identifiers that Amazon Macie currently provides. *

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

* Retrieves information about all the managed data identifiers that Amazon Macie currently provides. *

*
*

* This is a variant of * {@link #listManagedDataIdentifiers(software.amazon.awssdk.services.macie2.model.ListManagedDataIdentifiersRequest)} * 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.macie2.paginators.ListManagedDataIdentifiersPublisher publisher = client.listManagedDataIdentifiersPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.macie2.paginators.ListManagedDataIdentifiersPublisher publisher = client.listManagedDataIdentifiersPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.macie2.model.ListManagedDataIdentifiersResponse 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 #listManagedDataIdentifiers(software.amazon.awssdk.services.macie2.model.ListManagedDataIdentifiersRequest)} * operation. *

* * @param listManagedDataIdentifiersRequest * @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. *
    *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.ListManagedDataIdentifiers * @see AWS API Documentation */ public ListManagedDataIdentifiersPublisher listManagedDataIdentifiersPaginator( ListManagedDataIdentifiersRequest listManagedDataIdentifiersRequest) { return new ListManagedDataIdentifiersPublisher(this, applyPaginatorUserAgent(listManagedDataIdentifiersRequest)); } /** *

* Retrieves information about the accounts that are associated with an Amazon Macie administrator account. *

* * @param listMembersRequest * @return A Java Future containing the result of the ListMembers operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.ListMembers * @see AWS API * Documentation */ @Override public CompletableFuture listMembers(ListMembersRequest listMembersRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listMembersRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListMembers"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListMembersResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListMembers").withMarshaller(new ListMembersRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listMembersRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about the accounts that are associated with an Amazon Macie administrator account. *

*
*

* This is a variant of {@link #listMembers(software.amazon.awssdk.services.macie2.model.ListMembersRequest)} * 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.macie2.paginators.ListMembersPublisher publisher = client.listMembersPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.macie2.paginators.ListMembersPublisher publisher = client.listMembersPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.macie2.model.ListMembersResponse 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 #listMembers(software.amazon.awssdk.services.macie2.model.ListMembersRequest)} operation. *

* * @param listMembersRequest * @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. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.ListMembers * @see AWS API * Documentation */ public ListMembersPublisher listMembersPaginator(ListMembersRequest listMembersRequest) { return new ListMembersPublisher(this, applyPaginatorUserAgent(listMembersRequest)); } /** *

* Retrieves information about the delegated Amazon Macie administrator account for an organization in * Organizations. *

* * @param listOrganizationAdminAccountsRequest * @return A Java Future containing the result of the ListOrganizationAdminAccounts operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.ListOrganizationAdminAccounts * @see AWS API Documentation */ @Override public CompletableFuture listOrganizationAdminAccounts( ListOrganizationAdminAccountsRequest listOrganizationAdminAccountsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listOrganizationAdminAccountsRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListOrganizationAdminAccounts"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListOrganizationAdminAccountsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListOrganizationAdminAccounts") .withMarshaller(new ListOrganizationAdminAccountsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listOrganizationAdminAccountsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about the delegated Amazon Macie administrator account for an organization in * Organizations. *

*
*

* This is a variant of * {@link #listOrganizationAdminAccounts(software.amazon.awssdk.services.macie2.model.ListOrganizationAdminAccountsRequest)} * 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.macie2.paginators.ListOrganizationAdminAccountsPublisher publisher = client.listOrganizationAdminAccountsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.macie2.paginators.ListOrganizationAdminAccountsPublisher publisher = client.listOrganizationAdminAccountsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.macie2.model.ListOrganizationAdminAccountsResponse 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 #listOrganizationAdminAccounts(software.amazon.awssdk.services.macie2.model.ListOrganizationAdminAccountsRequest)} * operation. *

* * @param listOrganizationAdminAccountsRequest * @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. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.ListOrganizationAdminAccounts * @see AWS API Documentation */ public ListOrganizationAdminAccountsPublisher listOrganizationAdminAccountsPaginator( ListOrganizationAdminAccountsRequest listOrganizationAdminAccountsRequest) { return new ListOrganizationAdminAccountsPublisher(this, applyPaginatorUserAgent(listOrganizationAdminAccountsRequest)); } /** *

* Retrieves information about objects that were selected from an S3 bucket for automated sensitive data discovery. *

* * @param listResourceProfileArtifactsRequest * @return A Java Future containing the result of the ListResourceProfileArtifacts operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.ListResourceProfileArtifacts * @see AWS API Documentation */ @Override public CompletableFuture listResourceProfileArtifacts( ListResourceProfileArtifactsRequest listResourceProfileArtifactsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listResourceProfileArtifactsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListResourceProfileArtifacts"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListResourceProfileArtifactsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListResourceProfileArtifacts") .withMarshaller(new ListResourceProfileArtifactsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listResourceProfileArtifactsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about objects that were selected from an S3 bucket for automated sensitive data discovery. *

*
*

* This is a variant of * {@link #listResourceProfileArtifacts(software.amazon.awssdk.services.macie2.model.ListResourceProfileArtifactsRequest)} * 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.macie2.paginators.ListResourceProfileArtifactsPublisher publisher = client.listResourceProfileArtifactsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.macie2.paginators.ListResourceProfileArtifactsPublisher publisher = client.listResourceProfileArtifactsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.macie2.model.ListResourceProfileArtifactsResponse 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 #listResourceProfileArtifacts(software.amazon.awssdk.services.macie2.model.ListResourceProfileArtifactsRequest)} * operation. *

* * @param listResourceProfileArtifactsRequest * @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 request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.ListResourceProfileArtifacts * @see AWS API Documentation */ public ListResourceProfileArtifactsPublisher listResourceProfileArtifactsPaginator( ListResourceProfileArtifactsRequest listResourceProfileArtifactsRequest) { return new ListResourceProfileArtifactsPublisher(this, applyPaginatorUserAgent(listResourceProfileArtifactsRequest)); } /** *

* Retrieves information about the types and amount of sensitive data that Amazon Macie found in an S3 bucket. *

* * @param listResourceProfileDetectionsRequest * @return A Java Future containing the result of the ListResourceProfileDetections operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.ListResourceProfileDetections * @see AWS API Documentation */ @Override public CompletableFuture listResourceProfileDetections( ListResourceProfileDetectionsRequest listResourceProfileDetectionsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listResourceProfileDetectionsRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListResourceProfileDetections"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListResourceProfileDetectionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListResourceProfileDetections") .withMarshaller(new ListResourceProfileDetectionsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listResourceProfileDetectionsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about the types and amount of sensitive data that Amazon Macie found in an S3 bucket. *

*
*

* This is a variant of * {@link #listResourceProfileDetections(software.amazon.awssdk.services.macie2.model.ListResourceProfileDetectionsRequest)} * 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.macie2.paginators.ListResourceProfileDetectionsPublisher publisher = client.listResourceProfileDetectionsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.macie2.paginators.ListResourceProfileDetectionsPublisher publisher = client.listResourceProfileDetectionsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.macie2.model.ListResourceProfileDetectionsResponse 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 #listResourceProfileDetections(software.amazon.awssdk.services.macie2.model.ListResourceProfileDetectionsRequest)} * operation. *

* * @param listResourceProfileDetectionsRequest * @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. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.ListResourceProfileDetections * @see AWS API Documentation */ public ListResourceProfileDetectionsPublisher listResourceProfileDetectionsPaginator( ListResourceProfileDetectionsRequest listResourceProfileDetectionsRequest) { return new ListResourceProfileDetectionsPublisher(this, applyPaginatorUserAgent(listResourceProfileDetectionsRequest)); } /** *

* Retrieves a subset of information about the sensitivity inspection template for an account. *

* * @param listSensitivityInspectionTemplatesRequest * @return A Java Future containing the result of the ListSensitivityInspectionTemplates operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.ListSensitivityInspectionTemplates * @see AWS API Documentation */ @Override public CompletableFuture listSensitivityInspectionTemplates( ListSensitivityInspectionTemplatesRequest listSensitivityInspectionTemplatesRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listSensitivityInspectionTemplatesRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListSensitivityInspectionTemplates"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, ListSensitivityInspectionTemplatesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListSensitivityInspectionTemplates") .withMarshaller(new ListSensitivityInspectionTemplatesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listSensitivityInspectionTemplatesRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves a subset of information about the sensitivity inspection template for an account. *

*
*

* This is a variant of * {@link #listSensitivityInspectionTemplates(software.amazon.awssdk.services.macie2.model.ListSensitivityInspectionTemplatesRequest)} * 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.macie2.paginators.ListSensitivityInspectionTemplatesPublisher publisher = client.listSensitivityInspectionTemplatesPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.macie2.paginators.ListSensitivityInspectionTemplatesPublisher publisher = client.listSensitivityInspectionTemplatesPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.macie2.model.ListSensitivityInspectionTemplatesResponse 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 #listSensitivityInspectionTemplates(software.amazon.awssdk.services.macie2.model.ListSensitivityInspectionTemplatesRequest)} * operation. *

* * @param listSensitivityInspectionTemplatesRequest * @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. *
    *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.ListSensitivityInspectionTemplates * @see AWS API Documentation */ public ListSensitivityInspectionTemplatesPublisher listSensitivityInspectionTemplatesPaginator( ListSensitivityInspectionTemplatesRequest listSensitivityInspectionTemplatesRequest) { return new ListSensitivityInspectionTemplatesPublisher(this, applyPaginatorUserAgent(listSensitivityInspectionTemplatesRequest)); } /** *

* Retrieves the tags (keys and values) that are associated with an Amazon Macie 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. *
    *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.ListTagsForResource * @see AWS * API Documentation */ @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, "Macie2"); 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)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 or updates the configuration settings for storing data classification results. *

* * @param putClassificationExportConfigurationRequest * @return A Java Future containing the result of the PutClassificationExportConfiguration operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.PutClassificationExportConfiguration * @see AWS API Documentation */ @Override public CompletableFuture putClassificationExportConfiguration( PutClassificationExportConfigurationRequest putClassificationExportConfigurationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, putClassificationExportConfigurationRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutClassificationExportConfiguration"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, PutClassificationExportConfigurationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("PutClassificationExportConfiguration") .withMarshaller(new PutClassificationExportConfigurationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(putClassificationExportConfigurationRequest)); CompletableFuture whenCompleted = executeFuture .whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 configuration settings for publishing findings to Security Hub. *

* * @param putFindingsPublicationConfigurationRequest * @return A Java Future containing the result of the PutFindingsPublicationConfiguration operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.PutFindingsPublicationConfiguration * @see AWS API Documentation */ @Override public CompletableFuture putFindingsPublicationConfiguration( PutFindingsPublicationConfigurationRequest putFindingsPublicationConfigurationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, putFindingsPublicationConfigurationRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutFindingsPublicationConfiguration"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, PutFindingsPublicationConfigurationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("PutFindingsPublicationConfiguration") .withMarshaller(new PutFindingsPublicationConfigurationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(putFindingsPublicationConfigurationRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves (queries) statistical data and other information about Amazon Web Services resources that Amazon Macie * monitors and analyzes. *

* * @param searchResourcesRequest * @return A Java Future containing the result of the SearchResources operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.SearchResources * @see AWS API * Documentation */ @Override public CompletableFuture searchResources(SearchResourcesRequest searchResourcesRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, searchResourcesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "SearchResources"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, SearchResourcesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("SearchResources") .withMarshaller(new SearchResourcesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(searchResourcesRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves (queries) statistical data and other information about Amazon Web Services resources that Amazon Macie * monitors and analyzes. *

*
*

* This is a variant of * {@link #searchResources(software.amazon.awssdk.services.macie2.model.SearchResourcesRequest)} 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.macie2.paginators.SearchResourcesPublisher publisher = client.searchResourcesPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.macie2.paginators.SearchResourcesPublisher publisher = client.searchResourcesPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.macie2.model.SearchResourcesResponse 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 #searchResources(software.amazon.awssdk.services.macie2.model.SearchResourcesRequest)} operation. *

* * @param searchResourcesRequest * @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. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.SearchResources * @see AWS API * Documentation */ public SearchResourcesPublisher searchResourcesPaginator(SearchResourcesRequest searchResourcesRequest) { return new SearchResourcesPublisher(this, applyPaginatorUserAgent(searchResourcesRequest)); } /** *

* Adds or updates one or more tags (keys and values) that are associated with an Amazon Macie 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. *
    *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.TagResource * @see AWS API * Documentation */ @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, "Macie2"); 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)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 data identifier. *

* * @param testCustomDataIdentifierRequest * @return A Java Future containing the result of the TestCustomDataIdentifier operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.TestCustomDataIdentifier * @see AWS API Documentation */ @Override public CompletableFuture testCustomDataIdentifier( TestCustomDataIdentifierRequest testCustomDataIdentifierRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, testCustomDataIdentifierRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "TestCustomDataIdentifier"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, TestCustomDataIdentifierResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("TestCustomDataIdentifier") .withMarshaller(new TestCustomDataIdentifierRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(testCustomDataIdentifierRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 one or more tags (keys and values) from an Amazon Macie 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. *
    *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.UntagResource * @see AWS API * Documentation */ @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, "Macie2"); 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)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 settings for an allow list. *

* * @param updateAllowListRequest * @return A Java Future containing the result of the UpdateAllowList operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.UpdateAllowList * @see AWS API * Documentation */ @Override public CompletableFuture updateAllowList(UpdateAllowListRequest updateAllowListRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateAllowListRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateAllowList"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateAllowListResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateAllowList") .withMarshaller(new UpdateAllowListRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateAllowListRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 or disables automated sensitive data discovery for an account. *

* * @param updateAutomatedDiscoveryConfigurationRequest * @return A Java Future containing the result of the UpdateAutomatedDiscoveryConfiguration operation returned by * the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.UpdateAutomatedDiscoveryConfiguration * @see AWS API Documentation */ @Override public CompletableFuture updateAutomatedDiscoveryConfiguration( UpdateAutomatedDiscoveryConfigurationRequest updateAutomatedDiscoveryConfigurationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateAutomatedDiscoveryConfigurationRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateAutomatedDiscoveryConfiguration"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, UpdateAutomatedDiscoveryConfigurationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateAutomatedDiscoveryConfiguration") .withMarshaller(new UpdateAutomatedDiscoveryConfigurationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateAutomatedDiscoveryConfigurationRequest)); CompletableFuture whenCompleted = executeFuture .whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Changes the status of a classification job. *

* * @param updateClassificationJobRequest * @return A Java Future containing the result of the UpdateClassificationJob operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.UpdateClassificationJob * @see AWS API Documentation */ @Override public CompletableFuture updateClassificationJob( UpdateClassificationJobRequest updateClassificationJobRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateClassificationJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateClassificationJob"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateClassificationJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateClassificationJob") .withMarshaller(new UpdateClassificationJobRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateClassificationJobRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 classification scope settings for an account. *

* * @param updateClassificationScopeRequest * @return A Java Future containing the result of the UpdateClassificationScope operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.UpdateClassificationScope * @see AWS API Documentation */ @Override public CompletableFuture updateClassificationScope( UpdateClassificationScopeRequest updateClassificationScopeRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateClassificationScopeRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateClassificationScope"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateClassificationScopeResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateClassificationScope") .withMarshaller(new UpdateClassificationScopeRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateClassificationScopeRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 criteria and other settings for a findings filter. *

* * @param updateFindingsFilterRequest * @return A Java Future containing the result of the UpdateFindingsFilter operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.UpdateFindingsFilter * @see AWS * API Documentation */ @Override public CompletableFuture updateFindingsFilter( UpdateFindingsFilterRequest updateFindingsFilterRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateFindingsFilterRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateFindingsFilter"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateFindingsFilterResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateFindingsFilter") .withMarshaller(new UpdateFindingsFilterRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateFindingsFilterRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Suspends or re-enables Amazon Macie, or updates the configuration settings for a Macie account. *

* * @param updateMacieSessionRequest * @return A Java Future containing the result of the UpdateMacieSession operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.UpdateMacieSession * @see AWS API * Documentation */ @Override public CompletableFuture updateMacieSession(UpdateMacieSessionRequest updateMacieSessionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateMacieSessionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateMacieSession"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateMacieSessionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateMacieSession") .withMarshaller(new UpdateMacieSessionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateMacieSessionRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 an Amazon Macie administrator to suspend or re-enable Macie for a member account. *

* * @param updateMemberSessionRequest * @return A Java Future containing the result of the UpdateMemberSession operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.UpdateMemberSession * @see AWS * API Documentation */ @Override public CompletableFuture updateMemberSession( UpdateMemberSessionRequest updateMemberSessionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateMemberSessionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateMemberSession"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateMemberSessionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateMemberSession") .withMarshaller(new UpdateMemberSessionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateMemberSessionRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 Amazon Macie configuration settings for an organization in Organizations. *

* * @param updateOrganizationConfigurationRequest * @return A Java Future containing the result of the UpdateOrganizationConfiguration operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ConflictException The request failed because it conflicts with the current state of the specified * resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.UpdateOrganizationConfiguration * @see AWS API Documentation */ @Override public CompletableFuture updateOrganizationConfiguration( UpdateOrganizationConfigurationRequest updateOrganizationConfigurationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateOrganizationConfigurationRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateOrganizationConfiguration"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateOrganizationConfigurationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateOrganizationConfiguration") .withMarshaller(new UpdateOrganizationConfigurationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateOrganizationConfigurationRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 sensitivity score for an S3 bucket. *

* * @param updateResourceProfileRequest * @return A Java Future containing the result of the UpdateResourceProfile operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.UpdateResourceProfile * @see AWS * API Documentation */ @Override public CompletableFuture updateResourceProfile( UpdateResourceProfileRequest updateResourceProfileRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateResourceProfileRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateResourceProfile"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateResourceProfileResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateResourceProfile") .withMarshaller(new UpdateResourceProfileRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateResourceProfileRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 sensitivity scoring settings for an S3 bucket. *

* * @param updateResourceProfileDetectionsRequest * @return A Java Future containing the result of the UpdateResourceProfileDetections operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • ServiceQuotaExceededException The request failed because fulfilling the request would exceed one or * more service quotas for your account.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.UpdateResourceProfileDetections * @see AWS API Documentation */ @Override public CompletableFuture updateResourceProfileDetections( UpdateResourceProfileDetectionsRequest updateResourceProfileDetectionsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateResourceProfileDetectionsRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateResourceProfileDetections"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateResourceProfileDetectionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateResourceProfileDetections") .withMarshaller(new UpdateResourceProfileDetectionsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateResourceProfileDetectionsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 and configuration settings for retrieving occurrences of sensitive data reported by findings. *

* * @param updateRevealConfigurationRequest * @return A Java Future containing the result of the UpdateRevealConfiguration operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.UpdateRevealConfiguration * @see AWS API Documentation */ @Override public CompletableFuture updateRevealConfiguration( UpdateRevealConfigurationRequest updateRevealConfigurationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateRevealConfigurationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateRevealConfiguration"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateRevealConfigurationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateRevealConfiguration") .withMarshaller(new UpdateRevealConfigurationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateRevealConfigurationRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 settings for the sensitivity inspection template for an account. *

* * @param updateSensitivityInspectionTemplateRequest * @return A Java Future containing the result of the UpdateSensitivityInspectionTemplate operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The request failed because the specified resource wasn't found.
  • *
  • ThrottlingException The request failed because you sent too many requests during a certain amount of * time.
  • *
  • ValidationException The request failed because the input doesn't satisfy the constraints specified by * the service.
  • *
  • InternalServerException The request failed due to an unknown internal server error, exception, or * failure.
  • *
  • AccessDeniedException The request was denied because you don't have sufficient access to the * specified resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • Macie2Exception Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample Macie2AsyncClient.UpdateSensitivityInspectionTemplate * @see AWS API Documentation */ @Override public CompletableFuture updateSensitivityInspectionTemplate( UpdateSensitivityInspectionTemplateRequest updateSensitivityInspectionTemplateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateSensitivityInspectionTemplateRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Macie2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateSensitivityInspectionTemplate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, UpdateSensitivityInspectionTemplateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateSensitivityInspectionTemplate") .withMarshaller(new UpdateSensitivityInspectionTemplateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateSensitivityInspectionTemplateRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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(Macie2Exception::builder) .protocol(AwsJsonProtocol.REST_JSON) .protocolVersion("1.1") .registerModeledException( ExceptionMetadata.builder().errorCode("ServiceQuotaExceededException") .exceptionBuilderSupplier(ServiceQuotaExceededException::builder).httpStatusCode(402).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InternalServerException") .exceptionBuilderSupplier(InternalServerException::builder).httpStatusCode(500).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ResourceNotFoundException") .exceptionBuilderSupplier(ResourceNotFoundException::builder).httpStatusCode(404).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ValidationException") .exceptionBuilderSupplier(ValidationException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ThrottlingException") .exceptionBuilderSupplier(ThrottlingException::builder).httpStatusCode(429).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("AccessDeniedException") .exceptionBuilderSupplier(AccessDeniedException::builder).httpStatusCode(403).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ConflictException") .exceptionBuilderSupplier(ConflictException::builder).httpStatusCode(409).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("UnprocessableEntityException") .exceptionBuilderSupplier(UnprocessableEntityException::builder).httpStatusCode(422).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); } @Override public Macie2AsyncWaiter waiter() { return Macie2AsyncWaiter.builder().client(this).scheduledExecutorService(executorService).build(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy