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