list method

Future<ListProductsResponse> list(
  1. String parent, {
  2. List<String>? include,
  3. int? pageSize,
  4. String? pageToken,
  5. String? $fields,
})

Lists all the products in a Manufacturer Center account.

Request parameters:

parent - Parent ID in the format accounts/{account_id}. account_id - The ID of the Manufacturer Center account. Value must have pattern ^accounts/\[^/\]+$.

include - The information to be included in the response. Only sections listed here will be returned.

pageSize - Maximum number of product statuses to return in the response, used for paging.

pageToken - The token returned by the previous request.

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

Completes with a ListProductsResponse.

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

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

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