list method

Future<ProductsListResponse> list(
  1. String enterpriseId, {
  2. bool? approved,
  3. String? language,
  4. int? maxResults,
  5. String? query,
  6. String? token,
  7. String? $fields,
})

Finds approved products that match a query, or all approved products if there is no query.

Note: This item has been deprecated. New integrations cannot use this method and can refer to our new recommendations.

Request parameters:

enterpriseId - The ID of the enterprise.

approved - Specifies whether to search among all products (false) or among only products that have been approved (true). Only "true" is supported, and should be specified.

language - The BCP47 tag for the user's preferred language (e.g. "en-US", "de"). Results are returned in the language best matching the preferred language.

maxResults - Defines how many results the list operation should return. The default number depends on the resource collection.

query - The search query as typed in the Google Play store search box. If omitted, all approved apps will be returned (using the pagination parameters), including apps that are not available in the store (e.g. unpublished apps).

token - Defines the token of the page to return, usually taken from TokenPagination. This can only be used if token paging is enabled.

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

Completes with a ProductsListResponse.

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<ProductsListResponse> list(
  core.String enterpriseId, {
  core.bool? approved,
  core.String? language,
  core.int? maxResults,
  core.String? query,
  core.String? token,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (approved != null) 'approved': ['${approved}'],
    if (language != null) 'language': [language],
    if (maxResults != null) 'maxResults': ['${maxResults}'],
    if (query != null) 'query': [query],
    if (token != null) 'token': [token],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'androidenterprise/v1/enterprises/' +
      commons.escapeVariable('$enterpriseId') +
      '/products';

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