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

software.amazon.awssdk.services.machinelearning.DefaultMachineLearningClient Maven / Gradle / Ivy

/*
 * Copyright 2014-2019 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.machinelearning;

import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.core.ApiName;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
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.util.VersionInfo;
import software.amazon.awssdk.protocols.core.ExceptionMetadata;
import software.amazon.awssdk.protocols.json.AwsJsonProtocol;
import software.amazon.awssdk.protocols.json.AwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.JsonOperationMetadata;
import software.amazon.awssdk.services.machinelearning.model.AddTagsRequest;
import software.amazon.awssdk.services.machinelearning.model.AddTagsResponse;
import software.amazon.awssdk.services.machinelearning.model.CreateBatchPredictionRequest;
import software.amazon.awssdk.services.machinelearning.model.CreateBatchPredictionResponse;
import software.amazon.awssdk.services.machinelearning.model.CreateDataSourceFromRdsRequest;
import software.amazon.awssdk.services.machinelearning.model.CreateDataSourceFromRdsResponse;
import software.amazon.awssdk.services.machinelearning.model.CreateDataSourceFromRedshiftRequest;
import software.amazon.awssdk.services.machinelearning.model.CreateDataSourceFromRedshiftResponse;
import software.amazon.awssdk.services.machinelearning.model.CreateDataSourceFromS3Request;
import software.amazon.awssdk.services.machinelearning.model.CreateDataSourceFromS3Response;
import software.amazon.awssdk.services.machinelearning.model.CreateEvaluationRequest;
import software.amazon.awssdk.services.machinelearning.model.CreateEvaluationResponse;
import software.amazon.awssdk.services.machinelearning.model.CreateMlModelRequest;
import software.amazon.awssdk.services.machinelearning.model.CreateMlModelResponse;
import software.amazon.awssdk.services.machinelearning.model.CreateRealtimeEndpointRequest;
import software.amazon.awssdk.services.machinelearning.model.CreateRealtimeEndpointResponse;
import software.amazon.awssdk.services.machinelearning.model.DeleteBatchPredictionRequest;
import software.amazon.awssdk.services.machinelearning.model.DeleteBatchPredictionResponse;
import software.amazon.awssdk.services.machinelearning.model.DeleteDataSourceRequest;
import software.amazon.awssdk.services.machinelearning.model.DeleteDataSourceResponse;
import software.amazon.awssdk.services.machinelearning.model.DeleteEvaluationRequest;
import software.amazon.awssdk.services.machinelearning.model.DeleteEvaluationResponse;
import software.amazon.awssdk.services.machinelearning.model.DeleteMlModelRequest;
import software.amazon.awssdk.services.machinelearning.model.DeleteMlModelResponse;
import software.amazon.awssdk.services.machinelearning.model.DeleteRealtimeEndpointRequest;
import software.amazon.awssdk.services.machinelearning.model.DeleteRealtimeEndpointResponse;
import software.amazon.awssdk.services.machinelearning.model.DeleteTagsRequest;
import software.amazon.awssdk.services.machinelearning.model.DeleteTagsResponse;
import software.amazon.awssdk.services.machinelearning.model.DescribeBatchPredictionsRequest;
import software.amazon.awssdk.services.machinelearning.model.DescribeBatchPredictionsResponse;
import software.amazon.awssdk.services.machinelearning.model.DescribeDataSourcesRequest;
import software.amazon.awssdk.services.machinelearning.model.DescribeDataSourcesResponse;
import software.amazon.awssdk.services.machinelearning.model.DescribeEvaluationsRequest;
import software.amazon.awssdk.services.machinelearning.model.DescribeEvaluationsResponse;
import software.amazon.awssdk.services.machinelearning.model.DescribeMlModelsRequest;
import software.amazon.awssdk.services.machinelearning.model.DescribeMlModelsResponse;
import software.amazon.awssdk.services.machinelearning.model.DescribeTagsRequest;
import software.amazon.awssdk.services.machinelearning.model.DescribeTagsResponse;
import software.amazon.awssdk.services.machinelearning.model.GetBatchPredictionRequest;
import software.amazon.awssdk.services.machinelearning.model.GetBatchPredictionResponse;
import software.amazon.awssdk.services.machinelearning.model.GetDataSourceRequest;
import software.amazon.awssdk.services.machinelearning.model.GetDataSourceResponse;
import software.amazon.awssdk.services.machinelearning.model.GetEvaluationRequest;
import software.amazon.awssdk.services.machinelearning.model.GetEvaluationResponse;
import software.amazon.awssdk.services.machinelearning.model.GetMlModelRequest;
import software.amazon.awssdk.services.machinelearning.model.GetMlModelResponse;
import software.amazon.awssdk.services.machinelearning.model.IdempotentParameterMismatchException;
import software.amazon.awssdk.services.machinelearning.model.InternalServerException;
import software.amazon.awssdk.services.machinelearning.model.InvalidInputException;
import software.amazon.awssdk.services.machinelearning.model.InvalidTagException;
import software.amazon.awssdk.services.machinelearning.model.LimitExceededException;
import software.amazon.awssdk.services.machinelearning.model.MachineLearningException;
import software.amazon.awssdk.services.machinelearning.model.MachineLearningRequest;
import software.amazon.awssdk.services.machinelearning.model.PredictRequest;
import software.amazon.awssdk.services.machinelearning.model.PredictResponse;
import software.amazon.awssdk.services.machinelearning.model.PredictorNotMountedException;
import software.amazon.awssdk.services.machinelearning.model.ResourceNotFoundException;
import software.amazon.awssdk.services.machinelearning.model.TagLimitExceededException;
import software.amazon.awssdk.services.machinelearning.model.UpdateBatchPredictionRequest;
import software.amazon.awssdk.services.machinelearning.model.UpdateBatchPredictionResponse;
import software.amazon.awssdk.services.machinelearning.model.UpdateDataSourceRequest;
import software.amazon.awssdk.services.machinelearning.model.UpdateDataSourceResponse;
import software.amazon.awssdk.services.machinelearning.model.UpdateEvaluationRequest;
import software.amazon.awssdk.services.machinelearning.model.UpdateEvaluationResponse;
import software.amazon.awssdk.services.machinelearning.model.UpdateMlModelRequest;
import software.amazon.awssdk.services.machinelearning.model.UpdateMlModelResponse;
import software.amazon.awssdk.services.machinelearning.paginators.DescribeBatchPredictionsIterable;
import software.amazon.awssdk.services.machinelearning.paginators.DescribeDataSourcesIterable;
import software.amazon.awssdk.services.machinelearning.paginators.DescribeEvaluationsIterable;
import software.amazon.awssdk.services.machinelearning.paginators.DescribeMLModelsIterable;
import software.amazon.awssdk.services.machinelearning.transform.AddTagsRequestMarshaller;
import software.amazon.awssdk.services.machinelearning.transform.CreateBatchPredictionRequestMarshaller;
import software.amazon.awssdk.services.machinelearning.transform.CreateDataSourceFromRdsRequestMarshaller;
import software.amazon.awssdk.services.machinelearning.transform.CreateDataSourceFromRedshiftRequestMarshaller;
import software.amazon.awssdk.services.machinelearning.transform.CreateDataSourceFromS3RequestMarshaller;
import software.amazon.awssdk.services.machinelearning.transform.CreateEvaluationRequestMarshaller;
import software.amazon.awssdk.services.machinelearning.transform.CreateMlModelRequestMarshaller;
import software.amazon.awssdk.services.machinelearning.transform.CreateRealtimeEndpointRequestMarshaller;
import software.amazon.awssdk.services.machinelearning.transform.DeleteBatchPredictionRequestMarshaller;
import software.amazon.awssdk.services.machinelearning.transform.DeleteDataSourceRequestMarshaller;
import software.amazon.awssdk.services.machinelearning.transform.DeleteEvaluationRequestMarshaller;
import software.amazon.awssdk.services.machinelearning.transform.DeleteMlModelRequestMarshaller;
import software.amazon.awssdk.services.machinelearning.transform.DeleteRealtimeEndpointRequestMarshaller;
import software.amazon.awssdk.services.machinelearning.transform.DeleteTagsRequestMarshaller;
import software.amazon.awssdk.services.machinelearning.transform.DescribeBatchPredictionsRequestMarshaller;
import software.amazon.awssdk.services.machinelearning.transform.DescribeDataSourcesRequestMarshaller;
import software.amazon.awssdk.services.machinelearning.transform.DescribeEvaluationsRequestMarshaller;
import software.amazon.awssdk.services.machinelearning.transform.DescribeMlModelsRequestMarshaller;
import software.amazon.awssdk.services.machinelearning.transform.DescribeTagsRequestMarshaller;
import software.amazon.awssdk.services.machinelearning.transform.GetBatchPredictionRequestMarshaller;
import software.amazon.awssdk.services.machinelearning.transform.GetDataSourceRequestMarshaller;
import software.amazon.awssdk.services.machinelearning.transform.GetEvaluationRequestMarshaller;
import software.amazon.awssdk.services.machinelearning.transform.GetMlModelRequestMarshaller;
import software.amazon.awssdk.services.machinelearning.transform.PredictRequestMarshaller;
import software.amazon.awssdk.services.machinelearning.transform.UpdateBatchPredictionRequestMarshaller;
import software.amazon.awssdk.services.machinelearning.transform.UpdateDataSourceRequestMarshaller;
import software.amazon.awssdk.services.machinelearning.transform.UpdateEvaluationRequestMarshaller;
import software.amazon.awssdk.services.machinelearning.transform.UpdateMlModelRequestMarshaller;

/**
 * Internal implementation of {@link MachineLearningClient}.
 *
 * @see MachineLearningClient#builder()
 */
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultMachineLearningClient implements MachineLearningClient {
    private final SyncClientHandler clientHandler;

    private final AwsJsonProtocolFactory protocolFactory;

    private final SdkClientConfiguration clientConfiguration;

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

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

    /**
     * 

* Adds one or more tags to an object, up to a limit of 10. Each tag consists of a key and an optional value. If you * add a tag using a key that is already associated with the ML object, AddTags updates the tag's * value. *

* * @param addTagsRequest * @return Result of the AddTags operation returned by the service. * @throws InvalidInputException * An error on the client occurred. Typically, the cause is an invalid input value. * @throws InvalidTagException * @throws TagLimitExceededException * @throws ResourceNotFoundException * A specified resource cannot be located. * @throws InternalServerException * An error on the server occurred when trying to process a request. * @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 MachineLearningException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MachineLearningClient.AddTags */ @Override public AddTagsResponse addTags(AddTagsRequest addTagsRequest) throws InvalidInputException, InvalidTagException, TagLimitExceededException, ResourceNotFoundException, InternalServerException, AwsServiceException, SdkClientException, MachineLearningException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, AddTagsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams().withOperationName("AddTags") .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler).withInput(addTagsRequest) .withMarshaller(new AddTagsRequestMarshaller(protocolFactory))); } /** *

* Generates predictions for a group of observations. The observations to process exist in one or more data files * referenced by a DataSource. This operation creates a new BatchPrediction, and uses an * MLModel and the data files referenced by the DataSource as information sources. *

*

* CreateBatchPrediction is an asynchronous operation. In response to * CreateBatchPrediction, Amazon Machine Learning (Amazon ML) immediately returns and sets the * BatchPrediction status to PENDING. After the BatchPrediction completes, * Amazon ML sets the status to COMPLETED. *

*

* You can poll for status updates by using the GetBatchPrediction operation and checking the * Status parameter of the result. After the COMPLETED status appears, the results are * available in the location specified by the OutputUri parameter. *

* * @param createBatchPredictionRequest * @return Result of the CreateBatchPrediction operation returned by the service. * @throws InvalidInputException * An error on the client occurred. Typically, the cause is an invalid input value. * @throws InternalServerException * An error on the server occurred when trying to process a request. * @throws IdempotentParameterMismatchException * A second request to use or change an object was not allowed. This can result from retrying a request * using a parameter that was not present in the original request. * @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 MachineLearningException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MachineLearningClient.CreateBatchPrediction */ @Override public CreateBatchPredictionResponse createBatchPrediction(CreateBatchPredictionRequest createBatchPredictionRequest) throws InvalidInputException, InternalServerException, IdempotentParameterMismatchException, AwsServiceException, SdkClientException, MachineLearningException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateBatchPredictionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("CreateBatchPrediction").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(createBatchPredictionRequest) .withMarshaller(new CreateBatchPredictionRequestMarshaller(protocolFactory))); } /** *

* Creates a DataSource object from an Amazon Relational Database * Service (Amazon RDS). A DataSource references data that can be used to perform * CreateMLModel, CreateEvaluation, or CreateBatchPrediction operations. *

*

* CreateDataSourceFromRDS is an asynchronous operation. In response to * CreateDataSourceFromRDS, Amazon Machine Learning (Amazon ML) immediately returns and sets the * DataSource status to PENDING. After the DataSource is created and ready * for use, Amazon ML sets the Status parameter to COMPLETED. DataSource in * the COMPLETED or PENDING state can be used only to perform * >CreateMLModel>, CreateEvaluation, or CreateBatchPrediction * operations. *

*

* If Amazon ML cannot accept the input source, it sets the Status parameter to FAILED and * includes an error message in the Message attribute of the GetDataSource operation * response. *

* * @param createDataSourceFromRdsRequest * @return Result of the CreateDataSourceFromRDS operation returned by the service. * @throws InvalidInputException * An error on the client occurred. Typically, the cause is an invalid input value. * @throws InternalServerException * An error on the server occurred when trying to process a request. * @throws IdempotentParameterMismatchException * A second request to use or change an object was not allowed. This can result from retrying a request * using a parameter that was not present in the original request. * @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 MachineLearningException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MachineLearningClient.CreateDataSourceFromRDS */ @Override public CreateDataSourceFromRdsResponse createDataSourceFromRDS(CreateDataSourceFromRdsRequest createDataSourceFromRdsRequest) throws InvalidInputException, InternalServerException, IdempotentParameterMismatchException, AwsServiceException, SdkClientException, MachineLearningException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateDataSourceFromRdsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("CreateDataSourceFromRDS").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(createDataSourceFromRdsRequest) .withMarshaller(new CreateDataSourceFromRdsRequestMarshaller(protocolFactory))); } /** *

* Creates a DataSource from a database hosted on an Amazon Redshift cluster. A DataSource * references data that can be used to perform either CreateMLModel, CreateEvaluation, or * CreateBatchPrediction operations. *

*

* CreateDataSourceFromRedshift is an asynchronous operation. In response to * CreateDataSourceFromRedshift, Amazon Machine Learning (Amazon ML) immediately returns and sets the * DataSource status to PENDING. After the DataSource is created and ready * for use, Amazon ML sets the Status parameter to COMPLETED. DataSource in * COMPLETED or PENDING states can be used to perform only CreateMLModel, * CreateEvaluation, or CreateBatchPrediction operations. *

*

* If Amazon ML can't accept the input source, it sets the Status parameter to FAILED and * includes an error message in the Message attribute of the GetDataSource operation * response. *

*

* The observations should be contained in the database hosted on an Amazon Redshift cluster and should be specified * by a SelectSqlQuery query. Amazon ML executes an Unload command in Amazon Redshift to * transfer the result set of the SelectSqlQuery query to S3StagingLocation. *

*

* After the DataSource has been created, it's ready for use in evaluations and batch predictions. If * you plan to use the DataSource to train an MLModel, the DataSource also * requires a recipe. A recipe describes how each input variable will be used in training an MLModel. * Will the variable be included or excluded from training? Will the variable be manipulated; for example, will it * be combined with another variable or will it be split apart into word combinations? The recipe provides answers * to these questions. *

* *

* You can't change an existing datasource, but you can copy and modify the settings from an existing Amazon * Redshift datasource to create a new datasource. To do so, call GetDataSource for an existing * datasource and copy the values to a CreateDataSource call. Change the settings that you want to * change and make sure that all required fields have the appropriate values. *

* * * @param createDataSourceFromRedshiftRequest * @return Result of the CreateDataSourceFromRedshift operation returned by the service. * @throws InvalidInputException * An error on the client occurred. Typically, the cause is an invalid input value. * @throws InternalServerException * An error on the server occurred when trying to process a request. * @throws IdempotentParameterMismatchException * A second request to use or change an object was not allowed. This can result from retrying a request * using a parameter that was not present in the original request. * @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 MachineLearningException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MachineLearningClient.CreateDataSourceFromRedshift */ @Override public CreateDataSourceFromRedshiftResponse createDataSourceFromRedshift( CreateDataSourceFromRedshiftRequest createDataSourceFromRedshiftRequest) throws InvalidInputException, InternalServerException, IdempotentParameterMismatchException, AwsServiceException, SdkClientException, MachineLearningException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateDataSourceFromRedshiftResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateDataSourceFromRedshift").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(createDataSourceFromRedshiftRequest) .withMarshaller(new CreateDataSourceFromRedshiftRequestMarshaller(protocolFactory))); } /** *

