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