list method

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

Lists agent pools.

Request parameters:

projectId - Required. The ID of the Google Cloud project that owns the job. Value must have pattern ^\[^/\]+$.

filter - An optional list of query parameters specified as JSON text in the form of: {"agentPoolNames":["agentpool1","agentpool2",...]} Since agentPoolNames support multiple values, its values must be specified with array notation. When the filter is either empty or not provided, the list returns all agent pools for the project.

pageSize - The list page size. The max allowed value is 256.

pageToken - The list page token.

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

Completes with a ListAgentPoolsResponse.

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<ListAgentPoolsResponse> list(
  core.String projectId, {
  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/projects/' + core.Uri.encodeFull('$projectId') + '/agentPools';

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