startBatchJob method

Future<StartBatchJobResponse> startBatchJob({
  1. required String applicationId,
  2. required BatchJobIdentifier batchJobIdentifier,
  3. String? authSecretsManagerArn,
  4. Map<String, String>? jobParams,
})

Starts a batch job and returns the unique identifier of this execution of the batch job. The associated application must be running in order to start the batch job.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter applicationId : The unique identifier of the application associated with this batch job.

Parameter batchJobIdentifier : The unique identifier of the batch job.

Parameter authSecretsManagerArn : The Amazon Web Services Secrets Manager containing user's credentials for authentication and authorization for Start Batch Job execution operation.

Parameter jobParams : The collection of batch job parameters. For details about limits for keys and values, see Coding variables in JCL.

Implementation

Future<StartBatchJobResponse> startBatchJob({
  required String applicationId,
  required BatchJobIdentifier batchJobIdentifier,
  String? authSecretsManagerArn,
  Map<String, String>? jobParams,
}) async {
  final $payload = <String, dynamic>{
    'batchJobIdentifier': batchJobIdentifier,
    if (authSecretsManagerArn != null)
      'authSecretsManagerArn': authSecretsManagerArn,
    if (jobParams != null) 'jobParams': jobParams,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/applications/${Uri.encodeComponent(applicationId)}/batch-job',
    exceptionFnMap: _exceptionFns,
  );
  return StartBatchJobResponse.fromJson(response);
}