* Creates a DataSource object. A DataSource references data that can be used to perform * CreateMLModel, CreateEvaluation, or CreateBatchPrediction operations. *

*

* CreateDataSourceFromS3 is an asynchronous operation. In response to * CreateDataSourceFromS3, Amazon Machine Learning (Amazon ML) immediately returns and sets the * DataSource status to PENDING. After the DataSource has been created and is * ready for use, Amazon ML sets the Status parameter to COMPLETED. * DataSource in the COMPLETED or PENDING state can be used to perform only * CreateMLModel, CreateEvaluation or CreateBatchPrediction operations. *

*

* If Amazon ML can't accept the input source, it sets the Status parameter to FAILED and * includes an error message in the Message attribute of the GetDataSource operation * response. *

*

* The observation data used in a DataSource should be ready to use; that is, it should have a * consistent structure, and missing data values should be kept to a minimum. The observation data must reside in * one or more .csv files in an Amazon Simple Storage Service (Amazon S3) location, along with a schema that * describes the data items by name and type. The same schema must be used for all of the data files referenced by * the DataSource. *

*

* After the DataSource has been created, it's ready to use in evaluations and batch predictions. If * you plan to use the DataSource to train an MLModel, the DataSource also * needs a recipe. A recipe describes how each input variable will be used in training an MLModel. Will * the variable be included or excluded from training? Will the variable be manipulated; for example, will it be * combined with another variable or will it be split apart into word combinations? The recipe provides answers to * these questions. *

