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\PosCustomBatchRequest;
21use Google\Service\ShoppingContent\PosCustomBatchResponse;
22use Google\Service\ShoppingContent\PosInventoryRequest;
23use Google\Service\ShoppingContent\PosInventoryResponse;
24use Google\Service\ShoppingContent\PosListResponse;
25use Google\Service\ShoppingContent\PosSaleRequest;
26use Google\Service\ShoppingContent\PosSaleResponse;
27use Google\Service\ShoppingContent\PosStore;
28
29/**
30 * The "pos" collection of methods.
31 * Typical usage is:
32 *  <code>
33 *   $contentService = new Google\Service\ShoppingContent(...);
34 *   $pos = $contentService->pos;
35 *  </code>
36 */
37class Pos extends \Google\Service\Resource
38{
39  /**
40   * Batches multiple POS-related calls in a single request. (pos.custombatch)
41   *
42   * @param PosCustomBatchRequest $postBody
43   * @param array $optParams Optional parameters.
44   * @return PosCustomBatchResponse
45   */
46  public function custombatch(PosCustomBatchRequest $postBody, $optParams = [])
47  {
48    $params = ['postBody' => $postBody];
49    $params = array_merge($params, $optParams);
50    return $this->call('custombatch', [$params], PosCustomBatchResponse::class);
51  }
52  /**
53   * Deletes a store for the given merchant. (pos.delete)
54   *
55   * @param string $merchantId The ID of the POS or inventory data provider.
56   * @param string $targetMerchantId The ID of the target merchant.
57   * @param string $storeCode A store code that is unique per merchant.
58   * @param array $optParams Optional parameters.
59   */
60  public function delete($merchantId, $targetMerchantId, $storeCode, $optParams = [])
61  {
62    $params = ['merchantId' => $merchantId, 'targetMerchantId' => $targetMerchantId, 'storeCode' => $storeCode];
63    $params = array_merge($params, $optParams);
64    return $this->call('delete', [$params]);
65  }
66  /**
67   * Retrieves information about the given store. (pos.get)
68   *
69   * @param string $merchantId The ID of the POS or inventory data provider.
70   * @param string $targetMerchantId The ID of the target merchant.
71   * @param string $storeCode A store code that is unique per merchant.
72   * @param array $optParams Optional parameters.
73   * @return PosStore
74   */
75  public function get($merchantId, $targetMerchantId, $storeCode, $optParams = [])
76  {
77    $params = ['merchantId' => $merchantId, 'targetMerchantId' => $targetMerchantId, 'storeCode' => $storeCode];
78    $params = array_merge($params, $optParams);
79    return $this->call('get', [$params], PosStore::class);
80  }
81  /**
82   * Creates a store for the given merchant. (pos.insert)
83   *
84   * @param string $merchantId The ID of the POS or inventory data provider.
85   * @param string $targetMerchantId The ID of the target merchant.
86   * @param PosStore $postBody
87   * @param array $optParams Optional parameters.
88   * @return PosStore
89   */
90  public function insert($merchantId, $targetMerchantId, PosStore $postBody, $optParams = [])
91  {
92    $params = ['merchantId' => $merchantId, 'targetMerchantId' => $targetMerchantId, 'postBody' => $postBody];
93    $params = array_merge($params, $optParams);
94    return $this->call('insert', [$params], PosStore::class);
95  }
96  /**
97   * Submit inventory for the given merchant. (pos.inventory)
98   *
99   * @param string $merchantId The ID of the POS or inventory data provider.
100   * @param string $targetMerchantId The ID of the target merchant.
101   * @param PosInventoryRequest $postBody
102   * @param array $optParams Optional parameters.
103   * @return PosInventoryResponse
104   */
105  public function inventory($merchantId, $targetMerchantId, PosInventoryRequest $postBody, $optParams = [])
106  {
107    $params = ['merchantId' => $merchantId, 'targetMerchantId' => $targetMerchantId, 'postBody' => $postBody];
108    $params = array_merge($params, $optParams);
109    return $this->call('inventory', [$params], PosInventoryResponse::class);
110  }
111  /**
112   * Lists the stores of the target merchant. (pos.listPos)
113   *
114   * @param string $merchantId The ID of the POS or inventory data provider.
115   * @param string $targetMerchantId The ID of the target merchant.
116   * @param array $optParams Optional parameters.
117   * @return PosListResponse
118   */
119  public function listPos($merchantId, $targetMerchantId, $optParams = [])
120  {
121    $params = ['merchantId' => $merchantId, 'targetMerchantId' => $targetMerchantId];
122    $params = array_merge($params, $optParams);
123    return $this->call('list', [$params], PosListResponse::class);
124  }
125  /**
126   * Submit a sale event for the given merchant. (pos.sale)
127   *
128   * @param string $merchantId The ID of the POS or inventory data provider.
129   * @param string $targetMerchantId The ID of the target merchant.
130   * @param PosSaleRequest $postBody
131   * @param array $optParams Optional parameters.
132   * @return PosSaleResponse
133   */
134  public function sale($merchantId, $targetMerchantId, PosSaleRequest $postBody, $optParams = [])
135  {
136    $params = ['merchantId' => $merchantId, 'targetMerchantId' => $targetMerchantId, 'postBody' => $postBody];
137    $params = array_merge($params, $optParams);
138    return $this->call('sale', [$params], PosSaleResponse::class);
139  }
140}
141
142// Adding a class alias for backwards compatibility with the previous class name.
143class_alias(Pos::class, 'Google_Service_ShoppingContent_Resource_Pos');
144