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\ShoppingContent\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\ShoppingContent\LocalInventory as LocalInventoryModel;
|
---|
21 | use Google\Service\ShoppingContent\LocalinventoryCustomBatchRequest;
|
---|
22 | use Google\Service\ShoppingContent\LocalinventoryCustomBatchResponse;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * The "localinventory" collection of methods.
|
---|
26 | * Typical usage is:
|
---|
27 | * <code>
|
---|
28 | * $contentService = new Google\Service\ShoppingContent(...);
|
---|
29 | * $localinventory = $contentService->localinventory;
|
---|
30 | * </code>
|
---|
31 | */
|
---|
32 | class Localinventory extends \Google\Service\Resource
|
---|
33 | {
|
---|
34 | /**
|
---|
35 | * Updates local inventory for multiple products or stores in a single request.
|
---|
36 | * (localinventory.custombatch)
|
---|
37 | *
|
---|
38 | * @param LocalinventoryCustomBatchRequest $postBody
|
---|
39 | * @param array $optParams Optional parameters.
|
---|
40 | * @return LocalinventoryCustomBatchResponse
|
---|
41 | * @throws \Google\Service\Exception
|
---|
42 | */
|
---|
43 | public function custombatch(LocalinventoryCustomBatchRequest $postBody, $optParams = [])
|
---|
44 | {
|
---|
45 | $params = ['postBody' => $postBody];
|
---|
46 | $params = array_merge($params, $optParams);
|
---|
47 | return $this->call('custombatch', [$params], LocalinventoryCustomBatchResponse::class);
|
---|
48 | }
|
---|
49 | /**
|
---|
50 | * Updates the local inventory of a product in your Merchant Center account.
|
---|
51 | * (localinventory.insert)
|
---|
52 | *
|
---|
53 | * @param string $merchantId The ID of the account that contains the product.
|
---|
54 | * This account cannot be a multi-client account.
|
---|
55 | * @param string $productId The REST ID of the product for which to update local
|
---|
56 | * inventory.
|
---|
57 | * @param LocalInventoryModel $postBody
|
---|
58 | * @param array $optParams Optional parameters.
|
---|
59 | * @return LocalInventoryModel
|
---|
60 | * @throws \Google\Service\Exception
|
---|
61 | */
|
---|
62 | public function insert($merchantId, $productId, LocalInventoryModel $postBody, $optParams = [])
|
---|
63 | {
|
---|
64 | $params = ['merchantId' => $merchantId, 'productId' => $productId, 'postBody' => $postBody];
|
---|
65 | $params = array_merge($params, $optParams);
|
---|
66 | return $this->call('insert', [$params], LocalInventoryModel::class);
|
---|
67 | }
|
---|
68 | }
|
---|
69 |
|
---|
70 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
71 | class_alias(Localinventory::class, 'Google_Service_ShoppingContent_Resource_Localinventory');
|
---|