listlinks method
Returns the list of accounts linked to your Merchant Center account.
Request parameters:
merchantId - The ID of the managing account. If this parameter is not
the same as accountId, then this account must be a multi-client account
and accountId must be the ID of a sub-account of this account.
accountId - The ID of the account for which to list links.
maxResults - The maximum number of links to return in the response, used
for pagination. The minimum allowed value is 5 results per page. If
provided value is lower than 5, it will be automatically increased to 5.
pageToken - The token returned by the previous request.
$fields - Selector specifying which fields to include in a partial
response.
Completes with a AccountsListLinksResponse.
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<AccountsListLinksResponse> listlinks(
core.String merchantId,
core.String accountId, {
core.int? maxResults,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'maxResults': ?maxResults == null ? null : ['${maxResults}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
commons.escapeVariable('$merchantId') +
'/accounts/' +
commons.escapeVariable('$accountId') +
'/listlinks';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return AccountsListLinksResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}