list method

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

Lists the stores of the target merchant, specified by the filter in ListLfpStoresRequest.

Request parameters:

parent - Required. The LFP partner. Format: accounts/{account} Value must have pattern ^accounts/\[^/\]+$.

pageSize - Optional. The maximum number of LfpStore resources for the given account to return. The service returns fewer than this value if the number of stores for the given account is less than the pageSize. The default value is 250. The maximum value is 1000; If a value higher than the maximum is specified, then the pageSize will default to the maximum.

pageToken - Optional. A page token, received from a previous ListLfpStoresRequest call. Provide the page token to retrieve the subsequent page. When paginating, all other parameters provided to ListLfpStoresRequest must match the call that provided the page token. The token returned as nextPageToken in the response to the previous request.

targetAccount - Required. The Merchant Center id of the merchant to list stores for.

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

Completes with a ListLfpStoresResponse.

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

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

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