1<?php
2/*
3 * Copyright 2014 Google Inc.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6 * use this file except in compliance with the License. You may obtain a copy of
7 * the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations under
15 * the License.
16 */
17
18namespace Google\Service\SearchConsole\Resource;
19
20use Google\Service\SearchConsole\SitesListResponse;
21use Google\Service\SearchConsole\WmxSite;
22
23/**
24 * The "sites" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $searchconsoleService = new Google\Service\SearchConsole(...);
28 *   $sites = $searchconsoleService->sites;
29 *  </code>
30 */
31class Sites extends \Google\Service\Resource
32{
33  /**
34   * Adds a site to the set of the user's sites in Search Console. (sites.add)
35   *
36   * @param string $siteUrl The URL of the site to add.
37   * @param array $optParams Optional parameters.
38   */
39  public function add($siteUrl, $optParams = [])
40  {
41    $params = ['siteUrl' => $siteUrl];
42    $params = array_merge($params, $optParams);
43    return $this->call('add', [$params]);
44  }
45  /**
46   * Removes a site from the set of the user's Search Console sites.
47   * (sites.delete)
48   *
49   * @param string $siteUrl The URI of the property as defined in Search Console.
50   * **Examples:** `http://www.example.com/` or `sc-domain:example.com`.
51   * @param array $optParams Optional parameters.
52   */
53  public function delete($siteUrl, $optParams = [])
54  {
55    $params = ['siteUrl' => $siteUrl];
56    $params = array_merge($params, $optParams);
57    return $this->call('delete', [$params]);
58  }
59  /**
60   * Retrieves information about specific site. (sites.get)
61   *
62   * @param string $siteUrl The URI of the property as defined in Search Console.
63   * **Examples:** `http://www.example.com/` or `sc-domain:example.com`.
64   * @param array $optParams Optional parameters.
65   * @return WmxSite
66   */
67  public function get($siteUrl, $optParams = [])
68  {
69    $params = ['siteUrl' => $siteUrl];
70    $params = array_merge($params, $optParams);
71    return $this->call('get', [$params], WmxSite::class);
72  }
73  /**
74   * Lists the user's Search Console sites. (sites.listSites)
75   *
76   * @param array $optParams Optional parameters.
77   * @return SitesListResponse
78   */
79  public function listSites($optParams = [])
80  {
81    $params = [];
82    $params = array_merge($params, $optParams);
83    return $this->call('list', [$params], SitesListResponse::class);
84  }
85}
86
87// Adding a class alias for backwards compatibility with the previous class name.
88class_alias(Sites::class, 'Google_Service_SearchConsole_Resource_Sites');
89