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

software.amazon.awssdk.services.personalize.DefaultPersonalizeAsyncClient 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.personalize;

import java.util.Collections;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.awscore.client.handler.AwsAsyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.core.ApiName;
import software.amazon.awssdk.core.RequestOverrideConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.client.handler.AsyncClientHandler;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.metrics.CoreMetric;
import software.amazon.awssdk.core.util.VersionInfo;
import software.amazon.awssdk.metrics.MetricCollector;
import software.amazon.awssdk.metrics.MetricPublisher;
import software.amazon.awssdk.metrics.NoOpMetricCollector;
import software.amazon.awssdk.protocols.core.ExceptionMetadata;
import software.amazon.awssdk.protocols.json.AwsJsonProtocol;
import software.amazon.awssdk.protocols.json.AwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.JsonOperationMetadata;
import software.amazon.awssdk.services.personalize.model.CreateBatchInferenceJobRequest;
import software.amazon.awssdk.services.personalize.model.CreateBatchInferenceJobResponse;
import software.amazon.awssdk.services.personalize.model.CreateBatchSegmentJobRequest;
import software.amazon.awssdk.services.personalize.model.CreateBatchSegmentJobResponse;
import software.amazon.awssdk.services.personalize.model.CreateCampaignRequest;
import software.amazon.awssdk.services.personalize.model.CreateCampaignResponse;
import software.amazon.awssdk.services.personalize.model.CreateDatasetExportJobRequest;
import software.amazon.awssdk.services.personalize.model.CreateDatasetExportJobResponse;
import software.amazon.awssdk.services.personalize.model.CreateDatasetGroupRequest;
import software.amazon.awssdk.services.personalize.model.CreateDatasetGroupResponse;
import software.amazon.awssdk.services.personalize.model.CreateDatasetImportJobRequest;
import software.amazon.awssdk.services.personalize.model.CreateDatasetImportJobResponse;
import software.amazon.awssdk.services.personalize.model.CreateDatasetRequest;
import software.amazon.awssdk.services.personalize.model.CreateDatasetResponse;
import software.amazon.awssdk.services.personalize.model.CreateEventTrackerRequest;
import software.amazon.awssdk.services.personalize.model.CreateEventTrackerResponse;
import software.amazon.awssdk.services.personalize.model.CreateFilterRequest;
import software.amazon.awssdk.services.personalize.model.CreateFilterResponse;
import software.amazon.awssdk.services.personalize.model.CreateRecommenderRequest;
import software.amazon.awssdk.services.personalize.model.CreateRecommenderResponse;
import software.amazon.awssdk.services.personalize.model.CreateSchemaRequest;
import software.amazon.awssdk.services.personalize.model.CreateSchemaResponse;
import software.amazon.awssdk.services.personalize.model.CreateSolutionRequest;
import software.amazon.awssdk.services.personalize.model.CreateSolutionResponse;
import software.amazon.awssdk.services.personalize.model.CreateSolutionVersionRequest;
import software.amazon.awssdk.services.personalize.model.CreateSolutionVersionResponse;
import software.amazon.awssdk.services.personalize.model.DeleteCampaignRequest;
import software.amazon.awssdk.services.personalize.model.DeleteCampaignResponse;
import software.amazon.awssdk.services.personalize.model.DeleteDatasetGroupRequest;
import software.amazon.awssdk.services.personalize.model.DeleteDatasetGroupResponse;
import software.amazon.awssdk.services.personalize.model.DeleteDatasetRequest;
import software.amazon.awssdk.services.personalize.model.DeleteDatasetResponse;
import software.amazon.awssdk.services.personalize.model.DeleteEventTrackerRequest;
import software.amazon.awssdk.services.personalize.model.DeleteEventTrackerResponse;
import software.amazon.awssdk.services.personalize.model.DeleteFilterRequest;
import software.amazon.awssdk.services.personalize.model.DeleteFilterResponse;
import software.amazon.awssdk.services.personalize.model.DeleteRecommenderRequest;
import software.amazon.awssdk.services.personalize.model.DeleteRecommenderResponse;
import software.amazon.awssdk.services.personalize.model.DeleteSchemaRequest;
import software.amazon.awssdk.services.personalize.model.DeleteSchemaResponse;
import software.amazon.awssdk.services.personalize.model.DeleteSolutionRequest;
import software.amazon.awssdk.services.personalize.model.DeleteSolutionResponse;
import software.amazon.awssdk.services.personalize.model.DescribeAlgorithmRequest;
import software.amazon.awssdk.services.personalize.model.DescribeAlgorithmResponse;
import software.amazon.awssdk.services.personalize.model.DescribeBatchInferenceJobRequest;
import software.amazon.awssdk.services.personalize.model.DescribeBatchInferenceJobResponse;
import software.amazon.awssdk.services.personalize.model.DescribeBatchSegmentJobRequest;
import software.amazon.awssdk.services.personalize.model.DescribeBatchSegmentJobResponse;
import software.amazon.awssdk.services.personalize.model.DescribeCampaignRequest;
import software.amazon.awssdk.services.personalize.model.DescribeCampaignResponse;
import software.amazon.awssdk.services.personalize.model.DescribeDatasetExportJobRequest;
import software.amazon.awssdk.services.personalize.model.DescribeDatasetExportJobResponse;
import software.amazon.awssdk.services.personalize.model.DescribeDatasetGroupRequest;
import software.amazon.awssdk.services.personalize.model.DescribeDatasetGroupResponse;
import software.amazon.awssdk.services.personalize.model.DescribeDatasetImportJobRequest;
import software.amazon.awssdk.services.personalize.model.DescribeDatasetImportJobResponse;
import software.amazon.awssdk.services.personalize.model.DescribeDatasetRequest;
import software.amazon.awssdk.services.personalize.model.DescribeDatasetResponse;
import software.amazon.awssdk.services.personalize.model.DescribeEventTrackerRequest;
import software.amazon.awssdk.services.personalize.model.DescribeEventTrackerResponse;
import software.amazon.awssdk.services.personalize.model.DescribeFeatureTransformationRequest;
import software.amazon.awssdk.services.personalize.model.DescribeFeatureTransformationResponse;
import software.amazon.awssdk.services.personalize.model.DescribeFilterRequest;
import software.amazon.awssdk.services.personalize.model.DescribeFilterResponse;
import software.amazon.awssdk.services.personalize.model.DescribeRecipeRequest;
import software.amazon.awssdk.services.personalize.model.DescribeRecipeResponse;
import software.amazon.awssdk.services.personalize.model.DescribeRecommenderRequest;
import software.amazon.awssdk.services.personalize.model.DescribeRecommenderResponse;
import software.amazon.awssdk.services.personalize.model.DescribeSchemaRequest;
import software.amazon.awssdk.services.personalize.model.DescribeSchemaResponse;
import software.amazon.awssdk.services.personalize.model.DescribeSolutionRequest;
import software.amazon.awssdk.services.personalize.model.DescribeSolutionResponse;
import software.amazon.awssdk.services.personalize.model.DescribeSolutionVersionRequest;
import software.amazon.awssdk.services.personalize.model.DescribeSolutionVersionResponse;
import software.amazon.awssdk.services.personalize.model.GetSolutionMetricsRequest;
import software.amazon.awssdk.services.personalize.model.GetSolutionMetricsResponse;
import software.amazon.awssdk.services.personalize.model.InvalidInputException;
import software.amazon.awssdk.services.personalize.model.InvalidNextTokenException;
import software.amazon.awssdk.services.personalize.model.LimitExceededException;
import software.amazon.awssdk.services.personalize.model.ListBatchInferenceJobsRequest;
import software.amazon.awssdk.services.personalize.model.ListBatchInferenceJobsResponse;
import software.amazon.awssdk.services.personalize.model.ListBatchSegmentJobsRequest;
import software.amazon.awssdk.services.personalize.model.ListBatchSegmentJobsResponse;
import software.amazon.awssdk.services.personalize.model.ListCampaignsRequest;
import software.amazon.awssdk.services.personalize.model.ListCampaignsResponse;
import software.amazon.awssdk.services.personalize.model.ListDatasetExportJobsRequest;
import software.amazon.awssdk.services.personalize.model.ListDatasetExportJobsResponse;
import software.amazon.awssdk.services.personalize.model.ListDatasetGroupsRequest;
import software.amazon.awssdk.services.personalize.model.ListDatasetGroupsResponse;
import software.amazon.awssdk.services.personalize.model.ListDatasetImportJobsRequest;
import software.amazon.awssdk.services.personalize.model.ListDatasetImportJobsResponse;
import software.amazon.awssdk.services.personalize.model.ListDatasetsRequest;
import software.amazon.awssdk.services.personalize.model.ListDatasetsResponse;
import software.amazon.awssdk.services.personalize.model.ListEventTrackersRequest;
import software.amazon.awssdk.services.personalize.model.ListEventTrackersResponse;
import software.amazon.awssdk.services.personalize.model.ListFiltersRequest;
import software.amazon.awssdk.services.personalize.model.ListFiltersResponse;
import software.amazon.awssdk.services.personalize.model.ListRecipesRequest;
import software.amazon.awssdk.services.personalize.model.ListRecipesResponse;
import software.amazon.awssdk.services.personalize.model.ListRecommendersRequest;
import software.amazon.awssdk.services.personalize.model.ListRecommendersResponse;
import software.amazon.awssdk.services.personalize.model.ListSchemasRequest;
import software.amazon.awssdk.services.personalize.model.ListSchemasResponse;
import software.amazon.awssdk.services.personalize.model.ListSolutionVersionsRequest;
import software.amazon.awssdk.services.personalize.model.ListSolutionVersionsResponse;
import software.amazon.awssdk.services.personalize.model.ListSolutionsRequest;
import software.amazon.awssdk.services.personalize.model.ListSolutionsResponse;
import software.amazon.awssdk.services.personalize.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.personalize.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.personalize.model.PersonalizeException;
import software.amazon.awssdk.services.personalize.model.PersonalizeRequest;
import software.amazon.awssdk.services.personalize.model.ResourceAlreadyExistsException;
import software.amazon.awssdk.services.personalize.model.ResourceInUseException;
import software.amazon.awssdk.services.personalize.model.ResourceNotFoundException;
import software.amazon.awssdk.services.personalize.model.StartRecommenderRequest;
import software.amazon.awssdk.services.personalize.model.StartRecommenderResponse;
import software.amazon.awssdk.services.personalize.model.StopRecommenderRequest;
import software.amazon.awssdk.services.personalize.model.StopRecommenderResponse;
import software.amazon.awssdk.services.personalize.model.StopSolutionVersionCreationRequest;
import software.amazon.awssdk.services.personalize.model.StopSolutionVersionCreationResponse;
import software.amazon.awssdk.services.personalize.model.TagResourceRequest;
import software.amazon.awssdk.services.personalize.model.TagResourceResponse;
import software.amazon.awssdk.services.personalize.model.TooManyTagKeysException;
import software.amazon.awssdk.services.personalize.model.TooManyTagsException;
import software.amazon.awssdk.services.personalize.model.UntagResourceRequest;
import software.amazon.awssdk.services.personalize.model.UntagResourceResponse;
import software.amazon.awssdk.services.personalize.model.UpdateCampaignRequest;
import software.amazon.awssdk.services.personalize.model.UpdateCampaignResponse;
import software.amazon.awssdk.services.personalize.model.UpdateRecommenderRequest;
import software.amazon.awssdk.services.personalize.model.UpdateRecommenderResponse;
import software.amazon.awssdk.services.personalize.paginators.ListBatchInferenceJobsPublisher;
import software.amazon.awssdk.services.personalize.paginators.ListBatchSegmentJobsPublisher;
import software.amazon.awssdk.services.personalize.paginators.ListCampaignsPublisher;
import software.amazon.awssdk.services.personalize.paginators.ListDatasetExportJobsPublisher;
import software.amazon.awssdk.services.personalize.paginators.ListDatasetGroupsPublisher;
import software.amazon.awssdk.services.personalize.paginators.ListDatasetImportJobsPublisher;
import software.amazon.awssdk.services.personalize.paginators.ListDatasetsPublisher;
import software.amazon.awssdk.services.personalize.paginators.ListEventTrackersPublisher;
import software.amazon.awssdk.services.personalize.paginators.ListFiltersPublisher;
import software.amazon.awssdk.services.personalize.paginators.ListRecipesPublisher;
import software.amazon.awssdk.services.personalize.paginators.ListRecommendersPublisher;
import software.amazon.awssdk.services.personalize.paginators.ListSchemasPublisher;
import software.amazon.awssdk.services.personalize.paginators.ListSolutionVersionsPublisher;
import software.amazon.awssdk.services.personalize.paginators.ListSolutionsPublisher;
import software.amazon.awssdk.services.personalize.transform.CreateBatchInferenceJobRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.CreateBatchSegmentJobRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.CreateCampaignRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.CreateDatasetExportJobRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.CreateDatasetGroupRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.CreateDatasetImportJobRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.CreateDatasetRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.CreateEventTrackerRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.CreateFilterRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.CreateRecommenderRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.CreateSchemaRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.CreateSolutionRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.CreateSolutionVersionRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.DeleteCampaignRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.DeleteDatasetGroupRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.DeleteDatasetRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.DeleteEventTrackerRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.DeleteFilterRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.DeleteRecommenderRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.DeleteSchemaRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.DeleteSolutionRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.DescribeAlgorithmRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.DescribeBatchInferenceJobRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.DescribeBatchSegmentJobRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.DescribeCampaignRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.DescribeDatasetExportJobRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.DescribeDatasetGroupRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.DescribeDatasetImportJobRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.DescribeDatasetRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.DescribeEventTrackerRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.DescribeFeatureTransformationRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.DescribeFilterRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.DescribeRecipeRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.DescribeRecommenderRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.DescribeSchemaRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.DescribeSolutionRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.DescribeSolutionVersionRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.GetSolutionMetricsRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.ListBatchInferenceJobsRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.ListBatchSegmentJobsRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.ListCampaignsRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.ListDatasetExportJobsRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.ListDatasetGroupsRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.ListDatasetImportJobsRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.ListDatasetsRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.ListEventTrackersRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.ListFiltersRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.ListRecipesRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.ListRecommendersRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.ListSchemasRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.ListSolutionVersionsRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.ListSolutionsRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.StartRecommenderRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.StopRecommenderRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.StopSolutionVersionCreationRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.UpdateCampaignRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.UpdateRecommenderRequestMarshaller;
import software.amazon.awssdk.utils.CompletableFutureUtils;

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

    private final AsyncClientHandler clientHandler;

    private final AwsJsonProtocolFactory protocolFactory;

    private final SdkClientConfiguration clientConfiguration;

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

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

    /**
     * 

* Creates a batch inference job. The operation can handle up to 50 million records and the input file must be in * JSON format. For more information, see Creating a batch * inference job. *

* * @param createBatchInferenceJobRequest * @return A Java Future containing the result of the CreateBatchInferenceJob operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceAlreadyExistsException The specified resource already exists.
  • *
  • LimitExceededException The limit on the number of requests per second has been exceeded.
  • *
  • ResourceNotFoundException Could not find the specified resource.
  • *
  • ResourceInUseException The specified resource is in use.
  • *
  • TooManyTagsException You have exceeded the maximum number of tags you can apply to this 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.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.CreateBatchInferenceJob * @see AWS API Documentation */ @Override public CompletableFuture createBatchInferenceJob( CreateBatchInferenceJobRequest createBatchInferenceJobRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createBatchInferenceJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateBatchInferenceJob"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateBatchInferenceJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateBatchInferenceJob") .withMarshaller(new CreateBatchInferenceJobRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createBatchInferenceJobRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a batch segment job. The operation can handle up to 50 million records and the input file must be in JSON * format. For more information, see Getting batch recommendations * and user segments. *

* * @param createBatchSegmentJobRequest * @return A Java Future containing the result of the CreateBatchSegmentJob operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceAlreadyExistsException The specified resource already exists.
  • *
  • LimitExceededException The limit on the number of requests per second has been exceeded.
  • *
  • ResourceNotFoundException Could not find the specified resource.
  • *
  • ResourceInUseException The specified resource is in use.
  • *
  • TooManyTagsException You have exceeded the maximum number of tags you can apply to this 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.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.CreateBatchSegmentJob * @see AWS API Documentation */ @Override public CompletableFuture createBatchSegmentJob( CreateBatchSegmentJobRequest createBatchSegmentJobRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createBatchSegmentJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateBatchSegmentJob"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateBatchSegmentJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateBatchSegmentJob") .withMarshaller(new CreateBatchSegmentJobRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createBatchSegmentJobRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a campaign that deploys a solution version. When a client calls the GetRecommendations * and * GetPersonalizedRanking APIs, a campaign is specified in the request. *

*

* Minimum Provisioned TPS and Auto-Scaling *

*

* A transaction is a single GetRecommendations or GetPersonalizedRanking call. * Transactions per second (TPS) is the throughput and unit of billing for Amazon Personalize. The minimum * provisioned TPS (minProvisionedTPS) specifies the baseline throughput provisioned by Amazon * Personalize, and thus, the minimum billing charge. *

*

* If your TPS increases beyond minProvisionedTPS, Amazon Personalize auto-scales the provisioned * capacity up and down, but never below minProvisionedTPS. There's a short time delay while the * capacity is increased that might cause loss of transactions. *

*

* The actual TPS used is calculated as the average requests/second within a 5-minute window. You pay for maximum of * either the minimum provisioned TPS or the actual TPS. We recommend starting with a low * minProvisionedTPS, track your usage using Amazon CloudWatch metrics, and then increase the * minProvisionedTPS as necessary. *

*

* Status *

*

* A campaign can be in one of the following states: *

*
    *
  • *

    * CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED *

    *
  • *
  • *

    * DELETE PENDING > DELETE IN_PROGRESS *

    *
  • *
*

* To get the campaign status, call DescribeCampaign. *

* *

* Wait until the status of the campaign is ACTIVE before asking the campaign for * recommendations. *

*
*

* Related APIs *

* * * @param createCampaignRequest * @return A Java Future containing the result of the CreateCampaign operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find the specified resource.
  • *
  • ResourceAlreadyExistsException The specified resource already exists.
  • *
  • LimitExceededException The limit on the number of requests per second has been exceeded.
  • *
  • ResourceInUseException The specified resource is in use.
  • *
  • TooManyTagsException You have exceeded the maximum number of tags you can apply to this 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.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.CreateCampaign * @see AWS * API Documentation */ @Override public CompletableFuture createCampaign(CreateCampaignRequest createCampaignRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createCampaignRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateCampaign"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateCampaignResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateCampaign") .withMarshaller(new CreateCampaignRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createCampaignRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates an empty dataset and adds it to the specified dataset group. Use CreateDatasetImportJob to import your training data to a dataset. *

*

* There are three types of datasets: *

*
    *
  • *

    * Interactions *

    *
  • *
  • *

    * Items *

    *
  • *
  • *

    * Users *

    *
  • *
*

* Each dataset type has an associated schema with required field types. Only the Interactions dataset * is required in order to train a model (also referred to as creating a solution). *

*

* A dataset can be in one of the following states: *

*
    *
  • *

    * CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED *

    *
  • *
  • *

    * DELETE PENDING > DELETE IN_PROGRESS *

    *
  • *
*

* To get the status of the dataset, call DescribeDataset. *

*

* Related APIs *

* * * @param createDatasetRequest * @return A Java Future containing the result of the CreateDataset operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find the specified resource.
  • *
  • ResourceAlreadyExistsException The specified resource already exists.
  • *
  • LimitExceededException The limit on the number of requests per second has been exceeded.
  • *
  • ResourceInUseException The specified resource is in use.
  • *
  • TooManyTagsException You have exceeded the maximum number of tags you can apply to this 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.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.CreateDataset * @see AWS API * Documentation */ @Override public CompletableFuture createDataset(CreateDatasetRequest createDatasetRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createDatasetRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateDataset"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateDatasetResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateDataset") .withMarshaller(new CreateDatasetRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createDatasetRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a job that exports data from your dataset to an Amazon S3 bucket. To allow Amazon Personalize to export * the training data, you must specify an service-linked IAM role that gives Amazon Personalize * PutObject permissions for your Amazon S3 bucket. For information, see Exporting a dataset in the Amazon * Personalize developer guide. *

*

* Status *

*

* A dataset export job can be in one of the following states: *

*
    *
  • *

    * CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED *

    *
  • *
*

* To get the status of the export job, call DescribeDatasetExportJob, and specify the Amazon Resource Name (ARN) of the dataset export job. The dataset * export is complete when the status shows as ACTIVE. If the status shows as CREATE FAILED, the response includes a * failureReason key, which describes why the job failed. *

* * @param createDatasetExportJobRequest * @return A Java Future containing the result of the CreateDatasetExportJob operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find the specified resource.
  • *
  • ResourceAlreadyExistsException The specified resource already exists.
  • *
  • LimitExceededException The limit on the number of requests per second has been exceeded.
  • *
  • ResourceInUseException The specified resource is in use.
  • *
  • TooManyTagsException You have exceeded the maximum number of tags you can apply to this 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.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.CreateDatasetExportJob * @see AWS API Documentation */ @Override public CompletableFuture createDatasetExportJob( CreateDatasetExportJobRequest createDatasetExportJobRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createDatasetExportJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateDatasetExportJob"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateDatasetExportJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateDatasetExportJob") .withMarshaller(new CreateDatasetExportJobRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createDatasetExportJobRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates an empty dataset group. A dataset group is a container for Amazon Personalize resources. A dataset group * can contain at most three datasets, one for each type of dataset: *

*
    *
  • *

    * Interactions *

    *
  • *
  • *

    * Items *

    *
  • *
  • *

    * Users *

    *
  • *
*

* A dataset group can be a Domain dataset group, where you specify a domain and use pre-configured resources like * recommenders, or a Custom dataset group, where you use custom resources, such as a solution with a solution * version, that you deploy with a campaign. If you start with a Domain dataset group, you can still add custom * resources such as solutions and solution versions trained with recipes for custom use cases and deployed with * campaigns. *

*

* A dataset group can be in one of the following states: *

*
    *
  • *

    * CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED *

    *
  • *
  • *

    * DELETE PENDING *

    *
  • *
*

* To get the status of the dataset group, call DescribeDatasetGroup. * If the status shows as CREATE FAILED, the response includes a failureReason key, which describes why * the creation failed. *

* *

* You must wait until the status of the dataset group is ACTIVE before adding a dataset * to the group. *

*
*

* You can specify an Key Management Service (KMS) key to encrypt the datasets in the group. If you specify a KMS * key, you must also include an Identity and Access Management (IAM) role that has permission to access the key. *

*

* APIs that require a dataset group ARN in the request *

* *

* Related APIs *

* * * @param createDatasetGroupRequest * @return A Java Future containing the result of the CreateDatasetGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceAlreadyExistsException The specified resource already exists.
  • *
  • LimitExceededException The limit on the number of requests per second has been exceeded.
  • *
  • TooManyTagsException You have exceeded the maximum number of tags you can apply to this 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.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.CreateDatasetGroup * @see AWS API Documentation */ @Override public CompletableFuture createDatasetGroup(CreateDatasetGroupRequest createDatasetGroupRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createDatasetGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateDatasetGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateDatasetGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateDatasetGroup") .withMarshaller(new CreateDatasetGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createDatasetGroupRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a job that imports training data from your data source (an Amazon S3 bucket) to an Amazon Personalize * dataset. To allow Amazon Personalize to ACTIVE -or- CREATE FAILED *

* *

* To get the status of the import job, call DescribeDatasetImportJob, providing the Amazon Resource Name (ARN) of the dataset import job. The dataset * import is complete when the status shows as ACTIVE. If the status shows as CREATE FAILED, the response includes a * failureReason key, which describes why the job failed. *

* *

* Importing takes time. You must wait until the status shows as ACTIVE before training a model using the dataset. *

*
*

* Related APIs *

* * * @param createDatasetImportJobRequest * @return A Java Future containing the result of the CreateDatasetImportJob operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find the specified resource.
  • *
  • ResourceAlreadyExistsException The specified resource already exists.
  • *
  • LimitExceededException The limit on the number of requests per second has been exceeded.
  • *
  • ResourceInUseException The specified resource is in use.
  • *
  • TooManyTagsException You have exceeded the maximum number of tags you can apply to this 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.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.CreateDatasetImportJob * @see AWS API Documentation */ @Override public CompletableFuture createDatasetImportJob( CreateDatasetImportJobRequest createDatasetImportJobRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createDatasetImportJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateDatasetImportJob"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateDatasetImportJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateDatasetImportJob") .withMarshaller(new CreateDatasetImportJobRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createDatasetImportJobRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates an event tracker that you use when adding event data to a specified dataset group using the PutEvents API. *

* *

* Only one event tracker can be associated with a dataset group. You will get an error if you call * CreateEventTracker using the same dataset group as an existing event tracker. *

*
*

* When you create an event tracker, the response includes a tracking ID, which you pass as a parameter when you use * the PutEvents operation. * Amazon Personalize then appends the event data to the Interactions dataset of the dataset group you specify in * your event tracker. *

*

* The event tracker can be in one of the following states: *

*
    *
  • *

    * CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED *

    *
  • *
  • *

    * DELETE PENDING > DELETE IN_PROGRESS *

    *
  • *
*

* To get the status of the event tracker, call DescribeEventTracker. *

* *

* The event tracker must be in the ACTIVE state before using the tracking ID. *

*
*

* Related APIs *

* * * @param createEventTrackerRequest * @return A Java Future containing the result of the CreateEventTracker operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceAlreadyExistsException The specified resource already exists.
  • *
  • ResourceNotFoundException Could not find the specified resource.
  • *
  • LimitExceededException The limit on the number of requests per second has been exceeded.
  • *
  • ResourceInUseException The specified resource is in use.
  • *
  • TooManyTagsException You have exceeded the maximum number of tags you can apply to this 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.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.CreateEventTracker * @see AWS API Documentation */ @Override public CompletableFuture createEventTracker(CreateEventTrackerRequest createEventTrackerRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createEventTrackerRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateEventTracker"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateEventTrackerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateEventTracker") .withMarshaller(new CreateEventTrackerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createEventTrackerRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a recommendation filter. For more information, see Filtering recommendations and user * segments. *

* * @param createFilterRequest * @return A Java Future containing the result of the CreateFilter operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceAlreadyExistsException The specified resource already exists.
  • *
  • ResourceNotFoundException Could not find the specified resource.
  • *
  • LimitExceededException The limit on the number of requests per second has been exceeded.
  • *
  • TooManyTagsException You have exceeded the maximum number of tags you can apply to this 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.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.CreateFilter * @see AWS API * Documentation */ @Override public CompletableFuture createFilter(CreateFilterRequest createFilterRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createFilterRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateFilter"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateFilterResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateFilter").withMarshaller(new CreateFilterRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createFilterRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a recommender with the recipe (a Domain dataset group use case) you specify. You create recommenders for * a Domain dataset group and specify the recommender's Amazon Resource Name (ARN) when you make a GetRecommendations * request. *

*

* Minimum recommendation requests per second *

*

* When you create a recommender, you can configure the recommender's minimum recommendation requests per second. * The minimum recommendation requests per second (minRecommendationRequestsPerSecond) specifies the * baseline recommendation request throughput provisioned by Amazon Personalize. The default * minRecommendationRequestsPerSecond is 1. A recommendation request is a single * GetRecommendations operation. Request throughput is measured in requests per second and Amazon * Personalize uses your requests per second to derive your requests per hour and the price of your recommender * usage. *

*

* If your requests per second increases beyond minRecommendationRequestsPerSecond, Amazon Personalize * auto-scales the provisioned capacity up and down, but never below minRecommendationRequestsPerSecond * . There's a short time delay while the capacity is increased that might cause loss of requests. *

*

* Your bill is the greater of either the minimum requests per hour (based on minRecommendationRequestsPerSecond) or * the actual number of requests. The actual request throughput used is calculated as the average requests/second * within a one-hour window. We recommend starting with the default minRecommendationRequestsPerSecond, * track your usage using Amazon CloudWatch metrics, and then increase the * minRecommendationRequestsPerSecond as necessary. *

*

* Status *

*

* A recommender can be in one of the following states: *

*
    *
  • *

    * CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED *

    *
  • *
  • *

    * STOP PENDING > STOP IN_PROGRESS > INACTIVE > START PENDING > START IN_PROGRESS > ACTIVE *

    *
  • *
  • *

    * DELETE PENDING > DELETE IN_PROGRESS *

    *
  • *
*

* To get the recommender status, call DescribeRecommender. *

* *

* Wait until the status of the recommender is ACTIVE before asking the recommender for * recommendations. *

*
*

* Related APIs *

* * * @param createRecommenderRequest * @return A Java Future containing the result of the CreateRecommender operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceAlreadyExistsException The specified resource already exists.
  • *
  • ResourceNotFoundException Could not find the specified resource.
  • *
  • LimitExceededException The limit on the number of requests per second has been exceeded.
  • *
  • ResourceInUseException The specified resource is in use.
  • *
  • TooManyTagsException You have exceeded the maximum number of tags you can apply to this 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.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.CreateRecommender * @see AWS * API Documentation */ @Override public CompletableFuture createRecommender(CreateRecommenderRequest createRecommenderRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createRecommenderRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateRecommender"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateRecommenderResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateRecommender") .withMarshaller(new CreateRecommenderRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createRecommenderRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates an Amazon Personalize schema from the specified schema string. The schema you create must be in Avro JSON * format. *

*

* Amazon Personalize recognizes three schema variants. Each schema is associated with a dataset type and has a set * of required field and keywords. If you are creating a schema for a dataset in a Domain dataset group, you provide * the domain of the Domain dataset group. You specify a schema when you call CreateDataset. *

*

* Related APIs *

* * * @param createSchemaRequest * @return A Java Future containing the result of the CreateSchema operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceAlreadyExistsException The specified resource already exists.
  • *
  • LimitExceededException The limit on the number of requests per second has been exceeded.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.CreateSchema * @see AWS API * Documentation */ @Override public CompletableFuture createSchema(CreateSchemaRequest createSchemaRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createSchemaRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateSchema"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateSchemaResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateSchema").withMarshaller(new CreateSchemaRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createSchemaRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 the configuration for training a model. A trained model is known as a solution. After the configuration * is created, you train the model (create a solution) by calling the CreateSolutionVersion * operation. Every time you call CreateSolutionVersion, a new version of the solution is created. *

*

* After creating a solution version, you check its accuracy by calling GetSolutionMetrics. When * you are satisfied with the version, you deploy it using CreateCampaign. The campaign * provides recommendations to a client through the GetRecommendations * API. *

*

* To train a model, Amazon Personalize requires training data and a recipe. The training data comes from the * dataset group that you provide in the request. A recipe specifies the training algorithm and a feature * transformation. You can specify one of the predefined recipes provided by Amazon Personalize. Alternatively, you * can specify performAutoML and Amazon Personalize will analyze your data and select the optimum * USER_PERSONALIZATION recipe for you. *

* *

* Amazon Personalize doesn't support configuring the hpoObjective for solution hyperparameter * optimization at this time. *

*
*

* Status *

*

* A solution can be in one of the following states: *

*
    *
  • *

    * CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED *

    *
  • *
  • *

    * DELETE PENDING > DELETE IN_PROGRESS *

    *
  • *
*

* To get the status of the solution, call DescribeSolution. Wait * until the status shows as ACTIVE before calling CreateSolutionVersion. *

*

* Related APIs *

* * * * @param createSolutionRequest * @return A Java Future containing the result of the CreateSolution operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceAlreadyExistsException The specified resource already exists.
  • *
  • ResourceNotFoundException Could not find the specified resource.
  • *
  • LimitExceededException The limit on the number of requests per second has been exceeded.
  • *
  • ResourceInUseException The specified resource is in use.
  • *
  • TooManyTagsException You have exceeded the maximum number of tags you can apply to this 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.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.CreateSolution * @see AWS * API Documentation */ @Override public CompletableFuture createSolution(CreateSolutionRequest createSolutionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createSolutionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateSolution"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateSolutionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateSolution") .withMarshaller(new CreateSolutionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createSolutionRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Trains or retrains an active solution in a Custom dataset group. A solution is created using the CreateSolution operation and * must be in the ACTIVE state before calling CreateSolutionVersion. A new version of the solution is * created every time you call this operation. *

*

* Status *

*

* A solution version can be in one of the following states: *

*
    *
  • *

    * CREATE PENDING *

    *
  • *
  • *

    * CREATE IN_PROGRESS *

    *
  • *
  • *

    * ACTIVE *

    *
  • *
  • *

    * CREATE FAILED *

    *
  • *
  • *

    * CREATE STOPPING *

    *
  • *
  • *

    * CREATE STOPPED *

    *
  • *
*

* To get the status of the version, call DescribeSolutionVersion. Wait until the status shows as ACTIVE before calling CreateCampaign. *

*

* If the status shows as CREATE FAILED, the response includes a failureReason key, which describes why * the job failed. *

*

* Related APIs *

* * * @param createSolutionVersionRequest * @return A Java Future containing the result of the CreateSolutionVersion operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find the specified resource.
  • *
  • LimitExceededException The limit on the number of requests per second has been exceeded.
  • *
  • ResourceInUseException The specified resource is in use.
  • *
  • TooManyTagsException You have exceeded the maximum number of tags you can apply to this 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.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.CreateSolutionVersion * @see AWS API Documentation */ @Override public CompletableFuture createSolutionVersion( CreateSolutionVersionRequest createSolutionVersionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createSolutionVersionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateSolutionVersion"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateSolutionVersionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateSolutionVersion") .withMarshaller(new CreateSolutionVersionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createSolutionVersionRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 a campaign by deleting the solution deployment. The solution that the campaign is based on is not deleted * and can be redeployed when needed. A deleted campaign can no longer be specified in a GetRecommendations * request. For information on creating campaigns, see CreateCampaign. *

* * @param deleteCampaignRequest * @return A Java Future containing the result of the DeleteCampaign operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find the specified resource.
  • *
  • ResourceInUseException The specified resource is in use.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.DeleteCampaign * @see AWS * API Documentation */ @Override public CompletableFuture deleteCampaign(DeleteCampaignRequest deleteCampaignRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteCampaignRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteCampaign"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteCampaignResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteCampaign") .withMarshaller(new DeleteCampaignRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteCampaignRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 dataset. You can't delete a dataset if an associated DatasetImportJob or * SolutionVersion is in the CREATE PENDING or IN PROGRESS state. For more information on datasets, see * CreateDataset. *

* * @param deleteDatasetRequest * @return A Java Future containing the result of the DeleteDataset operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find the specified resource.
  • *
  • ResourceInUseException The specified resource is in use.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.DeleteDataset * @see AWS API * Documentation */ @Override public CompletableFuture deleteDataset(DeleteDatasetRequest deleteDatasetRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteDatasetRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteDataset"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteDatasetResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteDataset") .withMarshaller(new DeleteDatasetRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteDatasetRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 dataset group. Before you delete a dataset group, you must delete the following: *

*
    *
  • *

    * All associated event trackers. *

    *
  • *
  • *

    * All associated solutions. *

    *
  • *
  • *

    * All datasets in the dataset group. *

    *
  • *
* * @param deleteDatasetGroupRequest * @return A Java Future containing the result of the DeleteDatasetGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find the specified resource.
  • *
  • ResourceInUseException The specified resource is in use.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.DeleteDatasetGroup * @see AWS API Documentation */ @Override public CompletableFuture deleteDatasetGroup(DeleteDatasetGroupRequest deleteDatasetGroupRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteDatasetGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteDatasetGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteDatasetGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteDatasetGroup") .withMarshaller(new DeleteDatasetGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteDatasetGroupRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 event tracker. Does not delete the event-interactions dataset from the associated dataset group. For * more information on event trackers, see CreateEventTracker. *

* * @param deleteEventTrackerRequest * @return A Java Future containing the result of the DeleteEventTracker operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find the specified resource.
  • *
  • ResourceInUseException The specified resource is in use.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.DeleteEventTracker * @see AWS API Documentation */ @Override public CompletableFuture deleteEventTracker(DeleteEventTrackerRequest deleteEventTrackerRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteEventTrackerRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteEventTracker"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteEventTrackerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteEventTracker") .withMarshaller(new DeleteEventTrackerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteEventTrackerRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 filter. *

* * @param deleteFilterRequest * @return A Java Future containing the result of the DeleteFilter operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find the specified resource.
  • *
  • ResourceInUseException The specified resource is in use.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.DeleteFilter * @see AWS API * Documentation */ @Override public CompletableFuture deleteFilter(DeleteFilterRequest deleteFilterRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteFilterRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteFilter"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteFilterResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteFilter").withMarshaller(new DeleteFilterRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteFilterRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deactivates and removes a recommender. A deleted recommender can no longer be specified in a GetRecommendations * request. *

* * @param deleteRecommenderRequest * @return A Java Future containing the result of the DeleteRecommender operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find the specified resource.
  • *
  • ResourceInUseException The specified resource is in use.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.DeleteRecommender * @see AWS * API Documentation */ @Override public CompletableFuture deleteRecommender(DeleteRecommenderRequest deleteRecommenderRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteRecommenderRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteRecommender"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteRecommenderResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteRecommender") .withMarshaller(new DeleteRecommenderRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteRecommenderRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 schema. Before deleting a schema, you must delete all datasets referencing the schema. For more * information on schemas, see CreateSchema. *

* * @param deleteSchemaRequest * @return A Java Future containing the result of the DeleteSchema operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find the specified resource.
  • *
  • ResourceInUseException The specified resource is in use.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.DeleteSchema * @see AWS API * Documentation */ @Override public CompletableFuture deleteSchema(DeleteSchemaRequest deleteSchemaRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteSchemaRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteSchema"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteSchemaResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteSchema").withMarshaller(new DeleteSchemaRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteSchemaRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 all versions of a solution and the Solution object itself. Before deleting a solution, you * must delete all campaigns based on the solution. To determine what campaigns are using the solution, call ListCampaigns and supply the * Amazon Resource Name (ARN) of the solution. You can't delete a solution if an associated * SolutionVersion is in the CREATE PENDING or IN PROGRESS state. For more information on solutions, * see CreateSolution. *

* * @param deleteSolutionRequest * @return A Java Future containing the result of the DeleteSolution operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find the specified resource.
  • *
  • ResourceInUseException The specified resource is in use.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.DeleteSolution * @see AWS * API Documentation */ @Override public CompletableFuture deleteSolution(DeleteSolutionRequest deleteSolutionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteSolutionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteSolution"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteSolutionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteSolution") .withMarshaller(new DeleteSolutionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteSolutionRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes the given algorithm. *

* * @param describeAlgorithmRequest * @return A Java Future containing the result of the DescribeAlgorithm operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find 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.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.DescribeAlgorithm * @see AWS * API Documentation */ @Override public CompletableFuture describeAlgorithm(DescribeAlgorithmRequest describeAlgorithmRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeAlgorithmRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeAlgorithm"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeAlgorithmResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeAlgorithm") .withMarshaller(new DescribeAlgorithmRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeAlgorithmRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets the properties of a batch inference job including name, Amazon Resource Name (ARN), status, input and output * configurations, and the ARN of the solution version used to generate the recommendations. *

* * @param describeBatchInferenceJobRequest * @return A Java Future containing the result of the DescribeBatchInferenceJob operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find 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.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.DescribeBatchInferenceJob * @see AWS API Documentation */ @Override public CompletableFuture describeBatchInferenceJob( DescribeBatchInferenceJobRequest describeBatchInferenceJobRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeBatchInferenceJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeBatchInferenceJob"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeBatchInferenceJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeBatchInferenceJob") .withMarshaller(new DescribeBatchInferenceJobRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeBatchInferenceJobRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets the properties of a batch segment job including name, Amazon Resource Name (ARN), status, input and output * configurations, and the ARN of the solution version used to generate segments. *

* * @param describeBatchSegmentJobRequest * @return A Java Future containing the result of the DescribeBatchSegmentJob operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find 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.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.DescribeBatchSegmentJob * @see AWS API Documentation */ @Override public CompletableFuture describeBatchSegmentJob( DescribeBatchSegmentJobRequest describeBatchSegmentJobRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeBatchSegmentJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeBatchSegmentJob"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeBatchSegmentJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeBatchSegmentJob") .withMarshaller(new DescribeBatchSegmentJobRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeBatchSegmentJobRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes the given campaign, including its status. *

*

* A campaign can be in one of the following states: *

*
    *
  • *

    * CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED *

    *
  • *
  • *

    * DELETE PENDING > DELETE IN_PROGRESS *

    *
  • *
*

* When the status is CREATE FAILED, the response includes the failureReason * key, which describes why. *

*

* For more information on campaigns, see CreateCampaign. *

* * @param describeCampaignRequest * @return A Java Future containing the result of the DescribeCampaign operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find 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.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.DescribeCampaign * @see AWS * API Documentation */ @Override public CompletableFuture describeCampaign(DescribeCampaignRequest describeCampaignRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeCampaignRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeCampaign"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeCampaignResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeCampaign") .withMarshaller(new DescribeCampaignRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeCampaignRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes the given dataset. For more information on datasets, see CreateDataset. *

* * @param describeDatasetRequest * @return A Java Future containing the result of the DescribeDataset operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find 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.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.DescribeDataset * @see AWS * API Documentation */ @Override public CompletableFuture describeDataset(DescribeDatasetRequest describeDatasetRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeDatasetRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeDataset"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeDatasetResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeDataset") .withMarshaller(new DescribeDatasetRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeDatasetRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes the dataset export job created by CreateDatasetExportJob, including the export job status. *

* * @param describeDatasetExportJobRequest * @return A Java Future containing the result of the DescribeDatasetExportJob operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find 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.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.DescribeDatasetExportJob * @see AWS API Documentation */ @Override public CompletableFuture describeDatasetExportJob( DescribeDatasetExportJobRequest describeDatasetExportJobRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeDatasetExportJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeDatasetExportJob"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeDatasetExportJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeDatasetExportJob") .withMarshaller(new DescribeDatasetExportJobRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeDatasetExportJobRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes the given dataset group. For more information on dataset groups, see CreateDatasetGroup. *

* * @param describeDatasetGroupRequest * @return A Java Future containing the result of the DescribeDatasetGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find 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.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.DescribeDatasetGroup * @see AWS API Documentation */ @Override public CompletableFuture describeDatasetGroup( DescribeDatasetGroupRequest describeDatasetGroupRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeDatasetGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeDatasetGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeDatasetGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeDatasetGroup") .withMarshaller(new DescribeDatasetGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeDatasetGroupRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes the dataset import job created by CreateDatasetImportJob, including the import job status. *

* * @param describeDatasetImportJobRequest * @return A Java Future containing the result of the DescribeDatasetImportJob operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find 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.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.DescribeDatasetImportJob * @see AWS API Documentation */ @Override public CompletableFuture describeDatasetImportJob( DescribeDatasetImportJobRequest describeDatasetImportJobRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeDatasetImportJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeDatasetImportJob"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeDatasetImportJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeDatasetImportJob") .withMarshaller(new DescribeDatasetImportJobRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeDatasetImportJobRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes an event tracker. The response includes the trackingId and status of the * event tracker. For more information on event trackers, see CreateEventTracker. *

* * @param describeEventTrackerRequest * @return A Java Future containing the result of the DescribeEventTracker operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find 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.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.DescribeEventTracker * @see AWS API Documentation */ @Override public CompletableFuture describeEventTracker( DescribeEventTrackerRequest describeEventTrackerRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeEventTrackerRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeEventTracker"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeEventTrackerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeEventTracker") .withMarshaller(new DescribeEventTrackerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeEventTrackerRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes the given feature transformation. *

* * @param describeFeatureTransformationRequest * @return A Java Future containing the result of the DescribeFeatureTransformation operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find 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.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.DescribeFeatureTransformation * @see AWS API Documentation */ @Override public CompletableFuture describeFeatureTransformation( DescribeFeatureTransformationRequest describeFeatureTransformationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeFeatureTransformationRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeFeatureTransformation"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeFeatureTransformationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeFeatureTransformation") .withMarshaller(new DescribeFeatureTransformationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeFeatureTransformationRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes a filter's properties. *

* * @param describeFilterRequest * @return A Java Future containing the result of the DescribeFilter operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find 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.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.DescribeFilter * @see AWS * API Documentation */ @Override public CompletableFuture describeFilter(DescribeFilterRequest describeFilterRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeFilterRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeFilter"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeFilterResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeFilter") .withMarshaller(new DescribeFilterRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeFilterRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes a recipe. *

*

* A recipe contains three items: *

*
    *
  • *

    * An algorithm that trains a model. *

    *
  • *
  • *

    * Hyperparameters that govern the training. *

    *
  • *
  • *

    * Feature transformation information for modifying the input data before training. *

    *
  • *
*

* Amazon Personalize provides a set of predefined recipes. You specify a recipe when you create a solution with the * CreateSolution API. * CreateSolution trains a model by using the algorithm in the specified recipe and a training dataset. * The solution, when deployed as a campaign, can provide recommendations using the GetRecommendations * API. *

* * @param describeRecipeRequest * @return A Java Future containing the result of the DescribeRecipe operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find 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.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.DescribeRecipe * @see AWS * API Documentation */ @Override public CompletableFuture describeRecipe(DescribeRecipeRequest describeRecipeRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeRecipeRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeRecipe"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeRecipeResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeRecipe") .withMarshaller(new DescribeRecipeRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeRecipeRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes the given recommender, including its status. *

*

* A recommender can be in one of the following states: *

*
    *
  • *

    * CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED *

    *
  • *
  • *

    * STOP PENDING > STOP IN_PROGRESS > INACTIVE > START PENDING > START IN_PROGRESS > ACTIVE *

    *
  • *
  • *

    * DELETE PENDING > DELETE IN_PROGRESS *

    *
  • *
*

* When the status is CREATE FAILED, the response includes the failureReason * key, which describes why. *

*

* The modelMetrics key is null when the recommender is being created or deleted. *

*

* For more information on recommenders, see CreateRecommender. *

* * @param describeRecommenderRequest * @return A Java Future containing the result of the DescribeRecommender operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find 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.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.DescribeRecommender * @see AWS API Documentation */ @Override public CompletableFuture describeRecommender( DescribeRecommenderRequest describeRecommenderRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeRecommenderRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeRecommender"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeRecommenderResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeRecommender") .withMarshaller(new DescribeRecommenderRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeRecommenderRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes a schema. For more information on schemas, see CreateSchema. *

* * @param describeSchemaRequest * @return A Java Future containing the result of the DescribeSchema operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find 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.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.DescribeSchema * @see AWS * API Documentation */ @Override public CompletableFuture describeSchema(DescribeSchemaRequest describeSchemaRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeSchemaRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeSchema"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeSchemaResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeSchema") .withMarshaller(new DescribeSchemaRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeSchemaRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes a solution. For more information on solutions, see CreateSolution. *

* * @param describeSolutionRequest * @return A Java Future containing the result of the DescribeSolution operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find 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.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.DescribeSolution * @see AWS * API Documentation */ @Override public CompletableFuture describeSolution(DescribeSolutionRequest describeSolutionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeSolutionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeSolution"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeSolutionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeSolution") .withMarshaller(new DescribeSolutionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeSolutionRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes a specific version of a solution. For more information on solutions, see CreateSolution *

* * @param describeSolutionVersionRequest * @return A Java Future containing the result of the DescribeSolutionVersion operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find 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.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.DescribeSolutionVersion * @see AWS API Documentation */ @Override public CompletableFuture describeSolutionVersion( DescribeSolutionVersionRequest describeSolutionVersionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeSolutionVersionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeSolutionVersion"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeSolutionVersionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeSolutionVersion") .withMarshaller(new DescribeSolutionVersionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeSolutionVersionRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets the metrics for the specified solution version. *

* * @param getSolutionMetricsRequest * @return A Java Future containing the result of the GetSolutionMetrics operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find the specified resource.
  • *
  • ResourceInUseException The specified resource is in use.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.GetSolutionMetrics * @see AWS API Documentation */ @Override public CompletableFuture getSolutionMetrics(GetSolutionMetricsRequest getSolutionMetricsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getSolutionMetricsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetSolutionMetrics"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetSolutionMetricsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetSolutionMetrics") .withMarshaller(new GetSolutionMetricsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getSolutionMetricsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets a list of the batch inference jobs that have been performed off of a solution version. *

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

* Gets a list of the batch inference jobs that have been performed off of a solution version. *

*
*

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

* * @param listBatchInferenceJobsRequest * @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. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • InvalidNextTokenException The token is not valid.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.ListBatchInferenceJobs * @see AWS API Documentation */ public ListBatchInferenceJobsPublisher listBatchInferenceJobsPaginator( ListBatchInferenceJobsRequest listBatchInferenceJobsRequest) { return new ListBatchInferenceJobsPublisher(this, applyPaginatorUserAgent(listBatchInferenceJobsRequest)); } /** *

* Gets a list of the batch segment jobs that have been performed off of a solution version that you specify. *

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

* Gets a list of the batch segment jobs that have been performed off of a solution version that you specify. *

*
*

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

* * @param listBatchSegmentJobsRequest * @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. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • InvalidNextTokenException The token is not valid.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.ListBatchSegmentJobs * @see AWS API Documentation */ public ListBatchSegmentJobsPublisher listBatchSegmentJobsPaginator(ListBatchSegmentJobsRequest listBatchSegmentJobsRequest) { return new ListBatchSegmentJobsPublisher(this, applyPaginatorUserAgent(listBatchSegmentJobsRequest)); } /** *

* Returns a list of campaigns that use the given solution. When a solution is not specified, all the campaigns * associated with the account are listed. The response provides the properties for each campaign, including the * Amazon Resource Name (ARN). For more information on campaigns, see CreateCampaign. *

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

* Returns a list of campaigns that use the given solution. When a solution is not specified, all the campaigns * associated with the account are listed. The response provides the properties for each campaign, including the * Amazon Resource Name (ARN). For more information on campaigns, see CreateCampaign. *

*
*

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

* * @param listCampaignsRequest * @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. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • InvalidNextTokenException The token is not valid.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.ListCampaigns * @see AWS API * Documentation */ public ListCampaignsPublisher listCampaignsPaginator(ListCampaignsRequest listCampaignsRequest) { return new ListCampaignsPublisher(this, applyPaginatorUserAgent(listCampaignsRequest)); } /** *

* Returns a list of dataset export jobs that use the given dataset. When a dataset is not specified, all the * dataset export jobs associated with the account are listed. The response provides the properties for each dataset * export job, including the Amazon Resource Name (ARN). For more information on dataset export jobs, see CreateDatasetExportJob. For more information on datasets, see CreateDataset. *

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

* Returns a list of dataset export jobs that use the given dataset. When a dataset is not specified, all the * dataset export jobs associated with the account are listed. The response provides the properties for each dataset * export job, including the Amazon Resource Name (ARN). For more information on dataset export jobs, see CreateDatasetExportJob. For more information on datasets, see CreateDataset. *

*
*

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

* * @param listDatasetExportJobsRequest * @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. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • InvalidNextTokenException The token is not valid.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.ListDatasetExportJobs * @see AWS API Documentation */ public ListDatasetExportJobsPublisher listDatasetExportJobsPaginator(ListDatasetExportJobsRequest listDatasetExportJobsRequest) { return new ListDatasetExportJobsPublisher(this, applyPaginatorUserAgent(listDatasetExportJobsRequest)); } /** *

* Returns a list of dataset groups. The response provides the properties for each dataset group, including the * Amazon Resource Name (ARN). For more information on dataset groups, see CreateDatasetGroup. *

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

* Returns a list of dataset groups. The response provides the properties for each dataset group, including the * Amazon Resource Name (ARN). For more information on dataset groups, see CreateDatasetGroup. *

*
*

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

* * @param listDatasetGroupsRequest * @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. *
    *
  • InvalidNextTokenException The token is not valid.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.ListDatasetGroups * @see AWS * API Documentation */ public ListDatasetGroupsPublisher listDatasetGroupsPaginator(ListDatasetGroupsRequest listDatasetGroupsRequest) { return new ListDatasetGroupsPublisher(this, applyPaginatorUserAgent(listDatasetGroupsRequest)); } /** *

* Returns a list of dataset import jobs that use the given dataset. When a dataset is not specified, all the * dataset import jobs associated with the account are listed. The response provides the properties for each dataset * import job, including the Amazon Resource Name (ARN). For more information on dataset import jobs, see CreateDatasetImportJob. For more information on datasets, see CreateDataset. *

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

* Returns a list of dataset import jobs that use the given dataset. When a dataset is not specified, all the * dataset import jobs associated with the account are listed. The response provides the properties for each dataset * import job, including the Amazon Resource Name (ARN). For more information on dataset import jobs, see CreateDatasetImportJob. For more information on datasets, see CreateDataset. *

*
*

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

* * @param listDatasetImportJobsRequest * @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. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • InvalidNextTokenException The token is not valid.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.ListDatasetImportJobs * @see AWS API Documentation */ public ListDatasetImportJobsPublisher listDatasetImportJobsPaginator(ListDatasetImportJobsRequest listDatasetImportJobsRequest) { return new ListDatasetImportJobsPublisher(this, applyPaginatorUserAgent(listDatasetImportJobsRequest)); } /** *

* Returns the list of datasets contained in the given dataset group. The response provides the properties for each * dataset, including the Amazon Resource Name (ARN). For more information on datasets, see CreateDataset. *

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

* Returns the list of datasets contained in the given dataset group. The response provides the properties for each * dataset, including the Amazon Resource Name (ARN). For more information on datasets, see CreateDataset. *

*
*

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

* * @param listDatasetsRequest * @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. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • InvalidNextTokenException The token is not valid.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.ListDatasets * @see AWS API * Documentation */ public ListDatasetsPublisher listDatasetsPaginator(ListDatasetsRequest listDatasetsRequest) { return new ListDatasetsPublisher(this, applyPaginatorUserAgent(listDatasetsRequest)); } /** *

* Returns the list of event trackers associated with the account. The response provides the properties for each * event tracker, including the Amazon Resource Name (ARN) and tracking ID. For more information on event trackers, * see CreateEventTracker. *

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

* Returns the list of event trackers associated with the account. The response provides the properties for each * event tracker, including the Amazon Resource Name (ARN) and tracking ID. For more information on event trackers, * see CreateEventTracker. *

*
*

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

* * @param listEventTrackersRequest * @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. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • InvalidNextTokenException The token is not valid.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.ListEventTrackers * @see AWS * API Documentation */ public ListEventTrackersPublisher listEventTrackersPaginator(ListEventTrackersRequest listEventTrackersRequest) { return new ListEventTrackersPublisher(this, applyPaginatorUserAgent(listEventTrackersRequest)); } /** *

* Lists all filters that belong to a given dataset group. *

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

* Lists all filters that belong to a given dataset group. *

*
*

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

* * @param listFiltersRequest * @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. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • InvalidNextTokenException The token is not valid.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.ListFilters * @see AWS API * Documentation */ public ListFiltersPublisher listFiltersPaginator(ListFiltersRequest listFiltersRequest) { return new ListFiltersPublisher(this, applyPaginatorUserAgent(listFiltersRequest)); } /** *

* Returns a list of available recipes. The response provides the properties for each recipe, including the recipe's * Amazon Resource Name (ARN). *

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

* Returns a list of available recipes. The response provides the properties for each recipe, including the recipe's * Amazon Resource Name (ARN). *

*
*

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

* * @param listRecipesRequest * @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. *
    *
  • InvalidNextTokenException The token is not valid.
  • *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.ListRecipes * @see AWS API * Documentation */ public ListRecipesPublisher listRecipesPaginator(ListRecipesRequest listRecipesRequest) { return new ListRecipesPublisher(this, applyPaginatorUserAgent(listRecipesRequest)); } /** *

* Returns a list of recommenders in a given Domain dataset group. When a Domain dataset group is not specified, all * the recommenders associated with the account are listed. The response provides the properties for each * recommender, including the Amazon Resource Name (ARN). For more information on recommenders, see CreateRecommender. *

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

* Returns a list of recommenders in a given Domain dataset group. When a Domain dataset group is not specified, all * the recommenders associated with the account are listed. The response provides the properties for each * recommender, including the Amazon Resource Name (ARN). For more information on recommenders, see CreateRecommender. *

*
*

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

* * @param listRecommendersRequest * @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. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • InvalidNextTokenException The token is not valid.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.ListRecommenders * @see AWS * API Documentation */ public ListRecommendersPublisher listRecommendersPaginator(ListRecommendersRequest listRecommendersRequest) { return new ListRecommendersPublisher(this, applyPaginatorUserAgent(listRecommendersRequest)); } /** *

* Returns the list of schemas associated with the account. The response provides the properties for each schema, * including the Amazon Resource Name (ARN). For more information on schemas, see CreateSchema. *

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

* Returns the list of schemas associated with the account. The response provides the properties for each schema, * including the Amazon Resource Name (ARN). For more information on schemas, see CreateSchema. *

*
*

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

* * @param listSchemasRequest * @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. *
    *
  • InvalidNextTokenException The token is not valid.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.ListSchemas * @see AWS API * Documentation */ public ListSchemasPublisher listSchemasPaginator(ListSchemasRequest listSchemasRequest) { return new ListSchemasPublisher(this, applyPaginatorUserAgent(listSchemasRequest)); } /** *

* Returns a list of solution versions for the given solution. When a solution is not specified, all the solution * versions associated with the account are listed. The response provides the properties for each solution version, * including the Amazon Resource Name (ARN). *

* * @param listSolutionVersionsRequest * @return A Java Future containing the result of the ListSolutionVersions operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find the specified resource.
  • *
  • InvalidNextTokenException The token is not valid.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.ListSolutionVersions * @see AWS API Documentation */ @Override public CompletableFuture listSolutionVersions( ListSolutionVersionsRequest listSolutionVersionsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listSolutionVersionsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListSolutionVersions"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListSolutionVersionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListSolutionVersions") .withMarshaller(new ListSolutionVersionsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listSolutionVersionsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns a list of solution versions for the given solution. When a solution is not specified, all the solution * versions associated with the account are listed. The response provides the properties for each solution version, * including the Amazon Resource Name (ARN). *

*
*

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

* * @param listSolutionVersionsRequest * @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. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find the specified resource.
  • *
  • InvalidNextTokenException The token is not valid.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.ListSolutionVersions * @see AWS API Documentation */ public ListSolutionVersionsPublisher listSolutionVersionsPaginator(ListSolutionVersionsRequest listSolutionVersionsRequest) { return new ListSolutionVersionsPublisher(this, applyPaginatorUserAgent(listSolutionVersionsRequest)); } /** *

* Returns a list of solutions that use the given dataset group. When a dataset group is not specified, all the * solutions associated with the account are listed. The response provides the properties for each solution, * including the Amazon Resource Name (ARN). For more information on solutions, see CreateSolution. *

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

* Returns a list of solutions that use the given dataset group. When a dataset group is not specified, all the * solutions associated with the account are listed. The response provides the properties for each solution, * including the Amazon Resource Name (ARN). For more information on solutions, see CreateSolution. *

*
*

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

* * @param listSolutionsRequest * @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. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • InvalidNextTokenException The token is not valid.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.ListSolutions * @see AWS API * Documentation */ public ListSolutionsPublisher listSolutionsPaginator(ListSolutionsRequest listSolutionsRequest) { return new ListSolutionsPublisher(this, applyPaginatorUserAgent(listSolutionsRequest)); } /** *

* Get a list of tags * attached to a 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. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find the specified resource.
  • *
  • ResourceInUseException The specified resource is in use.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.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, "Personalize"); 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); } } /** *

* Starts a recommender that is INACTIVE. Starting a recommender does not create any new models, but resumes billing * and automatic retraining for the recommender. *

* * @param startRecommenderRequest * @return A Java Future containing the result of the StartRecommender operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find the specified resource.
  • *
  • ResourceInUseException The specified resource is in use.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.StartRecommender * @see AWS * API Documentation */ @Override public CompletableFuture startRecommender(StartRecommenderRequest startRecommenderRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, startRecommenderRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartRecommender"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, StartRecommenderResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("StartRecommender") .withMarshaller(new StartRecommenderRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(startRecommenderRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Stops a recommender that is ACTIVE. Stopping a recommender halts billing and automatic retraining for the * recommender. *

* * @param stopRecommenderRequest * @return A Java Future containing the result of the StopRecommender operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find the specified resource.
  • *
  • ResourceInUseException The specified resource is in use.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.StopRecommender * @see AWS * API Documentation */ @Override public CompletableFuture stopRecommender(StopRecommenderRequest stopRecommenderRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, stopRecommenderRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StopRecommender"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, StopRecommenderResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("StopRecommender") .withMarshaller(new StopRecommenderRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(stopRecommenderRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Stops creating a solution version that is in a state of CREATE_PENDING or CREATE IN_PROGRESS. *

*

* Depending on the current state of the solution version, the solution version state changes as follows: *

*
    *
  • *

    * CREATE_PENDING > CREATE_STOPPED *

    *

    * or *

    *
  • *
  • *

    * CREATE_IN_PROGRESS > CREATE_STOPPING > CREATE_STOPPED *

    *
  • *
*

* You are billed for all of the training completed up until you stop the solution version creation. You cannot * resume creating a solution version once it has been stopped. *

* * @param stopSolutionVersionCreationRequest * @return A Java Future containing the result of the StopSolutionVersionCreation operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find the specified resource.
  • *
  • ResourceInUseException The specified resource is in use.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.StopSolutionVersionCreation * @see AWS API Documentation */ @Override public CompletableFuture stopSolutionVersionCreation( StopSolutionVersionCreationRequest stopSolutionVersionCreationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, stopSolutionVersionCreationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StopSolutionVersionCreation"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, StopSolutionVersionCreationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("StopSolutionVersionCreation") .withMarshaller(new StopSolutionVersionCreationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(stopSolutionVersionCreationRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Add a list of tags to a resource. *

* * @param tagResourceRequest * @return A Java Future containing the result of the TagResource operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find the specified resource.
  • *
  • TooManyTagsException You have exceeded the maximum number of tags you can apply to this resource.
  • *
  • ResourceInUseException The specified resource is in use.
  • *
  • LimitExceededException The limit on the number of requests per second has been exceeded.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.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, "Personalize"); 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); } } /** *

* Remove tags that are * attached to a 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. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find the specified resource.
  • *
  • TooManyTagKeysException The request contains more tag keys than can be associated with a resource (50 * tag keys per resource).
  • *
  • ResourceInUseException The specified resource is in use.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.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, "Personalize"); 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 a campaign by either deploying a new solution or changing the value of the campaign's * minProvisionedTPS parameter. *

*

* To update a campaign, the campaign status must be ACTIVE or CREATE FAILED. Check the campaign status using the DescribeCampaign * operation. *

* *

* You can still get recommendations from a campaign while an update is in progress. The campaign will use the * previous solution version and campaign configuration to generate recommendations until the latest campaign update * status is Active. *

*
*

* For more information on campaigns, see CreateCampaign. *

* * @param updateCampaignRequest * @return A Java Future containing the result of the UpdateCampaign operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find the specified resource.
  • *
  • ResourceInUseException The specified resource is in use.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.UpdateCampaign * @see AWS * API Documentation */ @Override public CompletableFuture updateCampaign(UpdateCampaignRequest updateCampaignRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateCampaignRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateCampaign"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateCampaignResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateCampaign") .withMarshaller(new UpdateCampaignRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateCampaignRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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 recommender to modify the recommender configuration. *

* * @param updateRecommenderRequest * @return A Java Future containing the result of the UpdateRecommender operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidInputException Provide a valid value for the field or parameter.
  • *
  • ResourceNotFoundException Could not find the specified resource.
  • *
  • ResourceInUseException The specified resource is in use.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PersonalizeException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PersonalizeAsyncClient.UpdateRecommender * @see AWS * API Documentation */ @Override public CompletableFuture updateRecommender(UpdateRecommenderRequest updateRecommenderRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateRecommenderRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateRecommender"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateRecommenderResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateRecommender") .withMarshaller(new UpdateRecommenderRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateRecommenderRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.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(PersonalizeException::builder) .protocol(AwsJsonProtocol.AWS_JSON) .protocolVersion("1.1") .registerModeledException( ExceptionMetadata.builder().errorCode("TooManyTagKeysException") .exceptionBuilderSupplier(TooManyTagKeysException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidNextTokenException") .exceptionBuilderSupplier(InvalidNextTokenException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("LimitExceededException") .exceptionBuilderSupplier(LimitExceededException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ResourceNotFoundException") .exceptionBuilderSupplier(ResourceNotFoundException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ResourceAlreadyExistsException") .exceptionBuilderSupplier(ResourceAlreadyExistsException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ResourceInUseException") .exceptionBuilderSupplier(ResourceInUseException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("TooManyTagsException") .exceptionBuilderSupplier(TooManyTagsException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidInputException") .exceptionBuilderSupplier(InvalidInputException::builder).httpStatusCode(400).build()); } private static List resolveMetricPublishers(SdkClientConfiguration clientConfiguration, RequestOverrideConfiguration requestOverrideConfiguration) { List publishers = null; if (requestOverrideConfiguration != null) { publishers = requestOverrideConfiguration.metricPublishers(); } if (publishers == null || publishers.isEmpty()) { publishers = clientConfiguration.option(SdkClientOption.METRIC_PUBLISHERS); } if (publishers == null) { publishers = Collections.emptyList(); } return publishers; } private T applyPaginatorUserAgent(T request) { Consumer userAgentApplier = b -> b.addApiName(ApiName.builder() .version(VersionInfo.SDK_VERSION).name("PAGINATED").build()); AwsRequestOverrideConfiguration overrideConfiguration = request.overrideConfiguration() .map(c -> c.toBuilder().applyMutation(userAgentApplier).build()) .orElse((AwsRequestOverrideConfiguration.builder().applyMutation(userAgentApplier).build())); return (T) request.toBuilder().overrideConfiguration(overrideConfiguration).build(); } private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory, JsonOperationMetadata operationMetadata) { return protocolFactory.createErrorResponseHandler(operationMetadata); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy