getUserDefinedFunctions method

Future<GetUserDefinedFunctionsResponse> getUserDefinedFunctions({
  1. required String pattern,
  2. String? catalogId,
  3. String? databaseName,
  4. int? maxResults,
  5. String? nextToken,
})

Retrieves multiple function definitions from the Data Catalog.

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

Parameter pattern : An optional function-name pattern string that filters the function definitions returned.

Parameter catalogId : The ID of the Data Catalog where the functions to be retrieved are located. If none is provided, the AWS account ID is used by default.

Parameter databaseName : The name of the catalog database where the functions are located. If none is provided, functions from all the databases across the catalog will be returned.

Parameter maxResults : The maximum number of functions to return in one response.

Parameter nextToken : A continuation token, if this is a continuation call.

Implementation

Future<GetUserDefinedFunctionsResponse> getUserDefinedFunctions({
  required String pattern,
  String? catalogId,
  String? databaseName,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(pattern, 'pattern');
  _s.validateStringLength(
    'pattern',
    pattern,
    1,
    255,
    isRequired: true,
  );
  _s.validateStringLength(
    'catalogId',
    catalogId,
    1,
    255,
  );
  _s.validateStringLength(
    'databaseName',
    databaseName,
    1,
    255,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    1000,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSGlue.GetUserDefinedFunctions'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Pattern': pattern,
      if (catalogId != null) 'CatalogId': catalogId,
      if (databaseName != null) 'DatabaseName': databaseName,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return GetUserDefinedFunctionsResponse.fromJson(jsonResponse.body);
}