list method Null safety

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

Lists all services belonging to a namespace.

Request parameters:

parent - Required. The resource name of the namespace whose services you'd like to list. Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+/namespaces/\[^/\]+$.

filter - Optional. The filter to list results by. General filter string syntax: () * can be `name` or `annotations.` for map field * can be <, >, <=, >=, !=, =, :. Of which : means HAS, and is roughly the same as = * must be the same data type as field * can be AND, OR, NOT Examples of valid filters: * annotations.owner returns services that have a annotation with the key owner, this is the same as annotations:owner * annotations.protocol=gRPC returns services that have key/value protocol=gRPC * name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c returns services that have name that is alphabetically later than the string, so "service-e" is returned but "service-a" is not * annotations.owner!=sd AND returns services that have owner in annotation key but value is not sd AND have key/value foo=bar * returns an empty list. Note that service doesn't have a field called "doesnotexist". Since the filter does not match any services, it returns no results For more information about filtering, see API Filtering.

orderBy - Optional. The order to list results by. General order_by string syntax: () (,) * allows value: `name` * ascending or descending order by ``. If this is left blank, asc is used Note that an empty order_by string results in default order, which is order by name in ascending order.

pageSize - Optional. The maximum number of items to return.

pageToken - Optional. The next_page_token value returned from a previous List request, if any.

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

Completes with a ListServicesResponse.

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.


async.Future<ListServicesResponse> list(
  core.String parent, {
  core.String? filter,
  core.String? orderBy, pageSize,
  core.String? pageToken,
  core.String? $fields,
}) async {
  final _queryParams = <core.String, core.List<core.String>>{
    if (filter != null) 'filter': [filter],
    if (orderBy != null) 'orderBy': [orderBy],
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if ($fields != null) 'fields': [$fields],

  final _url = 'v1/' + core.Uri.encodeFull('$parent') + '/services';

  final _response = await _requester.request(
    queryParams: _queryParams,
  return ListServicesResponse.fromJson(
      _response as core.Map<core.String, core.dynamic>);