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\AdSensePlatform\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\AdSensePlatform\AdsenseplatformEmpty;
|
---|
21 | use Google\Service\AdSensePlatform\ListSitesResponse;
|
---|
22 | use Google\Service\AdSensePlatform\RequestSiteReviewResponse;
|
---|
23 | use Google\Service\AdSensePlatform\Site;
|
---|
24 |
|
---|
25 | /**
|
---|
26 | * The "sites" collection of methods.
|
---|
27 | * Typical usage is:
|
---|
28 | * <code>
|
---|
29 | * $adsenseplatformService = new Google\Service\AdSensePlatform(...);
|
---|
30 | * $sites = $adsenseplatformService->platforms_accounts_sites;
|
---|
31 | * </code>
|
---|
32 | */
|
---|
33 | class PlatformsAccountsSites extends \Google\Service\Resource
|
---|
34 | {
|
---|
35 | /**
|
---|
36 | * Creates a site for a specified account. (sites.create)
|
---|
37 | *
|
---|
38 | * @param string $parent Required. Account to create site. Format:
|
---|
39 | * platforms/{platform}/accounts/{account_id}
|
---|
40 | * @param Site $postBody
|
---|
41 | * @param array $optParams Optional parameters.
|
---|
42 | * @return Site
|
---|
43 | * @throws \Google\Service\Exception
|
---|
44 | */
|
---|
45 | public function create($parent, Site $postBody, $optParams = [])
|
---|
46 | {
|
---|
47 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
48 | $params = array_merge($params, $optParams);
|
---|
49 | return $this->call('create', [$params], Site::class);
|
---|
50 | }
|
---|
51 | /**
|
---|
52 | * Deletes a site from a specified account. (sites.delete)
|
---|
53 | *
|
---|
54 | * @param string $name Required. The name of the site to delete. Format:
|
---|
55 | * platforms/{platform}/accounts/{account}/sites/{site}
|
---|
56 | * @param array $optParams Optional parameters.
|
---|
57 | * @return AdsenseplatformEmpty
|
---|
58 | * @throws \Google\Service\Exception
|
---|
59 | */
|
---|
60 | public function delete($name, $optParams = [])
|
---|
61 | {
|
---|
62 | $params = ['name' => $name];
|
---|
63 | $params = array_merge($params, $optParams);
|
---|
64 | return $this->call('delete', [$params], AdsenseplatformEmpty::class);
|
---|
65 | }
|
---|
66 | /**
|
---|
67 | * Gets a site from a specified sub-account. (sites.get)
|
---|
68 | *
|
---|
69 | * @param string $name Required. The name of the site to retrieve. Format:
|
---|
70 | * platforms/{platform}/accounts/{account}/sites/{site}
|
---|
71 | * @param array $optParams Optional parameters.
|
---|
72 | * @return Site
|
---|
73 | * @throws \Google\Service\Exception
|
---|
74 | */
|
---|
75 | public function get($name, $optParams = [])
|
---|
76 | {
|
---|
77 | $params = ['name' => $name];
|
---|
78 | $params = array_merge($params, $optParams);
|
---|
79 | return $this->call('get', [$params], Site::class);
|
---|
80 | }
|
---|
81 | /**
|
---|
82 | * Lists sites for a specific account. (sites.listPlatformsAccountsSites)
|
---|
83 | *
|
---|
84 | * @param string $parent Required. The account which owns the sites. Format:
|
---|
85 | * platforms/{platform}/accounts/{account}
|
---|
86 | * @param array $optParams Optional parameters.
|
---|
87 | *
|
---|
88 | * @opt_param int pageSize The maximum number of sites to include in the
|
---|
89 | * response, used for paging. If unspecified, at most 10000 sites will be
|
---|
90 | * returned. The maximum value is 10000; values above 10000 will be coerced to
|
---|
91 | * 10000.
|
---|
92 | * @opt_param string pageToken A page token, received from a previous
|
---|
93 | * `ListSites` call. Provide this to retrieve the subsequent page. When
|
---|
94 | * paginating, all other parameters provided to `ListSites` must match the call
|
---|
95 | * that provided the page token.
|
---|
96 | * @return ListSitesResponse
|
---|
97 | * @throws \Google\Service\Exception
|
---|
98 | */
|
---|
99 | public function listPlatformsAccountsSites($parent, $optParams = [])
|
---|
100 | {
|
---|
101 | $params = ['parent' => $parent];
|
---|
102 | $params = array_merge($params, $optParams);
|
---|
103 | return $this->call('list', [$params], ListSitesResponse::class);
|
---|
104 | }
|
---|
105 | /**
|
---|
106 | * Requests the review of a site. The site should be in REQUIRES_REVIEW or
|
---|
107 | * NEEDS_ATTENTION state. Note: Make sure you place an [ad
|
---|
108 | * tag](https://developers.google.com/adsense/platforms/direct/ad-tags) on your
|
---|
109 | * site before requesting a review. (sites.requestReview)
|
---|
110 | *
|
---|
111 | * @param string $name Required. The name of the site to submit for review.
|
---|
112 | * Format: platforms/{platform}/accounts/{account}/sites/{site}
|
---|
113 | * @param array $optParams Optional parameters.
|
---|
114 | * @return RequestSiteReviewResponse
|
---|
115 | * @throws \Google\Service\Exception
|
---|
116 | */
|
---|
117 | public function requestReview($name, $optParams = [])
|
---|
118 | {
|
---|
119 | $params = ['name' => $name];
|
---|
120 | $params = array_merge($params, $optParams);
|
---|
121 | return $this->call('requestReview', [$params], RequestSiteReviewResponse::class);
|
---|
122 | }
|
---|
123 | }
|
---|
124 |
|
---|
125 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
126 | class_alias(PlatformsAccountsSites::class, 'Google_Service_AdSensePlatform_Resource_PlatformsAccountsSites');
|
---|