getMapping method

Future<GetMappingResponse> getMapping({
  1. required CatalogEntry source,
  2. Location? location,
  3. List<CatalogEntry>? sinks,
})

Creates mappings.

May throw InvalidInputException. May throw InternalServiceException. May throw OperationTimeoutException. May throw EntityNotFoundException.

Parameter source : Specifies the source table.

Parameter location : Parameters for the mapping.

Parameter sinks : A list of target tables.

Implementation

Future<GetMappingResponse> getMapping({
  required CatalogEntry source,
  Location? location,
  List<CatalogEntry>? sinks,
}) async {
  ArgumentError.checkNotNull(source, 'source');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSGlue.GetMapping'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Source': source,
      if (location != null) 'Location': location,
      if (sinks != null) 'Sinks': sinks,
    },
  );

  return GetMappingResponse.fromJson(jsonResponse.body);
}