list method

Future<ListQuerySourcesResponse> list({
  1. String? pageToken,
  2. bool? requestOptions_debugOptions_enableDebugging,
  3. String? requestOptions_languageCode,
  4. String? requestOptions_searchApplicationId,
  5. String? requestOptions_timeZone,
  6. String? $fields,
})

Returns list of sources that user can use for Search and Suggest APIs.

Note: This API requires a standard end user account to execute. A service account can't perform Query API requests directly; to use a service account to perform queries, set up [Google Workspace domain-wide delegation of authority](https://developers.google.com/cloud-search/docs/guides/delegation/).

Request parameters:

pageToken - Number of sources to return in the response.

requestOptions_debugOptions_enableDebugging - If you are asked by Google to help with debugging, set this field. Otherwise, ignore this field.

requestOptions_languageCode - The BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. For translations. Set this field using the language set in browser or for the page. In the event that the user's language preference is known, set this field to the known user language. When specified, the documents in search results are biased towards the specified language. The Suggest API uses this field as a hint to make better third-party autocomplete predictions.

requestOptions_searchApplicationId - The ID generated when you create a search application using the admin console.

requestOptions_timeZone - Current user's time zone id, such as "America/Los_Angeles" or "Australia/Sydney". These IDs are defined by [Unicode Common Locale Data Repository (CLDR)](http://cldr.unicode.org/) project, and currently available in the file timezone.xml. This field is used to correctly interpret date and time queries. If this field is not specified, the default time zone (UTC) is used.

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

Completes with a ListQuerySourcesResponse.

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<ListQuerySourcesResponse> list({
  core.String? pageToken,
  core.bool? requestOptions_debugOptions_enableDebugging,
  core.String? requestOptions_languageCode,
  core.String? requestOptions_searchApplicationId,
  core.String? requestOptions_timeZone,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (pageToken != null) 'pageToken': [pageToken],
    if (requestOptions_debugOptions_enableDebugging != null)
      'requestOptions.debugOptions.enableDebugging': [
        '${requestOptions_debugOptions_enableDebugging}'
      ],
    if (requestOptions_languageCode != null)
      'requestOptions.languageCode': [requestOptions_languageCode],
    if (requestOptions_searchApplicationId != null)
      'requestOptions.searchApplicationId': [
        requestOptions_searchApplicationId
      ],
    if (requestOptions_timeZone != null)
      'requestOptions.timeZone': [requestOptions_timeZone],
    if ($fields != null) 'fields': [$fields],
  };

  const url_ = 'v1/query/sources';

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