updateBatchPrediction method

Future<UpdateBatchPredictionOutput> updateBatchPrediction({
  1. required String batchPredictionId,
  2. required String batchPredictionName,
})

Updates the BatchPredictionName of a BatchPrediction.

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

May throw InvalidInputException. May throw ResourceNotFoundException. May throw InternalServerException.

Parameter batchPredictionId : The ID assigned to the BatchPrediction during creation.

Parameter batchPredictionName : A new user-supplied name or description of the BatchPrediction.

Implementation

Future<UpdateBatchPredictionOutput> updateBatchPrediction({
  required String batchPredictionId,
  required String batchPredictionName,
}) async {
  ArgumentError.checkNotNull(batchPredictionId, 'batchPredictionId');
  _s.validateStringLength(
    'batchPredictionId',
    batchPredictionId,
    1,
    64,
    isRequired: true,
  );
  ArgumentError.checkNotNull(batchPredictionName, 'batchPredictionName');
  _s.validateStringLength(
    'batchPredictionName',
    batchPredictionName,
    0,
    1024,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonML_20141212.UpdateBatchPrediction'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'BatchPredictionId': batchPredictionId,
      'BatchPredictionName': batchPredictionName,
    },
  );

  return UpdateBatchPredictionOutput.fromJson(jsonResponse.body);
}