* * @param createDataSourceFromS3Request * @return Result of the CreateDataSourceFromS3 operation returned by the service. * @throws InvalidInputException * An error on the client occurred. Typically, the cause is an invalid input value. * @throws InternalServerException * An error on the server occurred when trying to process a request. * @throws IdempotentParameterMismatchException * A second request to use or change an object was not allowed. This can result from retrying a request * using a parameter that was not present in the original request. * @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 MachineLearningException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MachineLearningClient.CreateDataSourceFromS3 */ @Override public CreateDataSourceFromS3Response createDataSourceFromS3(CreateDataSourceFromS3Request createDataSourceFromS3Request) throws InvalidInputException, InternalServerException, IdempotentParameterMismatchException, AwsServiceException, SdkClientException, MachineLearningException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateDataSourceFromS3Response::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("CreateDataSourceFromS3").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(createDataSourceFromS3Request) .withMarshaller(new CreateDataSourceFromS3RequestMarshaller(protocolFactory))); } /** *

* Creates a new Evaluation of an MLModel. An MLModel is evaluated on a set * of observations associated to a DataSource. Like a DataSource for an * MLModel, the DataSource for an Evaluation contains values for the * Target Variable. The Evaluation compares the predicted result for each observation to * the actual outcome and provides a summary so that you know how effective the MLModel functions on * the test data. Evaluation generates a relevant performance metric, such as BinaryAUC, RegressionRMSE or * MulticlassAvgFScore based on the corresponding MLModelType: BINARY, * REGRESSION or MULTICLASS. *

*

* CreateEvaluation is an asynchronous operation. In response to CreateEvaluation, Amazon * Machine Learning (Amazon ML) immediately returns and sets the evaluation status to PENDING. After * the Evaluation is created and ready for use, Amazon ML sets the status to COMPLETED. *

*

* You can use the GetEvaluation operation to check progress of the evaluation during the creation * operation. *

* * @param createEvaluationRequest * @return Result of the CreateEvaluation operation returned by the service. * @throws InvalidInputException * An error on the client occurred. Typically, the cause is an invalid input value. * @throws InternalServerException * An error on the server occurred when trying to process a request. * @throws IdempotentParameterMismatchException * A second request to use or change an object was not allowed. This can result from retrying a request * using a parameter that was not present in the original request. * @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 MachineLearningException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MachineLearningClient.CreateEvaluation */ @Override public CreateEvaluationResponse createEvaluation(CreateEvaluationRequest createEvaluationRequest) throws InvalidInputException, InternalServerException, IdempotentParameterMismatchException, AwsServiceException, SdkClientException, MachineLearningException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateEvaluationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("CreateEvaluation").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(createEvaluationRequest) .withMarshaller(new CreateEvaluationRequestMarshaller(protocolFactory))); } /** *

* Creates a new MLModel using the DataSource and the recipe as information sources. *

*

* An MLModel is nearly immutable. Users can update only the MLModelName and the * ScoreThreshold in an MLModel without creating a new MLModel. *

*

* CreateMLModel is an asynchronous operation. In response to CreateMLModel, Amazon * Machine Learning (Amazon ML) immediately returns and sets the MLModel status to PENDING * . After the MLModel has been created and ready is for use, Amazon ML sets the status to * COMPLETED. *

*

* You can use the GetMLModel operation to check the progress of the MLModel during the * creation operation. *

*

* CreateMLModel requires a DataSource with computed statistics, which can be created by * setting ComputeStatistics to true in CreateDataSourceFromRDS, * CreateDataSourceFromS3, or CreateDataSourceFromRedshift operations. *

* * @param createMlModelRequest * @return Result of the CreateMLModel operation returned by the service. * @throws InvalidInputException * An error on the client occurred. Typically, the cause is an invalid input value. * @throws InternalServerException * An error on the server occurred when trying to process a request. * @throws IdempotentParameterMismatchException * A second request to use or change an object was not allowed. This can result from retrying a request * using a parameter that was not present in the original request. * @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 MachineLearningException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MachineLearningClient.CreateMLModel */ @Override public CreateMlModelResponse createMLModel(CreateMlModelRequest createMlModelRequest) throws InvalidInputException, InternalServerException, IdempotentParameterMismatchException, AwsServiceException, SdkClientException, MachineLearningException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateMlModelResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("CreateMLModel").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(createMlModelRequest) .withMarshaller(new CreateMlModelRequestMarshaller(protocolFactory))); } /** *

* Creates a real-time endpoint for the MLModel. The endpoint contains the URI of the * MLModel; that is, the location to send real-time prediction requests for the specified * MLModel. *

* * @param createRealtimeEndpointRequest * @return Result of the CreateRealtimeEndpoint operation returned by the service. * @throws InvalidInputException * An error on the client occurred. Typically, the cause is an invalid input value. * @throws ResourceNotFoundException * A specified resource cannot be located. * @throws InternalServerException * An error on the server occurred when trying to process a request. * @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 MachineLearningException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MachineLearningClient.CreateRealtimeEndpoint */ @Override public CreateRealtimeEndpointResponse createRealtimeEndpoint(CreateRealtimeEndpointRequest createRealtimeEndpointRequest) throws InvalidInputException, ResourceNotFoundException, InternalServerException, AwsServiceException, SdkClientException, MachineLearningException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateRealtimeEndpointResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("CreateRealtimeEndpoint").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(createRealtimeEndpointRequest) .withMarshaller(new CreateRealtimeEndpointRequestMarshaller(protocolFactory))); } /** *

* Assigns the DELETED status to a BatchPrediction, rendering it unusable. *

*

* After using the DeleteBatchPrediction operation, you can use the GetBatchPrediction operation * to verify that the status of the BatchPrediction changed to DELETED. *

*

* Caution: The result of the DeleteBatchPrediction operation is irreversible. *

* * @param deleteBatchPredictionRequest * @return Result of the DeleteBatchPrediction operation returned by the service. * @throws InvalidInputException * An error on the client occurred. Typically, the cause is an invalid input value. * @throws ResourceNotFoundException * A specified resource cannot be located. * @throws InternalServerException * An error on the server occurred when trying to process a request. * @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 MachineLearningException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MachineLearningClient.DeleteBatchPrediction */ @Override public DeleteBatchPredictionResponse deleteBatchPrediction(DeleteBatchPredictionRequest deleteBatchPredictionRequest) throws InvalidInputException, ResourceNotFoundException, InternalServerException, AwsServiceException, SdkClientException, MachineLearningException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteBatchPredictionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteBatchPrediction").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(deleteBatchPredictionRequest) .withMarshaller(new DeleteBatchPredictionRequestMarshaller(protocolFactory))); } /** *

