list method

Future<ListInstancesResponse> list(
  1. String parent, {
  2. String? pageToken,
  3. String? $fields,
})

Lists information about instances in a project.

Request parameters:

parent - Required. The unique name of the project for which a list of instances is requested. Values are of the form projects/{project}. Value must have pattern ^projects/\[^/\]+$.

pageToken - DEPRECATED: This field is unused and ignored.

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

Completes with a ListInstancesResponse.

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

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

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