listRevisions method

Future<ListSchemaRevisionsResponse> listRevisions(
  1. String name, {
  2. int? pageSize,
  3. String? pageToken,
  4. String? view,
  5. String? $fields,
})

Lists all schema revisions for the named schema.

Request parameters:

name - Required. The name of the schema to list revisions for. Value must have pattern ^projects/\[^/\]+/schemas/\[^/\]+$.

pageSize - The maximum number of revisions to return per page.

pageToken - The page token, received from a previous ListSchemaRevisions call. Provide this to retrieve the subsequent page.

view - The set of Schema fields to return in the response. If not set, returns Schemas with name and type, but not definition. Set to FULL to retrieve all fields. Possible string values are:

  • "SCHEMA_VIEW_UNSPECIFIED" : The default / unset value. The API will default to the BASIC view.
  • "BASIC" : Include the name and type of the schema, but not the definition.
  • "FULL" : Include all Schema object fields.

$fields - Selector specifying which fields to include in a partial response.

Completes with a ListSchemaRevisionsResponse.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<ListSchemaRevisionsResponse> listRevisions(
  core.String name, {
  core.int? pageSize,
  core.String? pageToken,
  core.String? view,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if (view != null) 'view': [view],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v1/' + core.Uri.encodeFull('$name') + ':listRevisions';

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return ListSchemaRevisionsResponse.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}