list method

Future<ListVolumeSnapshotsResponse> list(
  1. String parent, {
  2. int? pageSize,
  3. String? pageToken,
  4. String? $fields,
})

Retrieves the list of snapshots for the specified volume.

Returns a response with an empty list of snapshots if called for a non-boot volume.

Request parameters:

parent - Required. Parent value for ListVolumesRequest. Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+/volumes/\[^/\]+$.

pageSize - Requested page size. The server might return fewer items than requested. If unspecified, server will pick an appropriate default.

pageToken - A token identifying a page of results from the server.

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

Completes with a ListVolumeSnapshotsResponse.

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<ListVolumeSnapshotsResponse> list(
  core.String parent, {
  core.int? pageSize,
  core.String? pageToken,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v2/' + core.Uri.encodeFull('$parent') + '/snapshots';

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