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\ShippingSettings as ShippingSettingsModel;
21use Google\Service\ShoppingContent\ShippingsettingsCustomBatchRequest;
22use Google\Service\ShoppingContent\ShippingsettingsCustomBatchResponse;
23use Google\Service\ShoppingContent\ShippingsettingsGetSupportedCarriersResponse;
24use Google\Service\ShoppingContent\ShippingsettingsGetSupportedHolidaysResponse;
25use Google\Service\ShoppingContent\ShippingsettingsGetSupportedPickupServicesResponse;
26use Google\Service\ShoppingContent\ShippingsettingsListResponse;
27
28/**
29 * The "shippingsettings" collection of methods.
30 * Typical usage is:
31 *  <code>
32 *   $contentService = new Google\Service\ShoppingContent(...);
33 *   $shippingsettings = $contentService->shippingsettings;
34 *  </code>
35 */
36class Shippingsettings extends \Google\Service\Resource
37{
38  /**
39   * Retrieves and updates the shipping settings of multiple accounts in a single
40   * request. (shippingsettings.custombatch)
41   *
42   * @param ShippingsettingsCustomBatchRequest $postBody
43   * @param array $optParams Optional parameters.
44   * @return ShippingsettingsCustomBatchResponse
45   */
46  public function custombatch(ShippingsettingsCustomBatchRequest $postBody, $optParams = [])
47  {
48    $params = ['postBody' => $postBody];
49    $params = array_merge($params, $optParams);
50    return $this->call('custombatch', [$params], ShippingsettingsCustomBatchResponse::class);
51  }
52  /**
53   * Retrieves the shipping settings of the account. (shippingsettings.get)
54   *
55   * @param string $merchantId The ID of the managing account. If this parameter
56   * is not the same as accountId, then this account must be a multi-client
57   * account and `accountId` must be the ID of a sub-account of this account.
58   * @param string $accountId The ID of the account for which to get/update
59   * shipping settings.
60   * @param array $optParams Optional parameters.
61   * @return ShippingSettingsModel
62   */
63  public function get($merchantId, $accountId, $optParams = [])
64  {
65    $params = ['merchantId' => $merchantId, 'accountId' => $accountId];
66    $params = array_merge($params, $optParams);
67    return $this->call('get', [$params], ShippingSettingsModel::class);
68  }
69  /**
70   * Retrieves supported carriers and carrier services for an account.
71   * (shippingsettings.getsupportedcarriers)
72   *
73   * @param string $merchantId The ID of the account for which to retrieve the
74   * supported carriers.
75   * @param array $optParams Optional parameters.
76   * @return ShippingsettingsGetSupportedCarriersResponse
77   */
78  public function getsupportedcarriers($merchantId, $optParams = [])
79  {
80    $params = ['merchantId' => $merchantId];
81    $params = array_merge($params, $optParams);
82    return $this->call('getsupportedcarriers', [$params], ShippingsettingsGetSupportedCarriersResponse::class);
83  }
84  /**
85   * Retrieves supported holidays for an account.
86   * (shippingsettings.getsupportedholidays)
87   *
88   * @param string $merchantId The ID of the account for which to retrieve the
89   * supported holidays.
90   * @param array $optParams Optional parameters.
91   * @return ShippingsettingsGetSupportedHolidaysResponse
92   */
93  public function getsupportedholidays($merchantId, $optParams = [])
94  {
95    $params = ['merchantId' => $merchantId];
96    $params = array_merge($params, $optParams);
97    return $this->call('getsupportedholidays', [$params], ShippingsettingsGetSupportedHolidaysResponse::class);
98  }
99  /**
100   * Retrieves supported pickup services for an account.
101   * (shippingsettings.getsupportedpickupservices)
102   *
103   * @param string $merchantId The ID of the account for which to retrieve the
104   * supported pickup services.
105   * @param array $optParams Optional parameters.
106   * @return ShippingsettingsGetSupportedPickupServicesResponse
107   */
108  public function getsupportedpickupservices($merchantId, $optParams = [])
109  {
110    $params = ['merchantId' => $merchantId];
111    $params = array_merge($params, $optParams);
112    return $this->call('getsupportedpickupservices', [$params], ShippingsettingsGetSupportedPickupServicesResponse::class);
113  }
114  /**
115   * Lists the shipping settings of the sub-accounts in your Merchant Center
116   * account. (shippingsettings.listShippingsettings)
117   *
118   * @param string $merchantId The ID of the managing account. This must be a
119   * multi-client account.
120   * @param array $optParams Optional parameters.
121   *
122   * @opt_param string maxResults The maximum number of shipping settings to
123   * return in the response, used for paging.
124   * @opt_param string pageToken The token returned by the previous request.
125   * @return ShippingsettingsListResponse
126   */
127  public function listShippingsettings($merchantId, $optParams = [])
128  {
129    $params = ['merchantId' => $merchantId];
130    $params = array_merge($params, $optParams);
131    return $this->call('list', [$params], ShippingsettingsListResponse::class);
132  }
133  /**
134   * Updates the shipping settings of the account. Any fields that are not
135   * provided are deleted from the resource. (shippingsettings.update)
136   *
137   * @param string $merchantId The ID of the managing account. If this parameter
138   * is not the same as accountId, then this account must be a multi-client
139   * account and `accountId` must be the ID of a sub-account of this account.
140   * @param string $accountId The ID of the account for which to get/update
141   * shipping settings.
142   * @param ShippingSettingsModel $postBody
143   * @param array $optParams Optional parameters.
144   * @return ShippingSettingsModel
145   */
146  public function update($merchantId, $accountId, ShippingSettingsModel $postBody, $optParams = [])
147  {
148    $params = ['merchantId' => $merchantId, 'accountId' => $accountId, 'postBody' => $postBody];
149    $params = array_merge($params, $optParams);
150    return $this->call('update', [$params], ShippingSettingsModel::class);
151  }
152}
153
154// Adding a class alias for backwards compatibility with the previous class name.
155class_alias(Shippingsettings::class, 'Google_Service_ShoppingContent_Resource_Shippingsettings');
156