list method

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

Lists subnetworks that are usable for creating clusters in a project.

Request parameters:

parent - The parent project where subnetworks are usable. Specified in the format projects / * . Value must have pattern ^projects/\[^/\]+$.

filter - Filtering currently only supports equality on the networkProjectId and must be in the form: "networkProjectId=[PROJECTID]", where networkProjectId is the project which owns the listed subnetworks. This defaults to the parent project ID.

pageSize - The max number of results per page that should be returned. If the number of available results is larger than page_size, a next_page_token is returned which can be used to get the next page of results in subsequent requests. Acceptable values are 0 to 500, inclusive. (Default: 500)

pageToken - Specifies a page token to use. Set this to the nextPageToken returned by previous list requests to get the next page of results.

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

Completes with a ListUsableSubnetworksResponse.

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

  final url_ = 'v1/' +
      core.Uri.encodeFull('$parent') +
      '/aggregated/usableSubnetworks';

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