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\LocalInventory as LocalInventoryModel;
21use Google\Service\ShoppingContent\LocalinventoryCustomBatchRequest;
22use 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 */
32class 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   */
42  public function custombatch(LocalinventoryCustomBatchRequest $postBody, $optParams = [])
43  {
44    $params = ['postBody' => $postBody];
45    $params = array_merge($params, $optParams);
46    return $this->call('custombatch', [$params], LocalinventoryCustomBatchResponse::class);
47  }
48  /**
49   * Updates the local inventory of a product in your Merchant Center account.
50   * (localinventory.insert)
51   *
52   * @param string $merchantId The ID of the account that contains the product.
53   * This account cannot be a multi-client account.
54   * @param string $productId The REST ID of the product for which to update local
55   * inventory.
56   * @param LocalInventoryModel $postBody
57   * @param array $optParams Optional parameters.
58   * @return LocalInventoryModel
59   */
60  public function insert($merchantId, $productId, LocalInventoryModel $postBody, $optParams = [])
61  {
62    $params = ['merchantId' => $merchantId, 'productId' => $productId, 'postBody' => $postBody];
63    $params = array_merge($params, $optParams);
64    return $this->call('insert', [$params], LocalInventoryModel::class);
65  }
66}
67
68// Adding a class alias for backwards compatibility with the previous class name.
69class_alias(Localinventory::class, 'Google_Service_ShoppingContent_Resource_Localinventory');
70