* Assigns the DELETED status to a DataSource, rendering it unusable. *

*

* After using the DeleteDataSource operation, you can use the GetDataSource operation to verify * that the status of the DataSource changed to DELETED. *

*

* Caution: The results of the DeleteDataSource operation are irreversible. *

* * @param deleteDataSourceRequest * @return Result of the DeleteDataSource operation returned by the service. * @throws InvalidInputException * An error on the client occurred. Typically, the cause is an invalid input value. * @throws ResourceNotFoundException * A specified resource cannot be located. * @throws InternalServerException * An error on the server occurred when trying to process a request. * @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 MachineLearningException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MachineLearningClient.DeleteDataSource */ @Override public DeleteDataSourceResponse deleteDataSource(DeleteDataSourceRequest deleteDataSourceRequest) throws InvalidInputException, ResourceNotFoundException, InternalServerException, AwsServiceException, SdkClientException, MachineLearningException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteDataSourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteDataSource").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(deleteDataSourceRequest) .withMarshaller(new DeleteDataSourceRequestMarshaller(protocolFactory))); } /** *

* Assigns the DELETED status to an Evaluation, rendering it unusable. *

*

* After invoking the DeleteEvaluation operation, you can use the GetEvaluation operation * to verify that the status of the Evaluation changed to DELETED. *

* Caution *

* The results of the DeleteEvaluation operation are irreversible. *

