cancelMailboxExportJob method

Future<void> cancelMailboxExportJob({
  1. required String jobId,
  2. required String organizationId,
  3. String? clientToken,
})

Cancels a mailbox export job.

May throw InvalidParameterException. May throw OrganizationNotFoundException. May throw OrganizationStateException. May throw EntityNotFoundException.

Parameter jobId : The job ID.

Parameter organizationId : The organization ID.

Parameter clientToken : The idempotency token for the client request.

Implementation

Future<void> cancelMailboxExportJob({
  required String jobId,
  required String organizationId,
  String? clientToken,
}) async {
  ArgumentError.checkNotNull(jobId, 'jobId');
  _s.validateStringLength(
    'jobId',
    jobId,
    1,
    63,
    isRequired: true,
  );
  ArgumentError.checkNotNull(organizationId, 'organizationId');
  _s.validateStringLength(
    'organizationId',
    organizationId,
    34,
    34,
    isRequired: true,
  );
  _s.validateStringLength(
    'clientToken',
    clientToken,
    1,
    128,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'WorkMailService.CancelMailboxExportJob'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'JobId': jobId,
      'OrganizationId': organizationId,
      'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
    },
  );
}