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\SitemapsListResponse;
21use Google\Service\SearchConsole\WmxSitemap;
22
23/**
24 * The "sitemaps" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $searchconsoleService = new Google\Service\SearchConsole(...);
28 *   $sitemaps = $searchconsoleService->sitemaps;
29 *  </code>
30 */
31class Sitemaps extends \Google\Service\Resource
32{
33  /**
34   * Deletes a sitemap from the Sitemaps report. Does not stop Google from
35   * crawling this sitemap or the URLs that were previously crawled in the deleted
36   * sitemap. (sitemaps.delete)
37   *
38   * @param string $siteUrl The site's URL, including protocol. For example:
39   * `http://www.example.com/`.
40   * @param string $feedpath The URL of the actual sitemap. For example:
41   * `http://www.example.com/sitemap.xml`.
42   * @param array $optParams Optional parameters.
43   */
44  public function delete($siteUrl, $feedpath, $optParams = [])
45  {
46    $params = ['siteUrl' => $siteUrl, 'feedpath' => $feedpath];
47    $params = array_merge($params, $optParams);
48    return $this->call('delete', [$params]);
49  }
50  /**
51   * Retrieves information about a specific sitemap. (sitemaps.get)
52   *
53   * @param string $siteUrl The site's URL, including protocol. For example:
54   * `http://www.example.com/`.
55   * @param string $feedpath The URL of the actual sitemap. For example:
56   * `http://www.example.com/sitemap.xml`.
57   * @param array $optParams Optional parameters.
58   * @return WmxSitemap
59   */
60  public function get($siteUrl, $feedpath, $optParams = [])
61  {
62    $params = ['siteUrl' => $siteUrl, 'feedpath' => $feedpath];
63    $params = array_merge($params, $optParams);
64    return $this->call('get', [$params], WmxSitemap::class);
65  }
66  /**
67   * Lists the [sitemaps-entries](/webmaster-tools/v3/sitemaps) submitted for this
68   * site, or included in the sitemap index file (if `sitemapIndex` is specified
69   * in the request). (sitemaps.listSitemaps)
70   *
71   * @param string $siteUrl The site's URL, including protocol. For example:
72   * `http://www.example.com/`.
73   * @param array $optParams Optional parameters.
74   *
75   * @opt_param string sitemapIndex A URL of a site's sitemap index. For example:
76   * `http://www.example.com/sitemapindex.xml`.
77   * @return SitemapsListResponse
78   */
79  public function listSitemaps($siteUrl, $optParams = [])
80  {
81    $params = ['siteUrl' => $siteUrl];
82    $params = array_merge($params, $optParams);
83    return $this->call('list', [$params], SitemapsListResponse::class);
84  }
85  /**
86   * Submits a sitemap for a site. (sitemaps.submit)
87   *
88   * @param string $siteUrl The site's URL, including protocol. For example:
89   * `http://www.example.com/`.
90   * @param string $feedpath The URL of the actual sitemap. For example:
91   * `http://www.example.com/sitemap.xml`.
92   * @param array $optParams Optional parameters.
93   */
94  public function submit($siteUrl, $feedpath, $optParams = [])
95  {
96    $params = ['siteUrl' => $siteUrl, 'feedpath' => $feedpath];
97    $params = array_merge($params, $optParams);
98    return $this->call('submit', [$params]);
99  }
100}
101
102// Adding a class alias for backwards compatibility with the previous class name.
103class_alias(Sitemaps::class, 'Google_Service_SearchConsole_Resource_Sitemaps');
104