search method

Future<SearchTenancyUnitsResponse> search(
  1. String parent, {
  2. int? pageSize,
  3. String? pageToken,
  4. String? query,
  5. String? $fields,
})

Search tenancy units for a managed service.

Request parameters:

parent - Required. Service for which search is performed. services/{service} {service} the name of a service, for example 'service.googleapis.com'. Value must have pattern ^services/\[^/\]+$.

pageSize - Optional. The maximum number of results returned by this request. Currently, the default maximum is set to 1000. If page_size isn't provided or the size provided is a number larger than 1000, it's automatically set to 1000.

pageToken - Optional. The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.

query - Optional. Set a query {expression} for querying tenancy units. Your {expression} must be in the format: field_name=literal_string. The field_name is the name of the field you want to compare. Supported fields are tenant_resources.tag and tenant_resources.resource. For example, to search tenancy units that contain at least one tenant resource with a given tag 'xyz', use the query tenant_resources.tag=xyz. To search tenancy units that contain at least one tenant resource with a given resource name 'projects/123456', use the query tenant_resources.resource=projects/123456. Multiple expressions can be joined with ANDs. Tenancy units must match all expressions to be included in the result set. For example, tenant_resources.tag=xyz AND tenant_resources.resource=projects/123456

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

Completes with a SearchTenancyUnitsResponse.

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<SearchTenancyUnitsResponse> search(
  core.String parent, {
  core.int? pageSize,
  core.String? pageToken,
  core.String? query,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if (query != null) 'query': [query],
    if ($fields != null) 'fields': [$fields],
  };

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

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