getTableVersions method

Future<GetTableVersionsResponse> getTableVersions({
  1. required String databaseName,
  2. required String tableName,
  3. String? catalogId,
  4. int? maxResults,
  5. String? nextToken,
})

Retrieves a list of strings that identify available versions of a specified table.

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

Parameter databaseName : The database in the catalog in which the table resides. For Hive compatibility, this name is entirely lowercase.

Parameter tableName : The name of the table. For Hive compatibility, this name is entirely lowercase.

Parameter catalogId : The ID of the Data Catalog where the tables reside. If none is provided, the AWS account ID is used by default.

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

Parameter nextToken : A continuation token, if this is not the first call.

Implementation

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

  return GetTableVersionsResponse.fromJson(jsonResponse.body);
}