add method

Future<void> add(
  1. String siteUrl, {
  2. String? $fields,
})

Adds a site to the set of the user's sites in Search Console.

Request parameters:

siteUrl - The URL of the site to add.

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

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<void> add(
  core.String siteUrl, {
  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');

  await _requester.request(
    url_,
    'PUT',
    queryParams: queryParams_,
    downloadOptions: null,
  );
}