software.amazon.awssdk.services.personalize.DefaultPersonalizeClient Maven / Gradle / Ivy
Show all versions of personalize Show documentation
/*
* 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.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.awscore.internal.AwsProtocolMetadata;
import software.amazon.awssdk.awscore.internal.AwsServiceProtocol;
import software.amazon.awssdk.awscore.retry.AwsRetryStrategy;
import software.amazon.awssdk.core.RequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkPlugin;
import software.amazon.awssdk.core.SdkRequest;
import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.client.handler.SyncClientHandler;
import software.amazon.awssdk.core.exception.SdkClientException;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.metrics.CoreMetric;
import software.amazon.awssdk.core.retry.RetryMode;
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.retries.api.RetryStrategy;
import software.amazon.awssdk.services.personalize.internal.PersonalizeServiceClientConfigurationBuilder;
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.CreateDataDeletionJobRequest;
import software.amazon.awssdk.services.personalize.model.CreateDataDeletionJobResponse;
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.CreateMetricAttributionRequest;
import software.amazon.awssdk.services.personalize.model.CreateMetricAttributionResponse;
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.DeleteMetricAttributionRequest;
import software.amazon.awssdk.services.personalize.model.DeleteMetricAttributionResponse;
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.DescribeDataDeletionJobRequest;
import software.amazon.awssdk.services.personalize.model.DescribeDataDeletionJobResponse;
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.DescribeMetricAttributionRequest;
import software.amazon.awssdk.services.personalize.model.DescribeMetricAttributionResponse;
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.ListDataDeletionJobsRequest;
import software.amazon.awssdk.services.personalize.model.ListDataDeletionJobsResponse;
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.ListMetricAttributionMetricsRequest;
import software.amazon.awssdk.services.personalize.model.ListMetricAttributionMetricsResponse;
import software.amazon.awssdk.services.personalize.model.ListMetricAttributionsRequest;
import software.amazon.awssdk.services.personalize.model.ListMetricAttributionsResponse;
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.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.UpdateDatasetRequest;
import software.amazon.awssdk.services.personalize.model.UpdateDatasetResponse;
import software.amazon.awssdk.services.personalize.model.UpdateMetricAttributionRequest;
import software.amazon.awssdk.services.personalize.model.UpdateMetricAttributionResponse;
import software.amazon.awssdk.services.personalize.model.UpdateRecommenderRequest;
import software.amazon.awssdk.services.personalize.model.UpdateRecommenderResponse;
import software.amazon.awssdk.services.personalize.model.UpdateSolutionRequest;
import software.amazon.awssdk.services.personalize.model.UpdateSolutionResponse;
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.CreateDataDeletionJobRequestMarshaller;
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.CreateMetricAttributionRequestMarshaller;
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.DeleteMetricAttributionRequestMarshaller;
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.DescribeDataDeletionJobRequestMarshaller;
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.DescribeMetricAttributionRequestMarshaller;
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.ListDataDeletionJobsRequestMarshaller;
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.ListMetricAttributionMetricsRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.ListMetricAttributionsRequestMarshaller;
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.UpdateDatasetRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.UpdateMetricAttributionRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.UpdateRecommenderRequestMarshaller;
import software.amazon.awssdk.services.personalize.transform.UpdateSolutionRequestMarshaller;
import software.amazon.awssdk.utils.Logger;
/**
* Internal implementation of {@link PersonalizeClient}.
*
* @see PersonalizeClient#builder()
*/
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultPersonalizeClient implements PersonalizeClient {
private static final Logger log = Logger.loggerFor(DefaultPersonalizeClient.class);
private static final AwsProtocolMetadata protocolMetadata = AwsProtocolMetadata.builder()
.serviceProtocol(AwsServiceProtocol.AWS_JSON).build();
private final SyncClientHandler clientHandler;
private final AwsJsonProtocolFactory protocolFactory;
private final SdkClientConfiguration clientConfiguration;
protected DefaultPersonalizeClient(SdkClientConfiguration clientConfiguration) {
this.clientHandler = new AwsSyncClientHandler(clientConfiguration);
this.clientConfiguration = clientConfiguration.toBuilder().option(SdkClientOption.SDK_CLIENT, this).build();
this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
}
/**
*
* Generates batch recommendations based on a list of items or users stored in Amazon S3 and exports the
* recommendations to an Amazon S3 bucket.
*
*
* To generate batch recommendations, specify the ARN of a solution version and an Amazon S3 URI for the input and
* output data. For user personalization, popular items, and personalized ranking solutions, the batch inference job
* generates a list of recommended items for each user ID in the input file. For related items solutions, the job
* generates a list of recommended items for each item ID in the input file.
*
*
* For more information, see Creating a batch
* inference job .
*
*
* If you use the Similar-Items recipe, Amazon Personalize can add descriptive themes to batch recommendations. To
* generate themes, set the job's mode to THEME_GENERATION
and specify the name of the field that
* contains item names in the input data.
*
*
* For more information about generating themes, see Batch recommendations
* with themes from Content Generator .
*
*
* You can't get batch recommendations with the Trending-Now or Next-Best-Action recipes.
*
*
* @param createBatchInferenceJobRequest
* @return Result of the CreateBatchInferenceJob operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceAlreadyExistsException
* The specified resource already exists.
* @throws LimitExceededException
* The limit on the number of requests per second has been exceeded.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws ResourceInUseException
* The specified resource is in use.
* @throws TooManyTagsException
* You have exceeded the maximum number of tags you can apply to this resource.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.CreateBatchInferenceJob
* @see AWS API Documentation
*/
@Override
public CreateBatchInferenceJobResponse createBatchInferenceJob(CreateBatchInferenceJobRequest createBatchInferenceJobRequest)
throws InvalidInputException, ResourceAlreadyExistsException, LimitExceededException, ResourceNotFoundException,
ResourceInUseException, TooManyTagsException, AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateBatchInferenceJobResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createBatchInferenceJobRequest,
this.clientConfiguration);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateBatchInferenceJob").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createBatchInferenceJobRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateBatchInferenceJobRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the CreateBatchSegmentJob operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceAlreadyExistsException
* The specified resource already exists.
* @throws LimitExceededException
* The limit on the number of requests per second has been exceeded.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws ResourceInUseException
* The specified resource is in use.
* @throws TooManyTagsException
* You have exceeded the maximum number of tags you can apply to this resource.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.CreateBatchSegmentJob
* @see AWS API Documentation
*/
@Override
public CreateBatchSegmentJobResponse createBatchSegmentJob(CreateBatchSegmentJobRequest createBatchSegmentJobRequest)
throws InvalidInputException, ResourceAlreadyExistsException, LimitExceededException, ResourceNotFoundException,
ResourceInUseException, TooManyTagsException, AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateBatchSegmentJobResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createBatchSegmentJobRequest,
this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateBatchSegmentJob").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createBatchSegmentJobRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateBatchSegmentJobRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
*
* You incur campaign costs while it is active. To avoid unnecessary costs, make sure to delete the campaign when
* you are finished. For information about campaign costs, see Amazon Personalize pricing.
*
*
*
* 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 high minProvisionedTPS
will increase your cost. We recommend starting with 1 for
* minProvisionedTPS
(the default). Track your usage using Amazon CloudWatch metrics, and increase the
* minProvisionedTPS
as necessary.
*
*
*
* When you create an Amazon Personalize campaign, you can specify the minimum provisioned transactions per second (
* minProvisionedTPS
) for the campaign. This is the baseline transaction throughput for the campaign
* provisioned by Amazon Personalize. It sets the minimum billing charge for the campaign while it is active. A
* transaction is a single GetRecommendations
or GetPersonalizedRanking
request. The
* default minProvisionedTPS
is 1.
*
*
* If your TPS increases beyond the 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. When your traffic reduces, capacity returns to the
* minProvisionedTPS
.
*
*
* You are charged for the the minimum provisioned TPS or, if your requests exceed the
* minProvisionedTPS
, the actual TPS. The actual TPS is the total number of recommendation requests you
* make. We recommend starting with a low minProvisionedTPS
, track your usage using Amazon CloudWatch
* metrics, and then increase the minProvisionedTPS
as necessary.
*
*
* For more information about campaign costs, see Amazon
* Personalize pricing.
*
*
* 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
*
*
* -
*
* ListCampaigns
*
*
* -
*
* DescribeCampaign
*
*
* -
*
* UpdateCampaign
*
*
* -
*
* DeleteCampaign
*
*
*
*
* @param createCampaignRequest
* @return Result of the CreateCampaign operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws ResourceAlreadyExistsException
* The specified resource already exists.
* @throws LimitExceededException
* The limit on the number of requests per second has been exceeded.
* @throws ResourceInUseException
* The specified resource is in use.
* @throws TooManyTagsException
* You have exceeded the maximum number of tags you can apply to this resource.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.CreateCampaign
* @see AWS
* API Documentation
*/
@Override
public CreateCampaignResponse createCampaign(CreateCampaignRequest createCampaignRequest) throws InvalidInputException,
ResourceNotFoundException, ResourceAlreadyExistsException, LimitExceededException, ResourceInUseException,
TooManyTagsException, AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateCampaignResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createCampaignRequest, this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateCampaign").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createCampaignRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateCampaignRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates a batch job that deletes all references to specific users from an Amazon Personalize dataset group in
* batches. You specify the users to delete in a CSV file of userIds in an Amazon S3 bucket. After a job completes,
* Amazon Personalize no longer trains on the users’ data and no longer considers the users when generating user
* segments. For more information about creating a data deletion job, see Deleting users.
*
*
* -
*
* Your input file must be a CSV file with a single USER_ID column that lists the users IDs. For more information
* about preparing the CSV file, see Preparing your data
* deletion file and uploading it to Amazon S3.
*
*
* -
*
* To give Amazon Personalize permission to access your input CSV file of userIds, you must specify an IAM service
* role that has permission to read from the data source. This role needs GetObject
and
* ListBucket
permissions for the bucket and its content. These permissions are the same as importing
* data. For information on granting access to your Amazon S3 bucket, see Giving Amazon
* Personalize Access to Amazon S3 Resources.
*
*
*
*
* After you create a job, it can take up to a day to delete all references to the users from datasets and models.
* Until the job completes, Amazon Personalize continues to use the data when training. And if you use a User
* Segmentation recipe, the users might appear in user segments.
*
*
* Status
*
*
* A data deletion job can have one of the following statuses:
*
*
* -
*
* PENDING > IN_PROGRESS > COMPLETED -or- FAILED
*
*
*
*
* To get the status of the data deletion job, call DescribeDataDeletionJob API operation and specify the Amazon Resource Name (ARN) of the job. If the status
* is FAILED, the response includes a failureReason
key, which describes why the job failed.
*
*
* Related APIs
*
*
* -
*
*
* -
*
*
*
*
* @param createDataDeletionJobRequest
* @return Result of the CreateDataDeletionJob operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws ResourceAlreadyExistsException
* The specified resource already exists.
* @throws LimitExceededException
* The limit on the number of requests per second has been exceeded.
* @throws ResourceInUseException
* The specified resource is in use.
* @throws TooManyTagsException
* You have exceeded the maximum number of tags you can apply to this resource.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.CreateDataDeletionJob
* @see AWS API Documentation
*/
@Override
public CreateDataDeletionJobResponse createDataDeletionJob(CreateDataDeletionJobRequest createDataDeletionJobRequest)
throws InvalidInputException, ResourceNotFoundException, ResourceAlreadyExistsException, LimitExceededException,
ResourceInUseException, TooManyTagsException, AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateDataDeletionJobResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createDataDeletionJobRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createDataDeletionJobRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateDataDeletionJob");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateDataDeletionJob").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createDataDeletionJobRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateDataDeletionJobRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates an empty dataset and adds it to the specified dataset group. Use CreateDatasetImportJob to import your training data to a dataset.
*
*
* There are 5 types of datasets:
*
*
* -
*
* Item interactions
*
*
* -
*
* Items
*
*
* -
*
* Users
*
*
* -
*
* Action interactions
*
*
* -
*
* Actions
*
*
*
*
* Each dataset type has an associated schema with required field types. Only the Item 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
*
*
* -
*
*
* -
*
* ListDatasets
*
*
* -
*
* DescribeDataset
*
*
* -
*
* DeleteDataset
*
*
*
*
* @param createDatasetRequest
* @return Result of the CreateDataset operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws ResourceAlreadyExistsException
* The specified resource already exists.
* @throws LimitExceededException
* The limit on the number of requests per second has been exceeded.
* @throws ResourceInUseException
* The specified resource is in use.
* @throws TooManyTagsException
* You have exceeded the maximum number of tags you can apply to this resource.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.CreateDataset
* @see AWS API
* Documentation
*/
@Override
public CreateDatasetResponse createDataset(CreateDatasetRequest createDatasetRequest) throws InvalidInputException,
ResourceNotFoundException, ResourceAlreadyExistsException, LimitExceededException, ResourceInUseException,
TooManyTagsException, AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateDatasetResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createDatasetRequest, this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateDataset").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createDatasetRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateDatasetRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the CreateDatasetExportJob operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws ResourceAlreadyExistsException
* The specified resource already exists.
* @throws LimitExceededException
* The limit on the number of requests per second has been exceeded.
* @throws ResourceInUseException
* The specified resource is in use.
* @throws TooManyTagsException
* You have exceeded the maximum number of tags you can apply to this resource.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.CreateDatasetExportJob
* @see AWS API Documentation
*/
@Override
public CreateDatasetExportJobResponse createDatasetExportJob(CreateDatasetExportJobRequest createDatasetExportJobRequest)
throws InvalidInputException, ResourceNotFoundException, ResourceAlreadyExistsException, LimitExceededException,
ResourceInUseException, TooManyTagsException, AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateDatasetExportJobResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createDatasetExportJobRequest,
this.clientConfiguration);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateDatasetExportJob").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createDatasetExportJobRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateDatasetExportJobRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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:
*
*
* -
*
* Item interactions
*
*
* -
*
* Items
*
*
* -
*
* Users
*
*
* -
*
* Actions
*
*
* -
*
* Action interactions
*
*
*
*
* 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
*
*
* -
*
* CreateDataset
*
*
* -
*
*
* -
*
* CreateSolution
*
*
*
*
* Related APIs
*
*
* -
*
*
* -
*
*
* -
*
*
*
*
* @param createDatasetGroupRequest
* @return Result of the CreateDatasetGroup operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceAlreadyExistsException
* The specified resource already exists.
* @throws LimitExceededException
* The limit on the number of requests per second has been exceeded.
* @throws TooManyTagsException
* You have exceeded the maximum number of tags you can apply to this resource.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.CreateDatasetGroup
* @see AWS API Documentation
*/
@Override
public CreateDatasetGroupResponse createDatasetGroup(CreateDatasetGroupRequest createDatasetGroupRequest)
throws InvalidInputException, ResourceAlreadyExistsException, LimitExceededException, TooManyTagsException,
AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateDatasetGroupResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createDatasetGroupRequest,
this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateDatasetGroup").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createDatasetGroupRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateDatasetGroupRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the CreateDatasetImportJob operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws ResourceAlreadyExistsException
* The specified resource already exists.
* @throws LimitExceededException
* The limit on the number of requests per second has been exceeded.
* @throws ResourceInUseException
* The specified resource is in use.
* @throws TooManyTagsException
* You have exceeded the maximum number of tags you can apply to this resource.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.CreateDatasetImportJob
* @see AWS API Documentation
*/
@Override
public CreateDatasetImportJobResponse createDatasetImportJob(CreateDatasetImportJobRequest createDatasetImportJobRequest)
throws InvalidInputException, ResourceNotFoundException, ResourceAlreadyExistsException, LimitExceededException,
ResourceInUseException, TooManyTagsException, AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateDatasetImportJobResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createDatasetImportJobRequest,
this.clientConfiguration);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateDatasetImportJob").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createDatasetImportJobRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateDatasetImportJobRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Item 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 Result of the CreateEventTracker operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceAlreadyExistsException
* The specified resource already exists.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws LimitExceededException
* The limit on the number of requests per second has been exceeded.
* @throws ResourceInUseException
* The specified resource is in use.
* @throws TooManyTagsException
* You have exceeded the maximum number of tags you can apply to this resource.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.CreateEventTracker
* @see AWS API Documentation
*/
@Override
public CreateEventTrackerResponse createEventTracker(CreateEventTrackerRequest createEventTrackerRequest)
throws InvalidInputException, ResourceAlreadyExistsException, ResourceNotFoundException, LimitExceededException,
ResourceInUseException, TooManyTagsException, AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateEventTrackerResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createEventTrackerRequest,
this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateEventTracker").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createEventTrackerRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateEventTrackerRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates a recommendation filter. For more information, see Filtering recommendations and user
* segments.
*
*
* @param createFilterRequest
* @return Result of the CreateFilter operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceAlreadyExistsException
* The specified resource already exists.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws LimitExceededException
* The limit on the number of requests per second has been exceeded.
* @throws TooManyTagsException
* You have exceeded the maximum number of tags you can apply to this resource.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.CreateFilter
* @see AWS API
* Documentation
*/
@Override
public CreateFilterResponse createFilter(CreateFilterRequest createFilterRequest) throws InvalidInputException,
ResourceAlreadyExistsException, ResourceNotFoundException, LimitExceededException, TooManyTagsException,
AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateFilterResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createFilterRequest, this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateFilter").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createFilterRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateFilterRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates a metric attribution. A metric attribution creates reports on the data that you import into Amazon
* Personalize. Depending on how you imported the data, you can view reports in Amazon CloudWatch or Amazon S3. For
* more information, see Measuring impact of
* recommendations.
*
*
* @param createMetricAttributionRequest
* @return Result of the CreateMetricAttribution operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws ResourceAlreadyExistsException
* The specified resource already exists.
* @throws ResourceInUseException
* The specified resource is in use.
* @throws LimitExceededException
* The limit on the number of requests per second has been exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.CreateMetricAttribution
* @see AWS API Documentation
*/
@Override
public CreateMetricAttributionResponse createMetricAttribution(CreateMetricAttributionRequest createMetricAttributionRequest)
throws InvalidInputException, ResourceNotFoundException, ResourceAlreadyExistsException, ResourceInUseException,
LimitExceededException, AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateMetricAttributionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createMetricAttributionRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createMetricAttributionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateMetricAttribution");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateMetricAttribution").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createMetricAttributionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateMetricAttributionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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
*
*
*
* A high minRecommendationRequestsPerSecond
will increase your bill. We recommend starting with 1 for
* minRecommendationRequestsPerSecond
(the default). Track your usage using Amazon CloudWatch metrics,
* and increase the minRecommendationRequestsPerSecond
as necessary.
*
*
*
* 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
*
*
* -
*
* ListRecommenders
*
*
* -
*
*
* -
*
*
* -
*
*
*
*
* @param createRecommenderRequest
* @return Result of the CreateRecommender operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceAlreadyExistsException
* The specified resource already exists.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws LimitExceededException
* The limit on the number of requests per second has been exceeded.
* @throws ResourceInUseException
* The specified resource is in use.
* @throws TooManyTagsException
* You have exceeded the maximum number of tags you can apply to this resource.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.CreateRecommender
* @see AWS
* API Documentation
*/
@Override
public CreateRecommenderResponse createRecommender(CreateRecommenderRequest createRecommenderRequest)
throws InvalidInputException, ResourceAlreadyExistsException, ResourceNotFoundException, LimitExceededException,
ResourceInUseException, TooManyTagsException, AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateRecommenderResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createRecommenderRequest,
this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateRecommender").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createRecommenderRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateRecommenderRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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
*
*
* -
*
* ListSchemas
*
*
* -
*
* DescribeSchema
*
*
* -
*
* DeleteSchema
*
*
*
*
* @param createSchemaRequest
* @return Result of the CreateSchema operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceAlreadyExistsException
* The specified resource already exists.
* @throws LimitExceededException
* The limit on the number of requests per second has been exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.CreateSchema
* @see AWS API
* Documentation
*/
@Override
public CreateSchemaResponse createSchema(CreateSchemaRequest createSchemaRequest) throws InvalidInputException,
ResourceAlreadyExistsException, LimitExceededException, AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateSchemaResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createSchemaRequest, this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateSchema").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createSchemaRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateSchemaRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
*
* By default, all new solutions use automatic training. With automatic training, you incur training costs while
* your solution is active. To avoid unnecessary costs, when you are finished you can update the solution to turn
* off automatic training. For information about training costs, see Amazon Personalize pricing.
*
*
*
* Creates the configuration for training a model (creating a solution version). This configuration includes the
* recipe to use for model training and optional training configuration, such as columns to use in training and
* feature transformation parameters. For more information about configuring a solution, see Creating and
* configuring a solution.
*
*
* By default, new solutions use automatic training to create solution versions every 7 days. You can change the
* training frequency. Automatic solution version creation starts within one hour after the solution is ACTIVE. If
* you manually create a solution version within the hour, the solution skips the first automatic training. For more
* information, see Configuring automatic
* training.
*
*
* To turn off automatic training, set performAutoTraining
to false. If you turn off automatic
* training, you must manually create a solution version by calling the CreateSolutionVersion
* operation.
*
*
* After training starts, you can get the solution version's Amazon Resource Name (ARN) with the ListSolutionVersions
* API operation. To get its status, use the DescribeSolutionVersion.
*
*
* After training completes you can evaluate model accuracy by calling GetSolutionMetrics. When
* you are satisfied with the solution version, you deploy it using CreateCampaign. The campaign
* provides recommendations to a client through the GetRecommendations
* API.
*
*
*
* 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. If you
* use manual training, the status must be ACTIVE before you call CreateSolutionVersion
.
*
*
* Related APIs
*
*
* -
*
* UpdateSolution
*
*
* -
*
* ListSolutions
*
*
* -
*
*
* -
*
* DescribeSolution
*
*
* -
*
* DeleteSolution
*
*
*
*
* -
*
*
* -
*
*
*
*
* @param createSolutionRequest
* @return Result of the CreateSolution operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceAlreadyExistsException
* The specified resource already exists.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws LimitExceededException
* The limit on the number of requests per second has been exceeded.
* @throws ResourceInUseException
* The specified resource is in use.
* @throws TooManyTagsException
* You have exceeded the maximum number of tags you can apply to this resource.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.CreateSolution
* @see AWS
* API Documentation
*/
@Override
public CreateSolutionResponse createSolution(CreateSolutionRequest createSolutionRequest) throws InvalidInputException,
ResourceAlreadyExistsException, ResourceNotFoundException, LimitExceededException, ResourceInUseException,
TooManyTagsException, AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateSolutionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createSolutionRequest, this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateSolution").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createSolutionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateSolutionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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
*
*
* -
*
*
* -
*
*
* -
*
* ListSolutions
*
*
* -
*
* CreateSolution
*
*
* -
*
* DescribeSolution
*
*
* -
*
* DeleteSolution
*
*
*
*
* @param createSolutionVersionRequest
* @return Result of the CreateSolutionVersion operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws LimitExceededException
* The limit on the number of requests per second has been exceeded.
* @throws ResourceInUseException
* The specified resource is in use.
* @throws TooManyTagsException
* You have exceeded the maximum number of tags you can apply to this resource.
* @throws ResourceAlreadyExistsException
* The specified resource already exists.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.CreateSolutionVersion
* @see AWS API Documentation
*/
@Override
public CreateSolutionVersionResponse createSolutionVersion(CreateSolutionVersionRequest createSolutionVersionRequest)
throws InvalidInputException, ResourceNotFoundException, LimitExceededException, ResourceInUseException,
TooManyTagsException, ResourceAlreadyExistsException, AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateSolutionVersionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createSolutionVersionRequest,
this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateSolutionVersion").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createSolutionVersionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateSolutionVersionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the DeleteCampaign operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws ResourceInUseException
* The specified resource is in use.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.DeleteCampaign
* @see AWS
* API Documentation
*/
@Override
public DeleteCampaignResponse deleteCampaign(DeleteCampaignRequest deleteCampaignRequest) throws InvalidInputException,
ResourceNotFoundException, ResourceInUseException, AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteCampaignResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteCampaignRequest, this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteCampaign").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteCampaignRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteCampaignRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the DeleteDataset operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws ResourceInUseException
* The specified resource is in use.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.DeleteDataset
* @see AWS API
* Documentation
*/
@Override
public DeleteDatasetResponse deleteDataset(DeleteDatasetRequest deleteDatasetRequest) throws InvalidInputException,
ResourceNotFoundException, ResourceInUseException, AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteDatasetResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteDatasetRequest, this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteDataset").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteDatasetRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteDatasetRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the DeleteDatasetGroup operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws ResourceInUseException
* The specified resource is in use.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.DeleteDatasetGroup
* @see AWS API Documentation
*/
@Override
public DeleteDatasetGroupResponse deleteDatasetGroup(DeleteDatasetGroupRequest deleteDatasetGroupRequest)
throws InvalidInputException, ResourceNotFoundException, ResourceInUseException, AwsServiceException,
SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteDatasetGroupResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteDatasetGroupRequest,
this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteDatasetGroup").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteDatasetGroupRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteDatasetGroupRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes the event tracker. Does not delete the dataset from the dataset group. For more information on event
* trackers, see CreateEventTracker.
*
*
* @param deleteEventTrackerRequest
* @return Result of the DeleteEventTracker operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws ResourceInUseException
* The specified resource is in use.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.DeleteEventTracker
* @see AWS API Documentation
*/
@Override
public DeleteEventTrackerResponse deleteEventTracker(DeleteEventTrackerRequest deleteEventTrackerRequest)
throws InvalidInputException, ResourceNotFoundException, ResourceInUseException, AwsServiceException,
SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteEventTrackerResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteEventTrackerRequest,
this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteEventTracker").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteEventTrackerRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteEventTrackerRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes a filter.
*
*
* @param deleteFilterRequest
* @return Result of the DeleteFilter operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws ResourceInUseException
* The specified resource is in use.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.DeleteFilter
* @see AWS API
* Documentation
*/
@Override
public DeleteFilterResponse deleteFilter(DeleteFilterRequest deleteFilterRequest) throws InvalidInputException,
ResourceNotFoundException, ResourceInUseException, AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteFilterResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteFilterRequest, this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteFilter").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteFilterRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteFilterRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes a metric attribution.
*
*
* @param deleteMetricAttributionRequest
* @return Result of the DeleteMetricAttribution operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws ResourceInUseException
* The specified resource is in use.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.DeleteMetricAttribution
* @see AWS API Documentation
*/
@Override
public DeleteMetricAttributionResponse deleteMetricAttribution(DeleteMetricAttributionRequest deleteMetricAttributionRequest)
throws InvalidInputException, ResourceNotFoundException, ResourceInUseException, AwsServiceException,
SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteMetricAttributionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteMetricAttributionRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteMetricAttributionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteMetricAttribution");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteMetricAttribution").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteMetricAttributionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteMetricAttributionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deactivates and removes a recommender. A deleted recommender can no longer be specified in a GetRecommendations
* request.
*
*
* @param deleteRecommenderRequest
* @return Result of the DeleteRecommender operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws ResourceInUseException
* The specified resource is in use.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.DeleteRecommender
* @see AWS
* API Documentation
*/
@Override
public DeleteRecommenderResponse deleteRecommender(DeleteRecommenderRequest deleteRecommenderRequest)
throws InvalidInputException, ResourceNotFoundException, ResourceInUseException, AwsServiceException,
SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteRecommenderResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteRecommenderRequest,
this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteRecommender").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteRecommenderRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteRecommenderRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the DeleteSchema operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws ResourceInUseException
* The specified resource is in use.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.DeleteSchema
* @see AWS API
* Documentation
*/
@Override
public DeleteSchemaResponse deleteSchema(DeleteSchemaRequest deleteSchemaRequest) throws InvalidInputException,
ResourceNotFoundException, ResourceInUseException, AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteSchemaResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteSchemaRequest, this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteSchema").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteSchemaRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteSchemaRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the DeleteSolution operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws ResourceInUseException
* The specified resource is in use.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.DeleteSolution
* @see AWS
* API Documentation
*/
@Override
public DeleteSolutionResponse deleteSolution(DeleteSolutionRequest deleteSolutionRequest) throws InvalidInputException,
ResourceNotFoundException, ResourceInUseException, AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteSolutionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteSolutionRequest, this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteSolution").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteSolutionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteSolutionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Describes the given algorithm.
*
*
* @param describeAlgorithmRequest
* @return Result of the DescribeAlgorithm operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.DescribeAlgorithm
* @see AWS
* API Documentation
*/
@Override
public DescribeAlgorithmResponse describeAlgorithm(DescribeAlgorithmRequest describeAlgorithmRequest)
throws InvalidInputException, ResourceNotFoundException, AwsServiceException, SdkClientException,
PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DescribeAlgorithmResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeAlgorithmRequest,
this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeAlgorithm").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(describeAlgorithmRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeAlgorithmRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the DescribeBatchInferenceJob operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.DescribeBatchInferenceJob
* @see AWS API Documentation
*/
@Override
public DescribeBatchInferenceJobResponse describeBatchInferenceJob(
DescribeBatchInferenceJobRequest describeBatchInferenceJobRequest) throws InvalidInputException,
ResourceNotFoundException, AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeBatchInferenceJobResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeBatchInferenceJobRequest,
this.clientConfiguration);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeBatchInferenceJob").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(describeBatchInferenceJobRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeBatchInferenceJobRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the DescribeBatchSegmentJob operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.DescribeBatchSegmentJob
* @see AWS API Documentation
*/
@Override
public DescribeBatchSegmentJobResponse describeBatchSegmentJob(DescribeBatchSegmentJobRequest describeBatchSegmentJobRequest)
throws InvalidInputException, ResourceNotFoundException, AwsServiceException, SdkClientException,
PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeBatchSegmentJobResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeBatchSegmentJobRequest,
this.clientConfiguration);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeBatchSegmentJob").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(describeBatchSegmentJobRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeBatchSegmentJobRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the DescribeCampaign operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.DescribeCampaign
* @see AWS
* API Documentation
*/
@Override
public DescribeCampaignResponse describeCampaign(DescribeCampaignRequest describeCampaignRequest)
throws InvalidInputException, ResourceNotFoundException, AwsServiceException, SdkClientException,
PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DescribeCampaignResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeCampaignRequest,
this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeCampaign").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(describeCampaignRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeCampaignRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Describes the data deletion job created by CreateDataDeletionJob, including the job status.
*
*
* @param describeDataDeletionJobRequest
* @return Result of the DescribeDataDeletionJob operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.DescribeDataDeletionJob
* @see AWS API Documentation
*/
@Override
public DescribeDataDeletionJobResponse describeDataDeletionJob(DescribeDataDeletionJobRequest describeDataDeletionJobRequest)
throws InvalidInputException, ResourceNotFoundException, AwsServiceException, SdkClientException,
PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeDataDeletionJobResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeDataDeletionJobRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeDataDeletionJobRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeDataDeletionJob");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeDataDeletionJob").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(describeDataDeletionJobRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeDataDeletionJobRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Describes the given dataset. For more information on datasets, see CreateDataset.
*
*
* @param describeDatasetRequest
* @return Result of the DescribeDataset operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.DescribeDataset
* @see AWS
* API Documentation
*/
@Override
public DescribeDatasetResponse describeDataset(DescribeDatasetRequest describeDatasetRequest) throws InvalidInputException,
ResourceNotFoundException, AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DescribeDatasetResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeDatasetRequest,
this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeDataset").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(describeDatasetRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeDatasetRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Describes the dataset export job created by CreateDatasetExportJob, including the export job status.
*
*
* @param describeDatasetExportJobRequest
* @return Result of the DescribeDatasetExportJob operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.DescribeDatasetExportJob
* @see AWS API Documentation
*/
@Override
public DescribeDatasetExportJobResponse describeDatasetExportJob(
DescribeDatasetExportJobRequest describeDatasetExportJobRequest) throws InvalidInputException,
ResourceNotFoundException, AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeDatasetExportJobResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeDatasetExportJobRequest,
this.clientConfiguration);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeDatasetExportJob").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(describeDatasetExportJobRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeDatasetExportJobRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Describes the given dataset group. For more information on dataset groups, see CreateDatasetGroup.
*
*
* @param describeDatasetGroupRequest
* @return Result of the DescribeDatasetGroup operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.DescribeDatasetGroup
* @see AWS API Documentation
*/
@Override
public DescribeDatasetGroupResponse describeDatasetGroup(DescribeDatasetGroupRequest describeDatasetGroupRequest)
throws InvalidInputException, ResourceNotFoundException, AwsServiceException, SdkClientException,
PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeDatasetGroupResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeDatasetGroupRequest,
this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeDatasetGroup").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(describeDatasetGroupRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeDatasetGroupRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Describes the dataset import job created by CreateDatasetImportJob, including the import job status.
*
*
* @param describeDatasetImportJobRequest
* @return Result of the DescribeDatasetImportJob operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.DescribeDatasetImportJob
* @see AWS API Documentation
*/
@Override
public DescribeDatasetImportJobResponse describeDatasetImportJob(
DescribeDatasetImportJobRequest describeDatasetImportJobRequest) throws InvalidInputException,
ResourceNotFoundException, AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeDatasetImportJobResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeDatasetImportJobRequest,
this.clientConfiguration);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeDatasetImportJob").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(describeDatasetImportJobRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeDatasetImportJobRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the DescribeEventTracker operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.DescribeEventTracker
* @see AWS API Documentation
*/
@Override
public DescribeEventTrackerResponse describeEventTracker(DescribeEventTrackerRequest describeEventTrackerRequest)
throws InvalidInputException, ResourceNotFoundException, AwsServiceException, SdkClientException,
PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeEventTrackerResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeEventTrackerRequest,
this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeEventTracker").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(describeEventTrackerRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeEventTrackerRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Describes the given feature transformation.
*
*
* @param describeFeatureTransformationRequest
* @return Result of the DescribeFeatureTransformation operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.DescribeFeatureTransformation
* @see AWS API Documentation
*/
@Override
public DescribeFeatureTransformationResponse describeFeatureTransformation(
DescribeFeatureTransformationRequest describeFeatureTransformationRequest) throws InvalidInputException,
ResourceNotFoundException, AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeFeatureTransformationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeFeatureTransformationRequest,
this.clientConfiguration);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeFeatureTransformation").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(describeFeatureTransformationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeFeatureTransformationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Describes a filter's properties.
*
*
* @param describeFilterRequest
* @return Result of the DescribeFilter operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.DescribeFilter
* @see AWS
* API Documentation
*/
@Override
public DescribeFilterResponse describeFilter(DescribeFilterRequest describeFilterRequest) throws InvalidInputException,
ResourceNotFoundException, AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DescribeFilterResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeFilterRequest, this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeFilter").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(describeFilterRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeFilterRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Describes a metric attribution.
*
*
* @param describeMetricAttributionRequest
* @return Result of the DescribeMetricAttribution operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.DescribeMetricAttribution
* @see AWS API Documentation
*/
@Override
public DescribeMetricAttributionResponse describeMetricAttribution(
DescribeMetricAttributionRequest describeMetricAttributionRequest) throws InvalidInputException,
ResourceNotFoundException, AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeMetricAttributionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeMetricAttributionRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeMetricAttributionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeMetricAttribution");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeMetricAttribution").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(describeMetricAttributionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeMetricAttributionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the DescribeRecipe operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.DescribeRecipe
* @see AWS
* API Documentation
*/
@Override
public DescribeRecipeResponse describeRecipe(DescribeRecipeRequest describeRecipeRequest) throws InvalidInputException,
ResourceNotFoundException, AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DescribeRecipeResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeRecipeRequest, this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeRecipe").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(describeRecipeRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeRecipeRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the DescribeRecommender operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.DescribeRecommender
* @see AWS API Documentation
*/
@Override
public DescribeRecommenderResponse describeRecommender(DescribeRecommenderRequest describeRecommenderRequest)
throws InvalidInputException, ResourceNotFoundException, AwsServiceException, SdkClientException,
PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeRecommenderResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeRecommenderRequest,
this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeRecommender").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(describeRecommenderRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeRecommenderRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Describes a schema. For more information on schemas, see CreateSchema.
*
*
* @param describeSchemaRequest
* @return Result of the DescribeSchema operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.DescribeSchema
* @see AWS
* API Documentation
*/
@Override
public DescribeSchemaResponse describeSchema(DescribeSchemaRequest describeSchemaRequest) throws InvalidInputException,
ResourceNotFoundException, AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DescribeSchemaResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeSchemaRequest, this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeSchema").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(describeSchemaRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeSchemaRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Describes a solution. For more information on solutions, see CreateSolution.
*
*
* @param describeSolutionRequest
* @return Result of the DescribeSolution operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.DescribeSolution
* @see AWS
* API Documentation
*/
@Override
public DescribeSolutionResponse describeSolution(DescribeSolutionRequest describeSolutionRequest)
throws InvalidInputException, ResourceNotFoundException, AwsServiceException, SdkClientException,
PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DescribeSolutionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeSolutionRequest,
this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeSolution").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(describeSolutionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeSolutionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Describes a specific version of a solution. For more information on solutions, see CreateSolution
*
*
* @param describeSolutionVersionRequest
* @return Result of the DescribeSolutionVersion operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.DescribeSolutionVersion
* @see AWS API Documentation
*/
@Override
public DescribeSolutionVersionResponse describeSolutionVersion(DescribeSolutionVersionRequest describeSolutionVersionRequest)
throws InvalidInputException, ResourceNotFoundException, AwsServiceException, SdkClientException,
PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeSolutionVersionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeSolutionVersionRequest,
this.clientConfiguration);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeSolutionVersion").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(describeSolutionVersionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeSolutionVersionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Gets the metrics for the specified solution version.
*
*
* @param getSolutionMetricsRequest
* @return Result of the GetSolutionMetrics operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws ResourceInUseException
* The specified resource is in use.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.GetSolutionMetrics
* @see AWS API Documentation
*/
@Override
public GetSolutionMetricsResponse getSolutionMetrics(GetSolutionMetricsRequest getSolutionMetricsRequest)
throws InvalidInputException, ResourceNotFoundException, ResourceInUseException, AwsServiceException,
SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetSolutionMetricsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getSolutionMetricsRequest,
this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetSolutionMetrics").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getSolutionMetricsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetSolutionMetricsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Gets a list of the batch inference jobs that have been performed off of a solution version.
*
*
* @param listBatchInferenceJobsRequest
* @return Result of the ListBatchInferenceJobs operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws InvalidNextTokenException
* The token is not valid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.ListBatchInferenceJobs
* @see AWS API Documentation
*/
@Override
public ListBatchInferenceJobsResponse listBatchInferenceJobs(ListBatchInferenceJobsRequest listBatchInferenceJobsRequest)
throws InvalidInputException, InvalidNextTokenException, AwsServiceException, SdkClientException,
PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListBatchInferenceJobsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listBatchInferenceJobsRequest,
this.clientConfiguration);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListBatchInferenceJobs").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listBatchInferenceJobsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListBatchInferenceJobsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Gets a list of the batch segment jobs that have been performed off of a solution version that you specify.
*
*
* @param listBatchSegmentJobsRequest
* @return Result of the ListBatchSegmentJobs operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws InvalidNextTokenException
* The token is not valid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.ListBatchSegmentJobs
* @see AWS API Documentation
*/
@Override
public ListBatchSegmentJobsResponse listBatchSegmentJobs(ListBatchSegmentJobsRequest listBatchSegmentJobsRequest)
throws InvalidInputException, InvalidNextTokenException, AwsServiceException, SdkClientException,
PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListBatchSegmentJobsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listBatchSegmentJobsRequest,
this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListBatchSegmentJobs").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listBatchSegmentJobsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListBatchSegmentJobsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the ListCampaigns operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws InvalidNextTokenException
* The token is not valid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.ListCampaigns
* @see AWS API
* Documentation
*/
@Override
public ListCampaignsResponse listCampaigns(ListCampaignsRequest listCampaignsRequest) throws InvalidInputException,
InvalidNextTokenException, AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListCampaignsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listCampaignsRequest, this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListCampaigns").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listCampaignsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListCampaignsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns a list of data deletion jobs for a dataset group ordered by creation time, with the most recent first.
* When a dataset group is not specified, all the data deletion jobs associated with the account are listed. The
* response provides the properties for each job, including the Amazon Resource Name (ARN). For more information on
* data deletion jobs, see Deleting
* users.
*
*
* @param listDataDeletionJobsRequest
* @return Result of the ListDataDeletionJobs operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws InvalidNextTokenException
* The token is not valid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.ListDataDeletionJobs
* @see AWS API Documentation
*/
@Override
public ListDataDeletionJobsResponse listDataDeletionJobs(ListDataDeletionJobsRequest listDataDeletionJobsRequest)
throws InvalidInputException, InvalidNextTokenException, AwsServiceException, SdkClientException,
PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListDataDeletionJobsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listDataDeletionJobsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listDataDeletionJobsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListDataDeletionJobs");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListDataDeletionJobs").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listDataDeletionJobsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListDataDeletionJobsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the ListDatasetExportJobs operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws InvalidNextTokenException
* The token is not valid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.ListDatasetExportJobs
* @see AWS API Documentation
*/
@Override
public ListDatasetExportJobsResponse listDatasetExportJobs(ListDatasetExportJobsRequest listDatasetExportJobsRequest)
throws InvalidInputException, InvalidNextTokenException, AwsServiceException, SdkClientException,
PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListDatasetExportJobsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listDatasetExportJobsRequest,
this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListDatasetExportJobs").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listDatasetExportJobsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListDatasetExportJobsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the ListDatasetGroups operation returned by the service.
* @throws InvalidNextTokenException
* The token is not valid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.ListDatasetGroups
* @see AWS
* API Documentation
*/
@Override
public ListDatasetGroupsResponse listDatasetGroups(ListDatasetGroupsRequest listDatasetGroupsRequest)
throws InvalidNextTokenException, AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListDatasetGroupsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listDatasetGroupsRequest,
this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListDatasetGroups").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listDatasetGroupsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListDatasetGroupsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the ListDatasetImportJobs operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws InvalidNextTokenException
* The token is not valid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.ListDatasetImportJobs
* @see AWS API Documentation
*/
@Override
public ListDatasetImportJobsResponse listDatasetImportJobs(ListDatasetImportJobsRequest listDatasetImportJobsRequest)
throws InvalidInputException, InvalidNextTokenException, AwsServiceException, SdkClientException,
PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListDatasetImportJobsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listDatasetImportJobsRequest,
this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListDatasetImportJobs").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listDatasetImportJobsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListDatasetImportJobsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the ListDatasets operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws InvalidNextTokenException
* The token is not valid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.ListDatasets
* @see AWS API
* Documentation
*/
@Override
public ListDatasetsResponse listDatasets(ListDatasetsRequest listDatasetsRequest) throws InvalidInputException,
InvalidNextTokenException, AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListDatasetsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listDatasetsRequest, this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListDatasets").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listDatasetsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListDatasetsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the ListEventTrackers operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws InvalidNextTokenException
* The token is not valid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.ListEventTrackers
* @see AWS
* API Documentation
*/
@Override
public ListEventTrackersResponse listEventTrackers(ListEventTrackersRequest listEventTrackersRequest)
throws InvalidInputException, InvalidNextTokenException, AwsServiceException, SdkClientException,
PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListEventTrackersResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listEventTrackersRequest,
this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListEventTrackers").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listEventTrackersRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListEventTrackersRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists all filters that belong to a given dataset group.
*
*
* @param listFiltersRequest
* @return Result of the ListFilters operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws InvalidNextTokenException
* The token is not valid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.ListFilters
* @see AWS API
* Documentation
*/
@Override
public ListFiltersResponse listFilters(ListFiltersRequest listFiltersRequest) throws InvalidInputException,
InvalidNextTokenException, AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListFiltersResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listFiltersRequest, this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListFilters").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(listFiltersRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListFiltersRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists the metrics for the metric attribution.
*
*
* @param listMetricAttributionMetricsRequest
* @return Result of the ListMetricAttributionMetrics operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws InvalidNextTokenException
* The token is not valid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.ListMetricAttributionMetrics
* @see AWS API Documentation
*/
@Override
public ListMetricAttributionMetricsResponse listMetricAttributionMetrics(
ListMetricAttributionMetricsRequest listMetricAttributionMetricsRequest) throws InvalidInputException,
InvalidNextTokenException, AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListMetricAttributionMetricsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listMetricAttributionMetricsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listMetricAttributionMetricsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListMetricAttributionMetrics");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListMetricAttributionMetrics").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listMetricAttributionMetricsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListMetricAttributionMetricsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists metric attributions.
*
*
* @param listMetricAttributionsRequest
* @return Result of the ListMetricAttributions operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws InvalidNextTokenException
* The token is not valid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.ListMetricAttributions
* @see AWS API Documentation
*/
@Override
public ListMetricAttributionsResponse listMetricAttributions(ListMetricAttributionsRequest listMetricAttributionsRequest)
throws InvalidInputException, InvalidNextTokenException, AwsServiceException, SdkClientException,
PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListMetricAttributionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listMetricAttributionsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listMetricAttributionsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Personalize");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListMetricAttributions");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListMetricAttributions").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listMetricAttributionsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListMetricAttributionsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the ListRecipes operation returned by the service.
* @throws InvalidNextTokenException
* The token is not valid.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.ListRecipes
* @see AWS API
* Documentation
*/
@Override
public ListRecipesResponse listRecipes(ListRecipesRequest listRecipesRequest) throws InvalidNextTokenException,
InvalidInputException, AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListRecipesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listRecipesRequest, this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListRecipes").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(listRecipesRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListRecipesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the ListRecommenders operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws InvalidNextTokenException
* The token is not valid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.ListRecommenders
* @see AWS
* API Documentation
*/
@Override
public ListRecommendersResponse listRecommenders(ListRecommendersRequest listRecommendersRequest)
throws InvalidInputException, InvalidNextTokenException, AwsServiceException, SdkClientException,
PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListRecommendersResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listRecommendersRequest,
this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListRecommenders").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listRecommendersRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListRecommendersRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the ListSchemas operation returned by the service.
* @throws InvalidNextTokenException
* The token is not valid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.ListSchemas
* @see AWS API
* Documentation
*/
@Override
public ListSchemasResponse listSchemas(ListSchemasRequest listSchemasRequest) throws InvalidNextTokenException,
AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListSchemasResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listSchemasRequest, this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListSchemas").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(listSchemasRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListSchemasRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the ListSolutionVersions operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws InvalidNextTokenException
* The token is not valid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.ListSolutionVersions
* @see AWS API Documentation
*/
@Override
public ListSolutionVersionsResponse listSolutionVersions(ListSolutionVersionsRequest listSolutionVersionsRequest)
throws InvalidInputException, ResourceNotFoundException, InvalidNextTokenException, AwsServiceException,
SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListSolutionVersionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listSolutionVersionsRequest,
this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListSolutionVersions").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listSolutionVersionsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListSolutionVersionsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns a list of solutions in a 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 Result of the ListSolutions operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws InvalidNextTokenException
* The token is not valid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.ListSolutions
* @see AWS API
* Documentation
*/
@Override
public ListSolutionsResponse listSolutions(ListSolutionsRequest listSolutionsRequest) throws InvalidInputException,
InvalidNextTokenException, AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListSolutionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listSolutionsRequest, this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListSolutions").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listSolutionsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListSolutionsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Get a list of tags
* attached to a resource.
*
*
* @param listTagsForResourceRequest
* @return Result of the ListTagsForResource operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws ResourceInUseException
* The specified resource is in use.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.ListTagsForResource
* @see AWS API Documentation
*/
@Override
public ListTagsForResourceResponse listTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest)
throws InvalidInputException, ResourceNotFoundException, ResourceInUseException, AwsServiceException,
SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListTagsForResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listTagsForResourceRequest,
this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListTagsForResource").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listTagsForResourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListTagsForResourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the StartRecommender operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws ResourceInUseException
* The specified resource is in use.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.StartRecommender
* @see AWS
* API Documentation
*/
@Override
public StartRecommenderResponse startRecommender(StartRecommenderRequest startRecommenderRequest)
throws InvalidInputException, ResourceNotFoundException, ResourceInUseException, AwsServiceException,
SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
StartRecommenderResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(startRecommenderRequest,
this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("StartRecommender").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(startRecommenderRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new StartRecommenderRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Stops a recommender that is ACTIVE. Stopping a recommender halts billing and automatic retraining for the
* recommender.
*
*
* @param stopRecommenderRequest
* @return Result of the StopRecommender operation returned by the service.
* @throws InvalidInputException
* Provide a valid value for the field or parameter.
* @throws ResourceNotFoundException
* Could not find the specified resource.
* @throws ResourceInUseException
* The specified resource is in use.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PersonalizeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PersonalizeClient.StopRecommender
* @see AWS
* API Documentation
*/
@Override
public StopRecommenderResponse stopRecommender(StopRecommenderRequest stopRecommenderRequest) throws InvalidInputException,
ResourceNotFoundException, ResourceInUseException, AwsServiceException, SdkClientException, PersonalizeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
StopRecommenderResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(stopRecommenderRequest,
this.clientConfiguration);
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");
return clientHandler.execute(new ClientExecutionParams