list method

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

Lists the models in a project.

Each project can contain multiple models, and each model can have multiple versions. If there are no models that match the request parameters, the list request returns an empty response body: {}.

Request parameters:

parent - Required. The name of the project whose models are to be listed. Value must have pattern ^projects/\[^/\]+$.

filter - Optional. Specifies the subset of models to retrieve.

pageSize - Optional. The number of models to retrieve per "page" of results. If there are more remaining results than this number, the response message will contain a valid value in the next_page_token field. The default value is 20, and the maximum page size is 100.

pageToken - Optional. A page token to request the next page of results. You get the token from the next_page_token field of the response from the previous call.

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

Completes with a GoogleCloudMlV1ListModelsResponse.

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<GoogleCloudMlV1ListModelsResponse> 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') + '/models';

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