list method

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

Lists the agents in a location that belong to the caller.

An agent belongs to the end user recorded as its owner when it was created, so the response holds that caller's agents and no others. It is empty for a caller that is not an end user, and an agent with no recorded owner is listed for nobody.

Request parameters:

parent - Required. The resource name of the location to list agents from. Format: projects/{project}/locations/{location}. Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+$.

orderBy - Optional. A comma-separated list of fields to order by. Supported fields: * created * updated Use desc after a field name for descending order. Example: created desc.

pageSize - Optional. The maximum number of agents to return. The service may return fewer than this value. The maximum page size is 100; values above 100 will be coerced to 100. If unspecified, the default page size is 10.

pageToken - Optional. A page token, received from a previous AgentService.ListAgents call. Provide this to retrieve the subsequent page.

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

Completes with a GoogleCloudAiplatformV1ListAgentsResponse.

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<GoogleCloudAiplatformV1ListAgentsResponse> list(
  core.String parent, {
  core.String? orderBy,
  core.int? pageSize,
  core.String? pageToken,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    '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') + '/agents';

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