getUnfilteredPartitionMetadata method

Future<GetUnfilteredPartitionMetadataResponse> getUnfilteredPartitionMetadata({
  1. required String catalogId,
  2. required String databaseName,
  3. required List<String> partitionValues,
  4. required List<PermissionType> supportedPermissionTypes,
  5. required String tableName,
  6. AuditContext? auditContext,
  7. QuerySessionContext? querySessionContext,
  8. String? region,
})

Retrieves partition metadata from the Data Catalog that contains unfiltered metadata.

For IAM authorization, the public IAM action associated with this API is glue:GetPartition.

May throw EntityNotFoundException. May throw FederationSourceException. May throw FederationSourceRetryableException. May throw GlueEncryptionException. May throw InternalServiceException. May throw InvalidInputException. May throw OperationTimeoutException. May throw PermissionTypeMismatchException.

Parameter catalogId : The catalog ID where the partition resides.

Parameter databaseName : (Required) Specifies the name of a database that contains the partition.

Parameter partitionValues : (Required) A list of partition key values.

Parameter supportedPermissionTypes : (Required) A list of supported permission types.

Parameter tableName : (Required) Specifies the name of a table that contains the partition.

Parameter auditContext : A structure containing Lake Formation audit context information.

Parameter querySessionContext : A structure used as a protocol between query engines and Lake Formation or Glue. Contains both a Lake Formation generated authorization identifier and information from the request's authorization context.

Parameter region : Specified only if the base tables belong to a different Amazon Web Services Region.

Implementation

Future<GetUnfilteredPartitionMetadataResponse>
    getUnfilteredPartitionMetadata({
  required String catalogId,
  required String databaseName,
  required List<String> partitionValues,
  required List<PermissionType> supportedPermissionTypes,
  required String tableName,
  AuditContext? auditContext,
  QuerySessionContext? querySessionContext,
  String? region,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSGlue.GetUnfilteredPartitionMetadata'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'CatalogId': catalogId,
      'DatabaseName': databaseName,
      'PartitionValues': partitionValues,
      'SupportedPermissionTypes':
          supportedPermissionTypes.map((e) => e.value).toList(),
      'TableName': tableName,
      if (auditContext != null) 'AuditContext': auditContext,
      if (querySessionContext != null)
        'QuerySessionContext': querySessionContext,
      if (region != null) 'Region': region,
    },
  );

  return GetUnfilteredPartitionMetadataResponse.fromJson(jsonResponse.body);
}