*
* * @param deleteEvaluationRequest * @return Result of the DeleteEvaluation operation returned by the service. * @throws InvalidInputException * An error on the client occurred. Typically, the cause is an invalid input value. * @throws ResourceNotFoundException * A specified resource cannot be located. * @throws InternalServerException * An error on the server occurred when trying to process a request. * @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 MachineLearningException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MachineLearningClient.DeleteEvaluation */ @Override public DeleteEvaluationResponse deleteEvaluation(DeleteEvaluationRequest deleteEvaluationRequest) throws InvalidInputException, ResourceNotFoundException, InternalServerException, AwsServiceException, SdkClientException, MachineLearningException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteEvaluationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteEvaluation").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(deleteEvaluationRequest) .withMarshaller(new DeleteEvaluationRequestMarshaller(protocolFactory))); } /** *

* Assigns the DELETED status to an MLModel, rendering it unusable. *

*

* After using the DeleteMLModel operation, you can use the GetMLModel operation to verify * that the status of the MLModel changed to DELETED. *

*

* Caution: The result of the DeleteMLModel operation is irreversible. *

* * @param deleteMlModelRequest * @return Result of the DeleteMLModel operation returned by the service. * @throws InvalidInputException * An error on the client occurred. Typically, the cause is an invalid input value. * @throws ResourceNotFoundException * A specified resource cannot be located. * @throws InternalServerException * An error on the server occurred when trying to process a request. * @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 MachineLearningException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MachineLearningClient.DeleteMLModel */ @Override public DeleteMlModelResponse deleteMLModel(DeleteMlModelRequest deleteMlModelRequest) throws InvalidInputException, ResourceNotFoundException, InternalServerException, AwsServiceException, SdkClientException, MachineLearningException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteMlModelResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteMLModel").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(deleteMlModelRequest) .withMarshaller(new DeleteMlModelRequestMarshaller(protocolFactory))); } /** *

* Deletes a real time endpoint of an MLModel. *

* * @param deleteRealtimeEndpointRequest * @return Result of the DeleteRealtimeEndpoint operation returned by the service. * @throws InvalidInputException * An error on the client occurred. Typically, the cause is an invalid input value. * @throws ResourceNotFoundException * A specified resource cannot be located. * @throws InternalServerException * An error on the server occurred when trying to process a request. * @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 MachineLearningException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MachineLearningClient.DeleteRealtimeEndpoint */ @Override public DeleteRealtimeEndpointResponse deleteRealtimeEndpoint(DeleteRealtimeEndpointRequest deleteRealtimeEndpointRequest) throws InvalidInputException, ResourceNotFoundException, InternalServerException, AwsServiceException, SdkClientException, MachineLearningException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteRealtimeEndpointResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteRealtimeEndpoint").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(deleteRealtimeEndpointRequest) .withMarshaller(new DeleteRealtimeEndpointRequestMarshaller(protocolFactory))); } /** *

* Deletes the specified tags associated with an ML object. After this operation is complete, you can't recover * deleted tags. *

*

* If you specify a tag that doesn't exist, Amazon ML ignores it. *

* * @param deleteTagsRequest * @return Result of the DeleteTags operation returned by the service. * @throws InvalidInputException * An error on the client occurred. Typically, the cause is an invalid input value. * @throws InvalidTagException * @throws ResourceNotFoundException * A specified resource cannot be located. * @throws InternalServerException * An error on the server occurred when trying to process a request. * @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 MachineLearningException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MachineLearningClient.DeleteTags */ @Override public DeleteTagsResponse deleteTags(DeleteTagsRequest deleteTagsRequest) throws InvalidInputException, InvalidTagException, ResourceNotFoundException, InternalServerException, AwsServiceException, SdkClientException, MachineLearningException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteTagsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteTags").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(deleteTagsRequest) .withMarshaller(new DeleteTagsRequestMarshaller(protocolFactory))); } /** *

* Returns a list of BatchPrediction operations that match the search criteria in the request. *

* * @param describeBatchPredictionsRequest * @return Result of the DescribeBatchPredictions operation returned by the service. * @throws InvalidInputException * An error on the client occurred. Typically, the cause is an invalid input value. * @throws InternalServerException * An error on the server occurred when trying to process a request. * @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 MachineLearningException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MachineLearningClient.DescribeBatchPredictions */ @Override public DescribeBatchPredictionsResponse describeBatchPredictions( DescribeBatchPredictionsRequest describeBatchPredictionsRequest) throws InvalidInputException, InternalServerException, AwsServiceException, SdkClientException, MachineLearningException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeBatchPredictionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeBatchPredictions").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(describeBatchPredictionsRequest) .withMarshaller(new DescribeBatchPredictionsRequestMarshaller(protocolFactory))); } /** *

* Returns a list of BatchPrediction operations that match the search criteria in the request. *

*
*

* This is a variant of * {@link #describeBatchPredictions(software.amazon.awssdk.services.machinelearning.model.DescribeBatchPredictionsRequest)} * operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will * internally handle making service calls for you. *

*

* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no * guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response * pages by making service calls until there are no pages left or your iteration stops. If there are errors in your * request, you will see the failures only after you start iterating through the iterable. *

* *

* The following are few ways to iterate through the response pages: *

* 1) Using a Stream * *
     * {@code
     * software.amazon.awssdk.services.machinelearning.paginators.DescribeBatchPredictionsIterable responses = client.describeBatchPredictionsPaginator(request);
     * responses.stream().forEach(....);
     * }
     * 
* * 2) Using For loop * *
     * {
     *     @code
     *     software.amazon.awssdk.services.machinelearning.paginators.DescribeBatchPredictionsIterable responses = client
     *             .describeBatchPredictionsPaginator(request);
     *     for (software.amazon.awssdk.services.machinelearning.model.DescribeBatchPredictionsResponse response : responses) {
     *         // do something;
     *     }
     * }
     * 
* * 3) Use iterator directly * *
     * {@code
     * software.amazon.awssdk.services.machinelearning.paginators.DescribeBatchPredictionsIterable responses = client.describeBatchPredictionsPaginator(request);
     * responses.iterator().forEachRemaining(....);
     * }
     * 
*

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

