listSchemaVersions method

Future<ListSchemaVersionsResponse> listSchemaVersions({
  1. required SchemaVersionType type,
  2. int? maxResults,
  3. String? namespace,
  4. String? nextToken,
  5. String? schemaId,
  6. String? semanticVersion,
  7. SchemaVersionVisibility? visibility,
})

Lists schema versions with the provided information.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ServiceUnavailableException. May throw ThrottlingException. May throw ValidationException.

Parameter type : Filter on the type of schema version.

Parameter maxResults : The maximum number of results to return at one time.

Parameter namespace : Filter on the name of the schema version.

Parameter nextToken : A token that can be used to retrieve the next set of results.

Parameter schemaId : Filter on the id of the schema version.

Parameter semanticVersion : The schema version. If this is left blank, it defaults to the latest version.

Parameter visibility : The visibility of the schema version.

Implementation

Future<ListSchemaVersionsResponse> listSchemaVersions({
  required SchemaVersionType type,
  int? maxResults,
  String? namespace,
  String? nextToken,
  String? schemaId,
  String? semanticVersion,
  SchemaVersionVisibility? visibility,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    1000,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'MaxResults': [maxResults.toString()],
    if (namespace != null) 'NamespaceFilter': [namespace],
    if (nextToken != null) 'NextToken': [nextToken],
    if (schemaId != null) 'SchemaIdFilter': [schemaId],
    if (semanticVersion != null) 'SemanticVersionFilter': [semanticVersion],
    if (visibility != null) 'VisibilityFilter': [visibility.value],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/schema-versions/${Uri.encodeComponent(type.value)}',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListSchemaVersionsResponse.fromJson(response);
}