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\Account;
|
---|
21 | use Google\Service\AdSensePlatform\CloseAccountRequest;
|
---|
22 | use Google\Service\AdSensePlatform\CloseAccountResponse;
|
---|
23 | use Google\Service\AdSensePlatform\ListAccountsResponse;
|
---|
24 | use Google\Service\AdSensePlatform\LookupAccountResponse;
|
---|
25 |
|
---|
26 | /**
|
---|
27 | * The "accounts" collection of methods.
|
---|
28 | * Typical usage is:
|
---|
29 | * <code>
|
---|
30 | * $adsenseplatformService = new Google\Service\AdSensePlatform(...);
|
---|
31 | * $accounts = $adsenseplatformService->platforms_accounts;
|
---|
32 | * </code>
|
---|
33 | */
|
---|
34 | class PlatformsAccounts extends \Google\Service\Resource
|
---|
35 | {
|
---|
36 | /**
|
---|
37 | * Closes a sub-account. (accounts.close)
|
---|
38 | *
|
---|
39 | * @param string $name Required. Account to close. Format:
|
---|
40 | * platforms/{platform}/accounts/{account_id}
|
---|
41 | * @param CloseAccountRequest $postBody
|
---|
42 | * @param array $optParams Optional parameters.
|
---|
43 | * @return CloseAccountResponse
|
---|
44 | * @throws \Google\Service\Exception
|
---|
45 | */
|
---|
46 | public function close($name, CloseAccountRequest $postBody, $optParams = [])
|
---|
47 | {
|
---|
48 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
49 | $params = array_merge($params, $optParams);
|
---|
50 | return $this->call('close', [$params], CloseAccountResponse::class);
|
---|
51 | }
|
---|
52 | /**
|
---|
53 | * Creates a sub-account. (accounts.create)
|
---|
54 | *
|
---|
55 | * @param string $parent Required. Platform to create an account for. Format:
|
---|
56 | * platforms/{platform}
|
---|
57 | * @param Account $postBody
|
---|
58 | * @param array $optParams Optional parameters.
|
---|
59 | * @return Account
|
---|
60 | * @throws \Google\Service\Exception
|
---|
61 | */
|
---|
62 | public function create($parent, Account $postBody, $optParams = [])
|
---|
63 | {
|
---|
64 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
65 | $params = array_merge($params, $optParams);
|
---|
66 | return $this->call('create', [$params], Account::class);
|
---|
67 | }
|
---|
68 | /**
|
---|
69 | * Gets information about the selected sub-account. (accounts.get)
|
---|
70 | *
|
---|
71 | * @param string $name Required. Account to get information about. Format:
|
---|
72 | * platforms/{platform}/accounts/{account_id}
|
---|
73 | * @param array $optParams Optional parameters.
|
---|
74 | * @return Account
|
---|
75 | * @throws \Google\Service\Exception
|
---|
76 | */
|
---|
77 | public function get($name, $optParams = [])
|
---|
78 | {
|
---|
79 | $params = ['name' => $name];
|
---|
80 | $params = array_merge($params, $optParams);
|
---|
81 | return $this->call('get', [$params], Account::class);
|
---|
82 | }
|
---|
83 | /**
|
---|
84 | * Lists a partial view of sub-accounts for a specific parent account.
|
---|
85 | * (accounts.listPlatformsAccounts)
|
---|
86 | *
|
---|
87 | * @param string $parent Required. Platform who parents the accounts. Format:
|
---|
88 | * platforms/{platform}
|
---|
89 | * @param array $optParams Optional parameters.
|
---|
90 | *
|
---|
91 | * @opt_param int pageSize Optional. The maximum number of accounts to include
|
---|
92 | * in the response, used for paging. If unspecified, at most 10000 accounts will
|
---|
93 | * be returned. The maximum value is 10000; values above 10000 will be coerced
|
---|
94 | * to 10000.
|
---|
95 | * @opt_param string pageToken Optional. A page token, received from a previous
|
---|
96 | * `ListAccounts` call. Provide this to retrieve the subsequent page.
|
---|
97 | * @return ListAccountsResponse
|
---|
98 | * @throws \Google\Service\Exception
|
---|
99 | */
|
---|
100 | public function listPlatformsAccounts($parent, $optParams = [])
|
---|
101 | {
|
---|
102 | $params = ['parent' => $parent];
|
---|
103 | $params = array_merge($params, $optParams);
|
---|
104 | return $this->call('list', [$params], ListAccountsResponse::class);
|
---|
105 | }
|
---|
106 | /**
|
---|
107 | * Looks up information about a sub-account for a specified creation_request_id.
|
---|
108 | * If no account exists for the given creation_request_id, returns 404.
|
---|
109 | * (accounts.lookup)
|
---|
110 | *
|
---|
111 | * @param string $parent Required. Platform who parents the account. Format:
|
---|
112 | * platforms/{platform}
|
---|
113 | * @param array $optParams Optional parameters.
|
---|
114 | *
|
---|
115 | * @opt_param string creationRequestId Optional. The creation_request_id
|
---|
116 | * provided when calling createAccount.
|
---|
117 | * @return LookupAccountResponse
|
---|
118 | * @throws \Google\Service\Exception
|
---|
119 | */
|
---|
120 | public function lookup($parent, $optParams = [])
|
---|
121 | {
|
---|
122 | $params = ['parent' => $parent];
|
---|
123 | $params = array_merge($params, $optParams);
|
---|
124 | return $this->call('lookup', [$params], LookupAccountResponse::class);
|
---|
125 | }
|
---|
126 | }
|
---|
127 |
|
---|
128 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
129 | class_alias(PlatformsAccounts::class, 'Google_Service_AdSensePlatform_Resource_PlatformsAccounts');
|
---|