listSchemaVersions method

Future<ListSchemaVersionsResponse> listSchemaVersions({
  1. required SchemaId schemaId,
  2. int? maxResults,
  3. String? nextToken,
})

Returns a list of schema versions that you have created, with minimal information. Schema versions in Deleted status will not be included in the results. Empty results will be returned if there are no schema versions available.

May throw InvalidInputException. May throw AccessDeniedException. May throw EntityNotFoundException. May throw InternalServiceException.

Parameter schemaId : This is a wrapper structure to contain schema identity fields. The structure contains:

  • SchemaId$SchemaArn: The Amazon Resource Name (ARN) of the schema. Either SchemaArn or SchemaName and RegistryName has to be provided.
  • SchemaId$SchemaName: The name of the schema. Either SchemaArn or SchemaName and RegistryName has to be provided.

Parameter maxResults : Maximum number of results required per page. If the value is not supplied, this will be defaulted to 25 per page.

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

Implementation

Future<ListSchemaVersionsResponse> listSchemaVersions({
  required SchemaId schemaId,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(schemaId, 'schemaId');
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSGlue.ListSchemaVersions'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'SchemaId': schemaId,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListSchemaVersionsResponse.fromJson(jsonResponse.body);
}