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\ReturnAddress as ReturnAddressModel;
21use Google\Service\ShoppingContent\ReturnaddressCustomBatchRequest;
22use Google\Service\ShoppingContent\ReturnaddressCustomBatchResponse;
23use Google\Service\ShoppingContent\ReturnaddressListResponse;
24
25/**
26 * The "returnaddress" collection of methods.
27 * Typical usage is:
28 *  <code>
29 *   $contentService = new Google\Service\ShoppingContent(...);
30 *   $returnaddress = $contentService->returnaddress;
31 *  </code>
32 */
33class Returnaddress extends \Google\Service\Resource
34{
35  /**
36   * Batches multiple return address related calls in a single request.
37   * (returnaddress.custombatch)
38   *
39   * @param ReturnaddressCustomBatchRequest $postBody
40   * @param array $optParams Optional parameters.
41   * @return ReturnaddressCustomBatchResponse
42   */
43  public function custombatch(ReturnaddressCustomBatchRequest $postBody, $optParams = [])
44  {
45    $params = ['postBody' => $postBody];
46    $params = array_merge($params, $optParams);
47    return $this->call('custombatch', [$params], ReturnaddressCustomBatchResponse::class);
48  }
49  /**
50   * Deletes a return address for the given Merchant Center account.
51   * (returnaddress.delete)
52   *
53   * @param string $merchantId The Merchant Center account from which to delete
54   * the given return address.
55   * @param string $returnAddressId Return address ID generated by Google.
56   * @param array $optParams Optional parameters.
57   */
58  public function delete($merchantId, $returnAddressId, $optParams = [])
59  {
60    $params = ['merchantId' => $merchantId, 'returnAddressId' => $returnAddressId];
61    $params = array_merge($params, $optParams);
62    return $this->call('delete', [$params]);
63  }
64  /**
65   * Gets a return address of the Merchant Center account. (returnaddress.get)
66   *
67   * @param string $merchantId The Merchant Center account to get a return address
68   * for.
69   * @param string $returnAddressId Return address ID generated by Google.
70   * @param array $optParams Optional parameters.
71   * @return ReturnAddressModel
72   */
73  public function get($merchantId, $returnAddressId, $optParams = [])
74  {
75    $params = ['merchantId' => $merchantId, 'returnAddressId' => $returnAddressId];
76    $params = array_merge($params, $optParams);
77    return $this->call('get', [$params], ReturnAddressModel::class);
78  }
79  /**
80   * Inserts a return address for the Merchant Center account.
81   * (returnaddress.insert)
82   *
83   * @param string $merchantId The Merchant Center account to insert a return
84   * address for.
85   * @param ReturnAddressModel $postBody
86   * @param array $optParams Optional parameters.
87   * @return ReturnAddressModel
88   */
89  public function insert($merchantId, ReturnAddressModel $postBody, $optParams = [])
90  {
91    $params = ['merchantId' => $merchantId, 'postBody' => $postBody];
92    $params = array_merge($params, $optParams);
93    return $this->call('insert', [$params], ReturnAddressModel::class);
94  }
95  /**
96   * Lists the return addresses of the Merchant Center account.
97   * (returnaddress.listReturnaddress)
98   *
99   * @param string $merchantId The Merchant Center account to list return
100   * addresses for.
101   * @param array $optParams Optional parameters.
102   *
103   * @opt_param string country List only return addresses applicable to the given
104   * country of sale. When omitted, all return addresses are listed.
105   * @opt_param string maxResults The maximum number of addresses in the response,
106   * used for paging.
107   * @opt_param string pageToken The token returned by the previous request.
108   * @return ReturnaddressListResponse
109   */
110  public function listReturnaddress($merchantId, $optParams = [])
111  {
112    $params = ['merchantId' => $merchantId];
113    $params = array_merge($params, $optParams);
114    return $this->call('list', [$params], ReturnaddressListResponse::class);
115  }
116}
117
118// Adding a class alias for backwards compatibility with the previous class name.
119class_alias(Returnaddress::class, 'Google_Service_ShoppingContent_Resource_Returnaddress');
120