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\ProductStatus;
21use Google\Service\ShoppingContent\ProductstatusesCustomBatchRequest;
22use Google\Service\ShoppingContent\ProductstatusesCustomBatchResponse;
23use Google\Service\ShoppingContent\ProductstatusesListResponse;
24
25/**
26 * The "productstatuses" collection of methods.
27 * Typical usage is:
28 *  <code>
29 *   $contentService = new Google\Service\ShoppingContent(...);
30 *   $productstatuses = $contentService->productstatuses;
31 *  </code>
32 */
33class Productstatuses extends \Google\Service\Resource
34{
35  /**
36   * Gets the statuses of multiple products in a single request.
37   * (productstatuses.custombatch)
38   *
39   * @param ProductstatusesCustomBatchRequest $postBody
40   * @param array $optParams Optional parameters.
41   * @return ProductstatusesCustomBatchResponse
42   */
43  public function custombatch(ProductstatusesCustomBatchRequest $postBody, $optParams = [])
44  {
45    $params = ['postBody' => $postBody];
46    $params = array_merge($params, $optParams);
47    return $this->call('custombatch', [$params], ProductstatusesCustomBatchResponse::class);
48  }
49  /**
50   * Gets the status of a product from your Merchant Center account.
51   * (productstatuses.get)
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.
56   * @param array $optParams Optional parameters.
57   *
58   * @opt_param string destinations If set, only issues for the specified
59   * destinations are returned, otherwise only issues for the Shopping
60   * destination.
61   * @return ProductStatus
62   */
63  public function get($merchantId, $productId, $optParams = [])
64  {
65    $params = ['merchantId' => $merchantId, 'productId' => $productId];
66    $params = array_merge($params, $optParams);
67    return $this->call('get', [$params], ProductStatus::class);
68  }
69  /**
70   * Lists the statuses of the products in your Merchant Center account.
71   * (productstatuses.listProductstatuses)
72   *
73   * @param string $merchantId The ID of the account that contains the products.
74   * This account cannot be a multi-client account.
75   * @param array $optParams Optional parameters.
76   *
77   * @opt_param string destinations If set, only issues for the specified
78   * destinations are returned, otherwise only issues for the Shopping
79   * destination.
80   * @opt_param string maxResults The maximum number of product statuses to return
81   * in the response, used for paging.
82   * @opt_param string pageToken The token returned by the previous request.
83   * @return ProductstatusesListResponse
84   */
85  public function listProductstatuses($merchantId, $optParams = [])
86  {
87    $params = ['merchantId' => $merchantId];
88    $params = array_merge($params, $optParams);
89    return $this->call('list', [$params], ProductstatusesListResponse::class);
90  }
91}
92
93// Adding a class alias for backwards compatibility with the previous class name.
94class_alias(Productstatuses::class, 'Google_Service_ShoppingContent_Resource_Productstatuses');
95