batchGet method

Future<BatchGetServicesResponse> batchGet(
  1. String parent, {
  2. List<String>? names,
  3. String? $fields,
})

Returns the service configurations and enabled states for a given list of services.

Request parameters:

parent - Parent to retrieve services from. If this is set, the parent of all of the services specified in names must match this field. An example name would be: projects/123 where 123 is the project number. The BatchGetServices method currently only supports projects. Value must have pattern ^\[^/\]+/\[^/\]+$.

names - Names of the services to retrieve. An example name would be: projects/123/services/serviceusage.googleapis.com where 123 is the project number. A single request can get a maximum of 30 services at a time.

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

Completes with a BatchGetServicesResponse.

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<BatchGetServicesResponse> batchGet(
  core.String parent, {
  core.List<core.String>? names,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (names != null) 'names': names,
    if ($fields != null) 'fields': [$fields],
  };

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

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