get method

Future<WmxSitemap> get(
  1. String siteUrl,
  2. String feedpath, {
  3. String? $fields,
})

Retrieves information about a specific sitemap.

Request parameters:

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

feedpath - The URL of the actual sitemap. For example: http://www.example.com/sitemap.xml.

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

Completes with a WmxSitemap.

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

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

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