forked from googleapis/google-api-php-client-services
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLocations.php
More file actions
161 lines (157 loc) · 6.65 KB
/
Locations.php
File metadata and controls
161 lines (157 loc) · 6.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\MyBusinessBusinessInformation\Resource;
use Google\Service\MyBusinessBusinessInformation\Attributes as AttributesModel;
use Google\Service\MyBusinessBusinessInformation\GoogleUpdatedLocation;
use Google\Service\MyBusinessBusinessInformation\Location;
use Google\Service\MyBusinessBusinessInformation\MybusinessbusinessinformationEmpty;
/**
* The "locations" collection of methods.
* Typical usage is:
* <code>
* $mybusinessbusinessinformationService = new Google\Service\MyBusinessBusinessInformation(...);
* $locations = $mybusinessbusinessinformationService->locations;
* </code>
*/
class Locations extends \Google\Service\Resource
{
/**
* Deletes a location. If this location cannot be deleted using the API and it
* is marked so in the `google.mybusiness.businessinformation.v1.LocationState`,
* use the [Google Business Profile](https://business.google.com/manage/)
* website. (locations.delete)
*
* @param string $name Required. The name of the location to delete.
* @param array $optParams Optional parameters.
* @return MybusinessbusinessinformationEmpty
* @throws \Google\Service\Exception
*/
public function delete($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params], MybusinessbusinessinformationEmpty::class);
}
/**
* Returns the specified location as last set by the merchant. It may not
* reflect updates from Google or user-generated content that are live on Google
* Maps. (locations.get)
*
* @param string $name Required. The name of the location to fetch.
* @param array $optParams Optional parameters.
*
* @opt_param string readMask Required. Read mask to specify what fields will be
* returned in the response.
* @return Location
* @throws \Google\Service\Exception
*/
public function get($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], Location::class);
}
/**
* Retrieves attributes for a location as last set by the merchant. It may not
* reflect updates from Google or user-generated content that are live on Google
* Maps. (locations.getAttributes)
*
* @param string $name Required. Google identifier for this location in the form
* of `locations/{location_id}/attributes`.
* @param array $optParams Optional parameters.
* @return AttributesModel
* @throws \Google\Service\Exception
*/
public function getAttributes($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('getAttributes', [$params], AttributesModel::class);
}
/**
* Returns the specified location as it appears live on Google Maps and Search.
* This consumer-facing view may have been updated by Google or user-generated
* content and may differ from the merchant's version. The returned
* GoogleUpdatedLocation contains masks that indicate which fields differ from
* the merchant's information. (locations.getGoogleUpdated)
*
* @param string $name Required. The name of the location to fetch.
* @param array $optParams Optional parameters.
*
* @opt_param string readMask Required. Read mask to specify what fields will be
* returned in the response.
* @return GoogleUpdatedLocation
* @throws \Google\Service\Exception
*/
public function getGoogleUpdated($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('getGoogleUpdated', [$params], GoogleUpdatedLocation::class);
}
/**
* Updates the specified location. (locations.patch)
*
* @param string $name Google identifier for this location in the form:
* `locations/{location_id}`.
* @param Location $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string updateMask Required. The specific fields to update.
* @opt_param bool validateOnly Optional. If true, the request is validated
* without actually updating the location. When this field is set, we will only
* return validation errors if there were any. The response will be empty if no
* errors were found.
* @return Location
* @throws \Google\Service\Exception
*/
public function patch($name, Location $postBody, $optParams = [])
{
$params = ['name' => $name, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('patch', [$params], Location::class);
}
/**
* Update attributes for a given location. (locations.updateAttributes)
*
* @param string $name Required. Google identifier for this location in the form
* of `locations/{location_id}/attributes`.
* @param AttributesModel $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string attributeMask Required. Attribute name of attributes that
* you'd like to update. Represented by `attributes/{attribute}`. Updates: All
* attributes provided in the attributes field that you would like to update
* must be set in the `attribute_mask`. Attributes set in the above list but not
* in the `attribute_mask` will be ignored. Deletes: If you'd like to delete
* certain attributes, they must be specified in the `attribute_mask` with no
* matching entry in the attributes list. If you'd like to delete all attributes
* set on a location, you should look up all the applicable attributes for the
* location and then add them to the `attribute_mask` with an empty attributes
* field.
* @return AttributesModel
* @throws \Google\Service\Exception
*/
public function updateAttributes($name, AttributesModel $postBody, $optParams = [])
{
$params = ['name' => $name, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('updateAttributes', [$params], AttributesModel::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Locations::class, 'Google_Service_MyBusinessBusinessInformation_Resource_Locations');