list method

Future<SitemapsListResponse> list(
  1. String siteUrl, {
  2. String? sitemapIndex,
  3. String? $fields,
})

Lists the [sitemaps-entries](/webmaster-tools/v3/sitemaps) submitted for this site, or included in the sitemap index file (if sitemapIndex is specified in the request).

Request parameters:

siteUrl - The site's URL, including protocol. For example: http://www.example.com/.

sitemapIndex - A URL of a site's sitemap index. For example: http://www.example.com/sitemapindex.xml.

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

Completes with a SitemapsListResponse.

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<SitemapsListResponse> list(
  core.String siteUrl, {
  core.String? sitemapIndex,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (sitemapIndex != null) 'sitemapIndex': [sitemapIndex],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'webmasters/v3/sites/' +
      commons.escapeVariable('$siteUrl') +
      '/sitemaps';

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