createAddressListImportJob method

Future<CreateAddressListImportJobResponse> createAddressListImportJob({
  1. required String addressListId,
  2. required ImportDataFormat importDataFormat,
  3. required String name,
  4. String? clientToken,
})

Creates an import job for an address list.

May throw AccessDeniedException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter addressListId : The unique identifier of the address list for importing addresses to.

Parameter importDataFormat : The format of the input for an import job.

Parameter name : A user-friendly name for the import job.

Parameter clientToken : A unique token that Amazon SES uses to recognize subsequent retries of the same request.

Implementation

Future<CreateAddressListImportJobResponse> createAddressListImportJob({
  required String addressListId,
  required ImportDataFormat importDataFormat,
  required String name,
  String? clientToken,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'MailManagerSvc.CreateAddressListImportJob'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'AddressListId': addressListId,
      'ImportDataFormat': importDataFormat,
      'Name': name,
      'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
    },
  );

  return CreateAddressListImportJobResponse.fromJson(jsonResponse.body);
}