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\Adsense\Resource;
19
20use Google\Service\Adsense\ListSitesResponse;
21use Google\Service\Adsense\Site;
22
23/**
24 * The "sites" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $adsenseService = new Google\Service\Adsense(...);
28 *   $sites = $adsenseService->sites;
29 *  </code>
30 */
31class AccountsSites extends \Google\Service\Resource
32{
33  /**
34   * Gets information about the selected site. (sites.get)
35   *
36   * @param string $name Required. Name of the site. Format:
37   * accounts/{account}/sites/{site}
38   * @param array $optParams Optional parameters.
39   * @return Site
40   */
41  public function get($name, $optParams = [])
42  {
43    $params = ['name' => $name];
44    $params = array_merge($params, $optParams);
45    return $this->call('get', [$params], Site::class);
46  }
47  /**
48   * Lists all the sites available in an account. (sites.listAccountsSites)
49   *
50   * @param string $parent Required. The account which owns the collection of
51   * sites. Format: accounts/{account}
52   * @param array $optParams Optional parameters.
53   *
54   * @opt_param int pageSize The maximum number of sites to include in the
55   * response, used for paging. If unspecified, at most 10000 sites will be
56   * returned. The maximum value is 10000; values above 10000 will be coerced to
57   * 10000.
58   * @opt_param string pageToken A page token, received from a previous
59   * `ListSites` call. Provide this to retrieve the subsequent page. When
60   * paginating, all other parameters provided to `ListSites` must match the call
61   * that provided the page token.
62   * @return ListSitesResponse
63   */
64  public function listAccountsSites($parent, $optParams = [])
65  {
66    $params = ['parent' => $parent];
67    $params = array_merge($params, $optParams);
68    return $this->call('list', [$params], ListSitesResponse::class);
69  }
70}
71
72// Adding a class alias for backwards compatibility with the previous class name.
73class_alias(AccountsSites::class, 'Google_Service_Adsense_Resource_AccountsSites');
74