createUserDefinedFunction method
Creates a new function definition in the Data Catalog.
May throw AlreadyExistsException.
May throw EntityNotFoundException.
May throw GlueEncryptionException.
May throw InternalServiceException.
May throw InvalidInputException.
May throw OperationTimeoutException.
May throw ResourceNumberLimitExceededException.
Parameter databaseName :
The name of the catalog database in which to create the function.
Parameter functionInput :
A FunctionInput object that defines the function to create in
the Data Catalog.
Parameter catalogId :
The ID of the Data Catalog in which to create the function. If none is
provided, the Amazon Web Services account ID is used by default.
Implementation
Future<void> createUserDefinedFunction({
required String databaseName,
required UserDefinedFunctionInput functionInput,
String? catalogId,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSGlue.CreateUserDefinedFunction'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'DatabaseName': databaseName,
'FunctionInput': functionInput,
if (catalogId != null) 'CatalogId': catalogId,
},
);
}