list method

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

List all services available to the specified project, and the current state of those services with respect to the project.

The list includes all public services, all services for which the calling user has the servicemanagement.services.bind permission, and all services that have already been enabled on the project. The list can be filtered to only include services in a specific state, for example to only include services enabled on the project. WARNING: If you need to query enabled services frequently or across an organization, you should use Cloud Asset Inventory API, which provides higher throughput and richer filtering capability.

Request parameters:

parent - Parent to search for services on. An example name would be: projects/123 where 123 is the project number. Value must have pattern ^\[^/\]+/\[^/\]+$.

filter - Only list services that conform to the given filter. The allowed filter strings are state:ENABLED and state:DISABLED.

pageSize - Requested size of the next page of data. Requested page size cannot exceed 200. If not set, the default page size is 50.

pageToken - Token identifying which result to start with, which is returned by a previous list call.

$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.

Implementation

async.Future<ListServicesResponse> 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') + '/services';

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