search method

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

Searches for cloud locations from a given source location.

Request parameters:

parent - Required. The parent, which owns this collection of cloud locations. Format: projects/{project}/locations/{location} Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+$.

pageSize - Optional. The maximum number of cloud locations to return. The service might return fewer cloud locations than this value. If unspecified, server will pick an appropriate default.

pageToken - Optional. A token identifying a page of results the server should return. Provide Page token returned by a previous 'ListCloudLocations' call to retrieve the next page of results. When paginating, all other parameters provided to 'ListCloudLocations' must match the call that provided the page token.

query - Optional. The query string in search query syntax. While filter is used to filter the search results by attributes, query is used to specify the search requirements.

sourceCloudLocation - Required. The source cloud location to search from. Example search can be searching nearby cloud locations from the source cloud location by latency.

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

Completes with a SearchCloudLocationsResponse.

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

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

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