list method
List DeploymentGroups for a given project and location.
Request parameters:
parent - Required. The parent, which owns this collection of deployment
groups. Format: 'projects/{project_id}/locations/{location}'.
Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+$.
filter - Optional. Lists the DeploymentGroups that match the filter
expression. A filter expression filters the deployment groups listed in
the response. The expression must be of the form '{field} {operator}
{value}' where operators: '<', '>', '<=', '>=', '!=', '=', ':' are
supported (colon ':' represents a HAS operator which is roughly synonymous
with equality). {field} can refer to a proto or JSON field, or a synthetic
field. Field names can be camelCase or snake_case. Examples: - Filter by
name: name = "projects/foo/locations/us-central1/deploymentGroups/bar" -
Filter by labels: - Resources that have a key called 'foo' labels.foo:* -
Resources that have a key called 'foo' whose value is 'bar' labels.foo =
bar - Filter by state: - DeploymentGroups in CREATING state.
state=CREATING
orderBy - Optional. Field to use to sort the list.
pageSize - Optional. When requesting a page of resources, 'page_size'
specifies number of resources to return. If unspecified, at most 500 will
be returned. The maximum value is 1000.
pageToken - Optional. Token returned by previous call to
'ListDeploymentGroups' which specifies the position in the list from where
to continue listing the deployment groups.
$fields - Selector specifying which fields to include in a partial
response.
Completes with a ListDeploymentGroupsResponse.
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<ListDeploymentGroupsResponse> list(
core.String parent, {
core.String? filter,
core.String? orderBy,
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'filter': ?filter == null ? null : [filter],
'orderBy': ?orderBy == null ? null : [orderBy],
'pageSize': ?pageSize == null ? null : ['${pageSize}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/deploymentGroups';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListDeploymentGroupsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}