* * @param describeBatchPredictionsRequest * @return A custom iterable that can be used to iterate through all the response pages. * @throws InvalidInputException * An error on the client occurred. Typically, the cause is an invalid input value. * @throws InternalServerException * An error on the server occurred when trying to process a request. * @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 MachineLearningException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MachineLearningClient.DescribeBatchPredictions */ @Override public DescribeBatchPredictionsIterable describeBatchPredictionsPaginator( DescribeBatchPredictionsRequest describeBatchPredictionsRequest) throws InvalidInputException, InternalServerException, AwsServiceException, SdkClientException, MachineLearningException { return new DescribeBatchPredictionsIterable(this, applyPaginatorUserAgent(describeBatchPredictionsRequest)); } /** *

* Returns a list of DataSource that match the search criteria in the request. *

* * @param describeDataSourcesRequest * @return Result of the DescribeDataSources operation returned by the service. * @throws InvalidInputException * An error on the client occurred. Typically, the cause is an invalid input value. * @throws InternalServerException * An error on the server occurred when trying to process a request. * @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 MachineLearningException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MachineLearningClient.DescribeDataSources */ @Override public DescribeDataSourcesResponse describeDataSources(DescribeDataSourcesRequest describeDataSourcesRequest) throws InvalidInputException, InternalServerException, AwsServiceException, SdkClientException, MachineLearningException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeDataSourcesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DescribeDataSources").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(describeDataSourcesRequest) .withMarshaller(new DescribeDataSourcesRequestMarshaller(protocolFactory))); } /** *

* Returns a list of DataSource that match the search criteria in the request. *

*
*

* This is a variant of * {@link #describeDataSources(software.amazon.awssdk.services.machinelearning.model.DescribeDataSourcesRequest)} * operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will * internally handle making service calls for you. *

*

* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no * guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response * pages by making service calls until there are no pages left or your iteration stops. If there are errors in your * request, you will see the failures only after you start iterating through the iterable. *

* *

* The following are few ways to iterate through the response pages: *

* 1) Using a Stream * *
     * {@code
     * software.amazon.awssdk.services.machinelearning.paginators.DescribeDataSourcesIterable responses = client.describeDataSourcesPaginator(request);
     * responses.stream().forEach(....);
     * }
     * 
* * 2) Using For loop * *
     * {
     *     @code
     *     software.amazon.awssdk.services.machinelearning.paginators.DescribeDataSourcesIterable responses = client
     *             .describeDataSourcesPaginator(request);
     *     for (software.amazon.awssdk.services.machinelearning.model.DescribeDataSourcesResponse response : responses) {
     *         // do something;
     *     }
     * }
     * 
* * 3) Use iterator directly * *
     * {@code
     * software.amazon.awssdk.services.machinelearning.paginators.DescribeDataSourcesIterable responses = client.describeDataSourcesPaginator(request);
     * responses.iterator().forEachRemaining(....);
     * }
     * 
*

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

* * @param describeDataSourcesRequest * @return A custom iterable that can be used to iterate through all the response pages. * @throws InvalidInputException * An error on the client occurred. Typically, the cause is an invalid input value. * @throws InternalServerException * An error on the server occurred when trying to process a request. * @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 MachineLearningException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MachineLearningClient.DescribeDataSources */ @Override public DescribeDataSourcesIterable describeDataSourcesPaginator(DescribeDataSourcesRequest describeDataSourcesRequest) throws InvalidInputException, InternalServerException, AwsServiceException, SdkClientException, MachineLearningException { return new DescribeDataSourcesIterable(this, applyPaginatorUserAgent(describeDataSourcesRequest)); } /** *

* Returns a list of DescribeEvaluations that match the search criteria in the request. *

* * @param describeEvaluationsRequest * @return Result of the DescribeEvaluations operation returned by the service. * @throws InvalidInputException * An error on the client occurred. Typically, the cause is an invalid input value. * @throws InternalServerException * An error on the server occurred when trying to process a request. * @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 MachineLearningException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MachineLearningClient.DescribeEvaluations */ @Override public DescribeEvaluationsResponse describeEvaluations(DescribeEvaluationsRequest describeEvaluationsRequest) throws InvalidInputException, InternalServerException, AwsServiceException, SdkClientException, MachineLearningException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeEvaluationsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DescribeEvaluations").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(describeEvaluationsRequest) .withMarshaller(new DescribeEvaluationsRequestMarshaller(protocolFactory))); } /** *

* Returns a list of DescribeEvaluations that match the search criteria in the request. *

*
*

* This is a variant of * {@link #describeEvaluations(software.amazon.awssdk.services.machinelearning.model.DescribeEvaluationsRequest)} * operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will * internally handle making service calls for you. *

*

* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no * guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response * pages by making service calls until there are no pages left or your iteration stops. If there are errors in your * request, you will see the failures only after you start iterating through the iterable. *

* *

* The following are few ways to iterate through the response pages: *

* 1) Using a Stream * *
     * {@code
     * software.amazon.awssdk.services.machinelearning.paginators.DescribeEvaluationsIterable responses = client.describeEvaluationsPaginator(request);
     * responses.stream().forEach(....);
     * }
     * 
* * 2) Using For loop * *
     * {
     *     @code
     *     software.amazon.awssdk.services.machinelearning.paginators.DescribeEvaluationsIterable responses = client
     *             .describeEvaluationsPaginator(request);
     *     for (software.amazon.awssdk.services.machinelearning.model.DescribeEvaluationsResponse response : responses) {
     *         // do something;
     *     }
     * }
     * 
* * 3) Use iterator directly * *
     * {@code
     * software.amazon.awssdk.services.machinelearning.paginators.DescribeEvaluationsIterable responses = client.describeEvaluationsPaginator(request);
     * responses.iterator().forEachRemaining(....);
     * }
     * 
*

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

* * @param describeEvaluationsRequest * @return A custom iterable that can be used to iterate through all the response pages. * @throws InvalidInputException * An error on the client occurred. Typically, the cause is an invalid input value. * @throws InternalServerException * An error on the server occurred when trying to process a request. * @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 MachineLearningException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MachineLearningClient.DescribeEvaluations */ @Override public DescribeEvaluationsIterable describeEvaluationsPaginator(DescribeEvaluationsRequest describeEvaluationsRequest) throws InvalidInputException, InternalServerException, AwsServiceException, SdkClientException, MachineLearningException { return new DescribeEvaluationsIterable(this, applyPaginatorUserAgent(describeEvaluationsRequest)); } /** *

* Returns a list of MLModel that match the search criteria in the request. *

* * @param describeMlModelsRequest * @return Result of the DescribeMLModels operation returned by the service. * @throws InvalidInputException * An error on the client occurred. Typically, the cause is an invalid input value. * @throws InternalServerException * An error on the server occurred when trying to process a request. * @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 MachineLearningException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MachineLearningClient.DescribeMLModels */ @Override public DescribeMlModelsResponse describeMLModels(DescribeMlModelsRequest describeMlModelsRequest) throws InvalidInputException, InternalServerException, AwsServiceException, SdkClientException, MachineLearningException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DescribeMlModelsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DescribeMLModels").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(describeMlModelsRequest) .withMarshaller(new DescribeMlModelsRequestMarshaller(protocolFactory))); } /** *

