createImportJob method

Future<CreateImportJobResponse> createImportJob({
  1. required ImportDataSource importDataSource,
  2. required ImportDestination importDestination,
})

Creates an import job for a data destination.

May throw BadRequestException. May throw LimitExceededException. May throw TooManyRequestsException.

Parameter importDataSource : The data source for the import job.

Parameter importDestination : The destination for the import job.

Implementation

Future<CreateImportJobResponse> createImportJob({
  required ImportDataSource importDataSource,
  required ImportDestination importDestination,
}) async {
  ArgumentError.checkNotNull(importDataSource, 'importDataSource');
  ArgumentError.checkNotNull(importDestination, 'importDestination');
  final $payload = <String, dynamic>{
    'ImportDataSource': importDataSource,
    'ImportDestination': importDestination,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/v2/email/import-jobs',
    exceptionFnMap: _exceptionFns,
  );
  return CreateImportJobResponse.fromJson(response);
}