search method

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

Searches organization resources that are visible to the user and satisfy the specified filter.

This method returns organizations in an unspecified order. New organizations do not necessarily appear at the end of the results, and may take a small amount of time to appear. Search will only return organizations on which the user has the permission resourcemanager.organizations.get or has super admin privileges.

Request parameters:

pageSize - Optional. The maximum number of organizations to return in the response. The server can return fewer organizations than requested. If unspecified, server picks an appropriate default.

pageToken - Optional. A pagination token returned from a previous call to SearchOrganizations that indicates from where listing should continue.

query - Optional. An optional query string used to filter the Organizations to return in the response. Query rules are case-insensitive.

|------------------|--------------------------------------------| |
directoryCustomerId, owner.directoryCustomerId | Filters by directory
customer id. | | domain | Filters by domain. | ``` Organizations may be
queried by `directoryCustomerId` or by `domain`, where the domain is a G
Suite domain, for example: * Query `directorycustomerid:123456789` returns
Organization resources with `owner.directory_customer_id` equal to
`123456789`. * Query `domain:google.com` returns Organization resources
corresponding to the domain `google.com`.

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

Completes with a [SearchOrganizationsResponse].

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<SearchOrganizationsResponse> search({
  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],
  };

  const url_ = 'v3/organizations:search';

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