source: vendor/google/apiclient-services/src/ShoppingContent/Resource/Regions.php

Last change on this file was e3d4e0a, checked in by Vlado 222039 <vlado.popovski@…>, 2 weeks ago

Upload project files

  • Property mode set to 100644
File size: 4.9 KB
Line 
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\ListRegionsResponse;
21use Google\Service\ShoppingContent\Region;
22
23/**
24 * The "regions" collection of methods.
25 * Typical usage is:
26 * <code>
27 * $contentService = new Google\Service\ShoppingContent(...);
28 * $regions = $contentService->regions;
29 * </code>
30 */
31class Regions extends \Google\Service\Resource
32{
33 /**
34 * Creates a region definition in your Merchant Center account. (regions.create)
35 *
36 * @param string $merchantId Required. The id of the merchant for which to
37 * create region definition.
38 * @param Region $postBody
39 * @param array $optParams Optional parameters.
40 *
41 * @opt_param string regionId Required. The id of the region to create.
42 * @return Region
43 * @throws \Google\Service\Exception
44 */
45 public function create($merchantId, Region $postBody, $optParams = [])
46 {
47 $params = ['merchantId' => $merchantId, 'postBody' => $postBody];
48 $params = array_merge($params, $optParams);
49 return $this->call('create', [$params], Region::class);
50 }
51 /**
52 * Deletes a region definition from your Merchant Center account.
53 * (regions.delete)
54 *
55 * @param string $merchantId Required. The id of the merchant for which to
56 * delete region definition.
57 * @param string $regionId Required. The id of the region to delete.
58 * @param array $optParams Optional parameters.
59 * @throws \Google\Service\Exception
60 */
61 public function delete($merchantId, $regionId, $optParams = [])
62 {
63 $params = ['merchantId' => $merchantId, 'regionId' => $regionId];
64 $params = array_merge($params, $optParams);
65 return $this->call('delete', [$params]);
66 }
67 /**
68 * Retrieves a region defined in your Merchant Center account. (regions.get)
69 *
70 * @param string $merchantId Required. The id of the merchant for which to
71 * retrieve region definition.
72 * @param string $regionId Required. The id of the region to retrieve.
73 * @param array $optParams Optional parameters.
74 * @return Region
75 * @throws \Google\Service\Exception
76 */
77 public function get($merchantId, $regionId, $optParams = [])
78 {
79 $params = ['merchantId' => $merchantId, 'regionId' => $regionId];
80 $params = array_merge($params, $optParams);
81 return $this->call('get', [$params], Region::class);
82 }
83 /**
84 * Lists the regions in your Merchant Center account. (regions.listRegions)
85 *
86 * @param string $merchantId Required. The id of the merchant for which to list
87 * region definitions.
88 * @param array $optParams Optional parameters.
89 *
90 * @opt_param int pageSize The maximum number of regions to return. The service
91 * may return fewer than this value. If unspecified, at most 50 rules will be
92 * returned. The maximum value is 1000; values above 1000 will be coerced to
93 * 1000.
94 * @opt_param string pageToken A page token, received from a previous
95 * `ListRegions` call. Provide this to retrieve the subsequent page. When
96 * paginating, all other parameters provided to `ListRegions` must match the
97 * call that provided the page token.
98 * @return ListRegionsResponse
99 * @throws \Google\Service\Exception
100 */
101 public function listRegions($merchantId, $optParams = [])
102 {
103 $params = ['merchantId' => $merchantId];
104 $params = array_merge($params, $optParams);
105 return $this->call('list', [$params], ListRegionsResponse::class);
106 }
107 /**
108 * Updates a region definition in your Merchant Center account. (regions.patch)
109 *
110 * @param string $merchantId Required. The id of the merchant for which to
111 * update region definition.
112 * @param string $regionId Required. The id of the region to update.
113 * @param Region $postBody
114 * @param array $optParams Optional parameters.
115 *
116 * @opt_param string updateMask Optional. The comma-separated field mask
117 * indicating the fields to update. Example:
118 * `"displayName,postalCodeArea.regionCode"`.
119 * @return Region
120 * @throws \Google\Service\Exception
121 */
122 public function patch($merchantId, $regionId, Region $postBody, $optParams = [])
123 {
124 $params = ['merchantId' => $merchantId, 'regionId' => $regionId, 'postBody' => $postBody];
125 $params = array_merge($params, $optParams);
126 return $this->call('patch', [$params], Region::class);
127 }
128}
129
130// Adding a class alias for backwards compatibility with the previous class name.
131class_alias(Regions::class, 'Google_Service_ShoppingContent_Resource_Regions');
Note: See TracBrowser for help on using the repository browser.