list method

Future<ListGroupsResponse> list(
  1. String name, {
  2. String? ancestorsOfGroup,
  3. String? childrenOfGroup,
  4. String? descendantsOfGroup,
  5. int? pageSize,
  6. String? pageToken,
  7. String? $fields,
})

Lists the existing groups.

Request parameters:

name - Required. The project (https://cloud.google.com/monitoring/api/v3#project_name) whose groups are to be listed. The format is: projects/[PROJECT_ID_OR_NUMBER] Value must have pattern ^projects/\[^/\]+$.

ancestorsOfGroup - A group name. The format is: projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] Returns groups that are ancestors of the specified group. The groups are returned in order, starting with the immediate parent and ending with the most distant ancestor. If the specified group has no immediate parent, the results are empty.

childrenOfGroup - A group name. The format is: projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] Returns groups whose parent_name field contains the group name. If no groups have this parent, the results are empty.

descendantsOfGroup - A group name. The format is: projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] Returns the descendants of the specified group. This is a superset of the results returned by the children_of_group filter, and includes children-of-children, and so forth.

pageSize - A positive number that is the maximum number of results to return.

pageToken - If this field is not empty then it must contain the next_page_token value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call.

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

Completes with a ListGroupsResponse.

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

  final url_ = 'v3/' + core.Uri.encodeFull('$name') + '/groups';

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