source: vendor/google/apiclient-services/src/ShoppingContent/Resource/Accounts.php

Last change on this file was e3d4e0a, checked in by Vlado 222039 <vlado.popovski@…>, 2 weeks ago

Upload project files

  • Property mode set to 100644
File size: 13.2 KB
Line 
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\ShoppingContent\Resource;
19
20use Google\Service\ShoppingContent\Account;
21use Google\Service\ShoppingContent\AccountsAuthInfoResponse;
22use Google\Service\ShoppingContent\AccountsClaimWebsiteResponse;
23use Google\Service\ShoppingContent\AccountsCustomBatchRequest;
24use Google\Service\ShoppingContent\AccountsCustomBatchResponse;
25use Google\Service\ShoppingContent\AccountsLinkRequest;
26use Google\Service\ShoppingContent\AccountsLinkResponse;
27use Google\Service\ShoppingContent\AccountsListLinksResponse;
28use Google\Service\ShoppingContent\AccountsListResponse;
29use Google\Service\ShoppingContent\AccountsUpdateLabelsRequest;
30use Google\Service\ShoppingContent\AccountsUpdateLabelsResponse;
31use Google\Service\ShoppingContent\RequestPhoneVerificationRequest;
32use Google\Service\ShoppingContent\RequestPhoneVerificationResponse;
33use Google\Service\ShoppingContent\VerifyPhoneNumberRequest;
34use Google\Service\ShoppingContent\VerifyPhoneNumberResponse;
35
36/**
37 * The "accounts" collection of methods.
38 * Typical usage is:
39 * <code>
40 * $contentService = new Google\Service\ShoppingContent(...);
41 * $accounts = $contentService->accounts;
42 * </code>
43 */
44class Accounts extends \Google\Service\Resource
45{
46 /**
47 * Returns information about the authenticated user. (accounts.authinfo)
48 *
49 * @param array $optParams Optional parameters.
50 * @return AccountsAuthInfoResponse
51 * @throws \Google\Service\Exception
52 */
53 public function authinfo($optParams = [])
54 {
55 $params = [];
56 $params = array_merge($params, $optParams);
57 return $this->call('authinfo', [$params], AccountsAuthInfoResponse::class);
58 }
59 /**
60 * Claims the website of a Merchant Center sub-account. Merchant accounts with
61 * approved third-party CSSs aren't required to claim a website.
62 * (accounts.claimwebsite)
63 *
64 * @param string $merchantId The ID of the managing account. If this parameter
65 * is not the same as accountId, then this account must be a multi-client
66 * account and `accountId` must be the ID of a sub-account of this account.
67 * @param string $accountId The ID of the account whose website is claimed.
68 * @param array $optParams Optional parameters.
69 *
70 * @opt_param bool overwrite Only available to selected merchants, for example
71 * multi-client accounts (MCAs) and their sub-accounts. When set to `True`, this
72 * option removes any existing claim on the requested website and replaces it
73 * with a claim from the account that makes the request.
74 * @return AccountsClaimWebsiteResponse
75 * @throws \Google\Service\Exception
76 */
77 public function claimwebsite($merchantId, $accountId, $optParams = [])
78 {
79 $params = ['merchantId' => $merchantId, 'accountId' => $accountId];
80 $params = array_merge($params, $optParams);
81 return $this->call('claimwebsite', [$params], AccountsClaimWebsiteResponse::class);
82 }
83 /**
84 * Retrieves, inserts, updates, and deletes multiple Merchant Center
85 * (sub-)accounts in a single request. (accounts.custombatch)
86 *
87 * @param AccountsCustomBatchRequest $postBody
88 * @param array $optParams Optional parameters.
89 * @return AccountsCustomBatchResponse
90 * @throws \Google\Service\Exception
91 */
92 public function custombatch(AccountsCustomBatchRequest $postBody, $optParams = [])
93 {
94 $params = ['postBody' => $postBody];
95 $params = array_merge($params, $optParams);
96 return $this->call('custombatch', [$params], AccountsCustomBatchResponse::class);
97 }
98 /**
99 * Deletes a Merchant Center sub-account. (accounts.delete)
100 *
101 * @param string $merchantId The ID of the managing account. This must be a
102 * multi-client account, and accountId must be the ID of a sub-account of this
103 * account.
104 * @param string $accountId The ID of the account.
105 * @param array $optParams Optional parameters.
106 *
107 * @opt_param bool force Option to delete sub-accounts with products. The
108 * default value is false.
109 * @throws \Google\Service\Exception
110 */
111 public function delete($merchantId, $accountId, $optParams = [])
112 {
113 $params = ['merchantId' => $merchantId, 'accountId' => $accountId];
114 $params = array_merge($params, $optParams);
115 return $this->call('delete', [$params]);
116 }
117 /**
118 * Retrieves a Merchant Center account. (accounts.get)
119 *
120 * @param string $merchantId The ID of the managing account. If this parameter
121 * is not the same as accountId, then this account must be a multi-client
122 * account and `accountId` must be the ID of a sub-account of this account.
123 * @param string $accountId The ID of the account.
124 * @param array $optParams Optional parameters.
125 *
126 * @opt_param string view Controls which fields will be populated. Acceptable
127 * values are: "merchant" and "css". The default value is "merchant".
128 * @return Account
129 * @throws \Google\Service\Exception
130 */
131 public function get($merchantId, $accountId, $optParams = [])
132 {
133 $params = ['merchantId' => $merchantId, 'accountId' => $accountId];
134 $params = array_merge($params, $optParams);
135 return $this->call('get', [$params], Account::class);
136 }
137 /**
138 * Creates a Merchant Center sub-account. (accounts.insert)
139 *
140 * @param string $merchantId The ID of the managing account. This must be a
141 * multi-client account.
142 * @param Account $postBody
143 * @param array $optParams Optional parameters.
144 * @return Account
145 * @throws \Google\Service\Exception
146 */
147 public function insert($merchantId, Account $postBody, $optParams = [])
148 {
149 $params = ['merchantId' => $merchantId, 'postBody' => $postBody];
150 $params = array_merge($params, $optParams);
151 return $this->call('insert', [$params], Account::class);
152 }
153 /**
154 * Performs an action on a link between two Merchant Center accounts, namely
155 * accountId and linkedAccountId. (accounts.link)
156 *
157 * @param string $merchantId The ID of the managing account. If this parameter
158 * is not the same as accountId, then this account must be a multi-client
159 * account and `accountId` must be the ID of a sub-account of this account.
160 * @param string $accountId The ID of the account that should be linked.
161 * @param AccountsLinkRequest $postBody
162 * @param array $optParams Optional parameters.
163 * @return AccountsLinkResponse
164 * @throws \Google\Service\Exception
165 */
166 public function link($merchantId, $accountId, AccountsLinkRequest $postBody, $optParams = [])
167 {
168 $params = ['merchantId' => $merchantId, 'accountId' => $accountId, 'postBody' => $postBody];
169 $params = array_merge($params, $optParams);
170 return $this->call('link', [$params], AccountsLinkResponse::class);
171 }
172 /**
173 * Lists the sub-accounts in your Merchant Center account.
174 * (accounts.listAccounts)
175 *
176 * @param string $merchantId The ID of the managing account. This must be a
177 * multi-client account.
178 * @param array $optParams Optional parameters.
179 *
180 * @opt_param string label If view is set to "css", only return accounts that
181 * are assigned label with given ID.
182 * @opt_param string maxResults The maximum number of accounts to return in the
183 * response, used for paging.
184 * @opt_param string name If set, only the accounts with the given name (case
185 * sensitive) will be returned.
186 * @opt_param string pageToken The token returned by the previous request.
187 * @opt_param string view Controls which fields will be populated. Acceptable
188 * values are: "merchant" and "css". The default value is "merchant".
189 * @return AccountsListResponse
190 * @throws \Google\Service\Exception
191 */
192 public function listAccounts($merchantId, $optParams = [])
193 {
194 $params = ['merchantId' => $merchantId];
195 $params = array_merge($params, $optParams);
196 return $this->call('list', [$params], AccountsListResponse::class);
197 }
198 /**
199 * Returns the list of accounts linked to your Merchant Center account.
200 * (accounts.listlinks)
201 *
202 * @param string $merchantId The ID of the managing account. If this parameter
203 * is not the same as accountId, then this account must be a multi-client
204 * account and `accountId` must be the ID of a sub-account of this account.
205 * @param string $accountId The ID of the account for which to list links.
206 * @param array $optParams Optional parameters.
207 *
208 * @opt_param string maxResults The maximum number of links to return in the
209 * response, used for pagination. The minimum allowed value is 5 results per
210 * page. If provided value is lower than 5, it will be automatically increased
211 * to 5.
212 * @opt_param string pageToken The token returned by the previous request.
213 * @return AccountsListLinksResponse
214 * @throws \Google\Service\Exception
215 */
216 public function listlinks($merchantId, $accountId, $optParams = [])
217 {
218 $params = ['merchantId' => $merchantId, 'accountId' => $accountId];
219 $params = array_merge($params, $optParams);
220 return $this->call('listlinks', [$params], AccountsListLinksResponse::class);
221 }
222 /**
223 * Request verification code to start phone verification.
224 * (accounts.requestphoneverification)
225 *
226 * @param string $merchantId Required. The ID of the managing account. If this
227 * parameter is not the same as accountId, then this account must be a multi-
228 * client account and accountId must be the ID of a sub-account of this account.
229 * @param string $accountId Required. The ID of the account.
230 * @param RequestPhoneVerificationRequest $postBody
231 * @param array $optParams Optional parameters.
232 * @return RequestPhoneVerificationResponse
233 * @throws \Google\Service\Exception
234 */
235 public function requestphoneverification($merchantId, $accountId, RequestPhoneVerificationRequest $postBody, $optParams = [])
236 {
237 $params = ['merchantId' => $merchantId, 'accountId' => $accountId, 'postBody' => $postBody];
238 $params = array_merge($params, $optParams);
239 return $this->call('requestphoneverification', [$params], RequestPhoneVerificationResponse::class);
240 }
241 /**
242 * Updates a Merchant Center account. Any fields that are not provided are
243 * deleted from the resource. (accounts.update)
244 *
245 * @param string $merchantId The ID of the managing account. If this parameter
246 * is not the same as accountId, then this account must be a multi-client
247 * account and `accountId` must be the ID of a sub-account of this account.
248 * @param string $accountId The ID of the account.
249 * @param Account $postBody
250 * @param array $optParams Optional parameters.
251 * @return Account
252 * @throws \Google\Service\Exception
253 */
254 public function update($merchantId, $accountId, Account $postBody, $optParams = [])
255 {
256 $params = ['merchantId' => $merchantId, 'accountId' => $accountId, 'postBody' => $postBody];
257 $params = array_merge($params, $optParams);
258 return $this->call('update', [$params], Account::class);
259 }
260 /**
261 * Updates labels that are assigned to the Merchant Center account by CSS user.
262 * (accounts.updatelabels)
263 *
264 * @param string $merchantId The ID of the managing account.
265 * @param string $accountId The ID of the account whose labels are updated.
266 * @param AccountsUpdateLabelsRequest $postBody
267 * @param array $optParams Optional parameters.
268 * @return AccountsUpdateLabelsResponse
269 * @throws \Google\Service\Exception
270 */
271 public function updatelabels($merchantId, $accountId, AccountsUpdateLabelsRequest $postBody, $optParams = [])
272 {
273 $params = ['merchantId' => $merchantId, 'accountId' => $accountId, 'postBody' => $postBody];
274 $params = array_merge($params, $optParams);
275 return $this->call('updatelabels', [$params], AccountsUpdateLabelsResponse::class);
276 }
277 /**
278 * Validates verification code to verify phone number for the account. If
279 * successful this will overwrite the value of
280 * `accounts.businessinformation.phoneNumber`. Only verified phone number will
281 * replace an existing verified phone number. (accounts.verifyphonenumber)
282 *
283 * @param string $merchantId Required. The ID of the managing account. If this
284 * parameter is not the same as accountId, then this account must be a multi-
285 * client account and accountId must be the ID of a sub-account of this account.
286 * @param string $accountId Required. The ID of the account.
287 * @param VerifyPhoneNumberRequest $postBody
288 * @param array $optParams Optional parameters.
289 * @return VerifyPhoneNumberResponse
290 * @throws \Google\Service\Exception
291 */
292 public function verifyphonenumber($merchantId, $accountId, VerifyPhoneNumberRequest $postBody, $optParams = [])
293 {
294 $params = ['merchantId' => $merchantId, 'accountId' => $accountId, 'postBody' => $postBody];
295 $params = array_merge($params, $optParams);
296 return $this->call('verifyphonenumber', [$params], VerifyPhoneNumberResponse::class);
297 }
298}
299
300// Adding a class alias for backwards compatibility with the previous class name.
301class_alias(Accounts::class, 'Google_Service_ShoppingContent_Resource_Accounts');
Note: See TracBrowser for help on using the repository browser.