* Returns a list of MLModel that match the search criteria in the request. *

*
*

* This is a variant of * {@link #describeMLModels(software.amazon.awssdk.services.machinelearning.model.DescribeMlModelsRequest)} * operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will * internally handle making service calls for you. *

*

* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no * guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response * pages by making service calls until there are no pages left or your iteration stops. If there are errors in your * request, you will see the failures only after you start iterating through the iterable. *

* *

* The following are few ways to iterate through the response pages: *

* 1) Using a Stream * *
     * {@code
     * software.amazon.awssdk.services.machinelearning.paginators.DescribeMLModelsIterable responses = client.describeMLModelsPaginator(request);
     * responses.stream().forEach(....);
     * }
     * 
* * 2) Using For loop * *
     * {
     *     @code
     *     software.amazon.awssdk.services.machinelearning.paginators.DescribeMLModelsIterable responses = client
     *             .describeMLModelsPaginator(request);
     *     for (software.amazon.awssdk.services.machinelearning.model.DescribeMlModelsResponse response : responses) {
     *         // do something;
     *     }
     * }
     * 
* * 3) Use iterator directly * *
     * {@code
     * software.amazon.awssdk.services.machinelearning.paginators.DescribeMLModelsIterable responses = client.describeMLModelsPaginator(request);
     * responses.iterator().forEachRemaining(....);
     * }
     * 
*

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

* * @param describeMlModelsRequest * @return A custom iterable that can be used to iterate through all the response pages. * @throws InvalidInputException * An error on the client occurred. Typically, the cause is an invalid input value. * @throws InternalServerException * An error on the server occurred when trying to process a request. * @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 MachineLearningException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MachineLearningClient.DescribeMLModels */ @Override public DescribeMLModelsIterable describeMLModelsPaginator(DescribeMlModelsRequest describeMlModelsRequest) throws InvalidInputException, InternalServerException, AwsServiceException, SdkClientException, MachineLearningException { return new DescribeMLModelsIterable(this, applyPaginatorUserAgent(describeMlModelsRequest)); } /** *

* Describes one or more of the tags for your Amazon ML object. *

* * @param describeTagsRequest * @return Result of the DescribeTags operation returned by the service. * @throws InvalidInputException * An error on the client occurred. Typically, the cause is an invalid input value. * @throws ResourceNotFoundException * A specified resource cannot be located. * @throws InternalServerException * An error on the server occurred when trying to process a request. * @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 MachineLearningException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MachineLearningClient.DescribeTags */ @Override public DescribeTagsResponse describeTags(DescribeTagsRequest describeTagsRequest) throws InvalidInputException, ResourceNotFoundException, InternalServerException, AwsServiceException, SdkClientException, MachineLearningException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DescribeTagsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DescribeTags").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(describeTagsRequest) .withMarshaller(new DescribeTagsRequestMarshaller(protocolFactory))); } /** *

* Returns a BatchPrediction that includes detailed metadata, status, and data file information for a * Batch Prediction request. *

* * @param getBatchPredictionRequest * @return Result of the GetBatchPrediction operation returned by the service. * @throws InvalidInputException * An error on the client occurred. Typically, the cause is an invalid input value. * @throws ResourceNotFoundException * A specified resource cannot be located. * @throws InternalServerException * An error on the server occurred when trying to process a request. * @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 MachineLearningException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MachineLearningClient.GetBatchPrediction */ @Override public GetBatchPredictionResponse getBatchPrediction(GetBatchPredictionRequest getBatchPredictionRequest) throws InvalidInputException, ResourceNotFoundException, InternalServerException, AwsServiceException, SdkClientException, MachineLearningException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetBatchPredictionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetBatchPrediction").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(getBatchPredictionRequest) .withMarshaller(new GetBatchPredictionRequestMarshaller(protocolFactory))); } /** *

* Returns a DataSource that includes metadata and data file information, as well as the current status * of the DataSource. *

*

* GetDataSource provides results in normal or verbose format. The verbose format adds the schema * description and the list of files pointed to by the DataSource to the normal format. *

* * @param getDataSourceRequest * @return Result of the GetDataSource operation returned by the service. * @throws InvalidInputException * An error on the client occurred. Typically, the cause is an invalid input value. * @throws ResourceNotFoundException * A specified resource cannot be located. * @throws InternalServerException * An error on the server occurred when trying to process a request. * @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 MachineLearningException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MachineLearningClient.GetDataSource */ @Override public GetDataSourceResponse getDataSource(GetDataSourceRequest getDataSourceRequest) throws InvalidInputException, ResourceNotFoundException, InternalServerException, AwsServiceException, SdkClientException, MachineLearningException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetDataSourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetDataSource").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(getDataSourceRequest) .withMarshaller(new GetDataSourceRequestMarshaller(protocolFactory))); } /** *

* Returns an Evaluation that includes metadata as well as the current status of the * Evaluation. *

* * @param getEvaluationRequest * @return Result of the GetEvaluation operation returned by the service. * @throws InvalidInputException * An error on the client occurred. Typically, the cause is an invalid input value. * @throws ResourceNotFoundException * A specified resource cannot be located. * @throws InternalServerException * An error on the server occurred when trying to process a request. * @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 MachineLearningException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MachineLearningClient.GetEvaluation */ @Override public GetEvaluationResponse getEvaluation(GetEvaluationRequest getEvaluationRequest) throws InvalidInputException, ResourceNotFoundException, InternalServerException, AwsServiceException, SdkClientException, MachineLearningException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetEvaluationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetEvaluation").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(getEvaluationRequest) .withMarshaller(new GetEvaluationRequestMarshaller(protocolFactory))); } /** *

* Returns an MLModel that includes detailed metadata, data source information, and the current status * of the MLModel. *

*

* GetMLModel provides results in normal or verbose format. *

* * @param getMlModelRequest * @return Result of the GetMLModel operation returned by the service. * @throws InvalidInputException * An error on the client occurred. Typically, the cause is an invalid input value. * @throws ResourceNotFoundException * A specified resource cannot be located. * @throws InternalServerException * An error on the server occurred when trying to process a request. * @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 MachineLearningException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MachineLearningClient.GetMLModel */ @Override public GetMlModelResponse getMLModel(GetMlModelRequest getMlModelRequest) throws InvalidInputException, ResourceNotFoundException, InternalServerException, AwsServiceException, SdkClientException, MachineLearningException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetMlModelResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetMLModel").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(getMlModelRequest) .withMarshaller(new GetMlModelRequestMarshaller(protocolFactory))); } /** *

* Generates a prediction for the observation using the specified ML Model. *

* Note *

* Not all response parameters will be populated. Whether a response parameter is populated depends on the type of * model requested. *

*
* * @param predictRequest * @return Result of the Predict operation returned by the service. * @throws InvalidInputException * An error on the client occurred. Typically, the cause is an invalid input value. * @throws ResourceNotFoundException * A specified resource cannot be located. * @throws LimitExceededException * The subscriber exceeded the maximum number of operations. This exception can occur when listing objects * such as DataSource. * @throws InternalServerException * An error on the server occurred when trying to process a request. * @throws PredictorNotMountedException * The exception is thrown when a predict request is made to an unmounted MLModel. * @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 MachineLearningException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MachineLearningClient.Predict */ @Override public PredictResponse predict(PredictRequest predictRequest) throws InvalidInputException, ResourceNotFoundException, LimitExceededException, InternalServerException, PredictorNotMountedException, AwsServiceException, SdkClientException, MachineLearningException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, PredictResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams().withOperationName("Predict") .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler).withInput(predictRequest) .withMarshaller(new PredictRequestMarshaller(protocolFactory))); } /** *

* Updates the BatchPredictionName of a BatchPrediction. *

*

* You can use the GetBatchPrediction operation to view the contents of the updated data element. *

* * @param updateBatchPredictionRequest * @return Result of the UpdateBatchPrediction operation returned by the service. * @throws InvalidInputException * An error on the client occurred. Typically, the cause is an invalid input value. * @throws ResourceNotFoundException * A specified resource cannot be located. * @throws InternalServerException * An error on the server occurred when trying to process a request. * @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 MachineLearningException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MachineLearningClient.UpdateBatchPrediction */ @Override public UpdateBatchPredictionResponse updateBatchPrediction(UpdateBatchPredictionRequest updateBatchPredictionRequest) throws InvalidInputException, ResourceNotFoundException, InternalServerException, AwsServiceException, SdkClientException, MachineLearningException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateBatchPredictionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("UpdateBatchPrediction").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(updateBatchPredictionRequest) .withMarshaller(new UpdateBatchPredictionRequestMarshaller(protocolFactory))); } /** *

* Updates the DataSourceName of a DataSource. *

*

* You can use the GetDataSource operation to view the contents of the updated data element. *

* * @param updateDataSourceRequest * @return Result of the UpdateDataSource operation returned by the service. * @throws InvalidInputException * An error on the client occurred. Typically, the cause is an invalid input value. * @throws ResourceNotFoundException * A specified resource cannot be located. * @throws InternalServerException * An error on the server occurred when trying to process a request. * @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 MachineLearningException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MachineLearningClient.UpdateDataSource */ @Override public UpdateDataSourceResponse updateDataSource(UpdateDataSourceRequest updateDataSourceRequest) throws InvalidInputException, ResourceNotFoundException, InternalServerException, AwsServiceException, SdkClientException, MachineLearningException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateDataSourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("UpdateDataSource").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(updateDataSourceRequest) .withMarshaller(new UpdateDataSourceRequestMarshaller(protocolFactory))); } /** *

* Updates the EvaluationName of an Evaluation. *

*

* You can use the GetEvaluation operation to view the contents of the updated data element. *

* * @param updateEvaluationRequest * @return Result of the UpdateEvaluation operation returned by the service. * @throws InvalidInputException * An error on the client occurred. Typically, the cause is an invalid input value. * @throws ResourceNotFoundException * A specified resource cannot be located. * @throws InternalServerException * An error on the server occurred when trying to process a request. * @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 MachineLearningException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MachineLearningClient.UpdateEvaluation */ @Override public UpdateEvaluationResponse updateEvaluation(UpdateEvaluationRequest updateEvaluationRequest) throws InvalidInputException, ResourceNotFoundException, InternalServerException, AwsServiceException, SdkClientException, MachineLearningException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateEvaluationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("UpdateEvaluation").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(updateEvaluationRequest) .withMarshaller(new UpdateEvaluationRequestMarshaller(protocolFactory))); } /** *

* Updates the MLModelName and the ScoreThreshold of an MLModel. *

*

* You can use the GetMLModel operation to view the contents of the updated data element. *

* * @param updateMlModelRequest * @return Result of the UpdateMLModel operation returned by the service. * @throws InvalidInputException * An error on the client occurred. Typically, the cause is an invalid input value. * @throws ResourceNotFoundException * A specified resource cannot be located. * @throws InternalServerException * An error on the server occurred when trying to process a request. * @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 MachineLearningException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MachineLearningClient.UpdateMLModel */ @Override public UpdateMlModelResponse updateMLModel(UpdateMlModelRequest updateMlModelRequest) throws InvalidInputException, ResourceNotFoundException, InternalServerException, AwsServiceException, SdkClientException, MachineLearningException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateMlModelResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("UpdateMLModel").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(updateMlModelRequest) .withMarshaller(new UpdateMlModelRequestMarshaller(protocolFactory))); } private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory, JsonOperationMetadata operationMetadata) { return protocolFactory.createErrorResponseHandler(operationMetadata); } private > T init(T builder) { return builder .clientConfiguration(clientConfiguration) .defaultServiceExceptionSupplier(MachineLearningException::builder) .protocol(AwsJsonProtocol.AWS_JSON) .protocolVersion("1.1") .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidTagException") .exceptionBuilderSupplier(InvalidTagException::builder).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ResourceNotFoundException") .exceptionBuilderSupplier(ResourceNotFoundException::builder).httpStatusCode(404).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidInputException") .exceptionBuilderSupplier(InvalidInputException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("IdempotentParameterMismatchException") .exceptionBuilderSupplier(IdempotentParameterMismatchException::builder).httpStatusCode(400) .build()) .registerModeledException( ExceptionMetadata.builder().errorCode("TagLimitExceededException") .exceptionBuilderSupplier(TagLimitExceededException::builder).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InternalServerException") .exceptionBuilderSupplier(InternalServerException::builder).httpStatusCode(500).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("LimitExceededException") .exceptionBuilderSupplier(LimitExceededException::builder).httpStatusCode(417).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("PredictorNotMountedException") .exceptionBuilderSupplier(PredictorNotMountedException::builder).httpStatusCode(400).build()); } @Override public void close() { clientHandler.close(); } private T applyPaginatorUserAgent(T request) { Consumer userAgentApplier = b -> b.addApiName(ApiName.builder() .version(VersionInfo.SDK_VERSION).name("PAGINATED").build()); AwsRequestOverrideConfiguration overrideConfiguration = request.overrideConfiguration() .map(c -> c.toBuilder().applyMutation(userAgentApplier).build()) .orElse((AwsRequestOverrideConfiguration.builder().applyMutation(userAgentApplier).build())); return (T) request.toBuilder().overrideConfiguration(overrideConfiguration).build(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy