[e3d4e0a] | 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 |
|
---|
| 18 | namespace Google\Service\MyBusinessBusinessInformation\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\MyBusinessBusinessInformation\ListLocationsResponse;
|
---|
| 21 | use Google\Service\MyBusinessBusinessInformation\Location;
|
---|
| 22 |
|
---|
| 23 | /**
|
---|
| 24 | * The "locations" collection of methods.
|
---|
| 25 | * Typical usage is:
|
---|
| 26 | * <code>
|
---|
| 27 | * $mybusinessbusinessinformationService = new Google\Service\MyBusinessBusinessInformation(...);
|
---|
| 28 | * $locations = $mybusinessbusinessinformationService->accounts_locations;
|
---|
| 29 | * </code>
|
---|
| 30 | */
|
---|
| 31 | class AccountsLocations extends \Google\Service\Resource
|
---|
| 32 | {
|
---|
| 33 | /**
|
---|
| 34 | * Creates a new Location that will be owned by the logged in user.
|
---|
| 35 | * (locations.create)
|
---|
| 36 | *
|
---|
| 37 | * @param string $parent Required. The name of the account in which to create
|
---|
| 38 | * this location.
|
---|
| 39 | * @param Location $postBody
|
---|
| 40 | * @param array $optParams Optional parameters.
|
---|
| 41 | *
|
---|
| 42 | * @opt_param string requestId Optional. A unique request ID for the server to
|
---|
| 43 | * detect duplicated requests. We recommend using UUIDs. Max length is 50
|
---|
| 44 | * characters.
|
---|
| 45 | * @opt_param bool validateOnly Optional. If true, the request is validated
|
---|
| 46 | * without actually creating the location.
|
---|
| 47 | * @return Location
|
---|
| 48 | * @throws \Google\Service\Exception
|
---|
| 49 | */
|
---|
| 50 | public function create($parent, Location $postBody, $optParams = [])
|
---|
| 51 | {
|
---|
| 52 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 53 | $params = array_merge($params, $optParams);
|
---|
| 54 | return $this->call('create', [$params], Location::class);
|
---|
| 55 | }
|
---|
| 56 | /**
|
---|
| 57 | * Lists the locations for the specified account.
|
---|
| 58 | * (locations.listAccountsLocations)
|
---|
| 59 | *
|
---|
| 60 | * @param string $parent Required. The name of the account to fetch locations
|
---|
| 61 | * from. If the parent Account is of AccountType PERSONAL, only Locations that
|
---|
| 62 | * are directly owned by the Account are returned, otherwise it will return all
|
---|
| 63 | * accessible locations from the Account, either directly or indirectly.
|
---|
| 64 | * @param array $optParams Optional parameters.
|
---|
| 65 | *
|
---|
| 66 | * @opt_param string filter Optional. A filter constraining the locations to
|
---|
| 67 | * return. The response includes only entries that match the filter. If `filter`
|
---|
| 68 | * is empty, then constraints are applied and all locations (paginated) are
|
---|
| 69 | * retrieved for the requested account. For more information about valid fields
|
---|
| 70 | * and example usage, see [Work with Location Data
|
---|
| 71 | * Guide](https://developers.google.com/my-business/content/location-
|
---|
| 72 | * data#filter_results_when_you_list_locations).
|
---|
| 73 | * @opt_param string orderBy Optional. Sorting order for the request. Multiple
|
---|
| 74 | * fields should be comma-separated, following SQL syntax. The default sorting
|
---|
| 75 | * order is ascending. To specify descending order, a suffix " desc" should be
|
---|
| 76 | * added. Valid fields to order_by are title and store_code. For example:
|
---|
| 77 | * "title, store_code desc" or "title" or "store_code desc"
|
---|
| 78 | * @opt_param int pageSize Optional. How many locations to fetch per page.
|
---|
| 79 | * Default value is 10 if not set. Minimum is 1, and maximum page size is 100.
|
---|
| 80 | * @opt_param string pageToken Optional. If specified, it fetches the next
|
---|
| 81 | * `page` of locations. The page token is returned by previous calls to
|
---|
| 82 | * `ListLocations` when there were more locations than could fit in the
|
---|
| 83 | * requested page size.
|
---|
| 84 | * @opt_param string readMask Required. Read mask to specify what fields will be
|
---|
| 85 | * returned in the response.
|
---|
| 86 | * @return ListLocationsResponse
|
---|
| 87 | * @throws \Google\Service\Exception
|
---|
| 88 | */
|
---|
| 89 | public function listAccountsLocations($parent, $optParams = [])
|
---|
| 90 | {
|
---|
| 91 | $params = ['parent' => $parent];
|
---|
| 92 | $params = array_merge($params, $optParams);
|
---|
| 93 | return $this->call('list', [$params], ListLocationsResponse::class);
|
---|
| 94 | }
|
---|
| 95 | }
|
---|
| 96 |
|
---|
| 97 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 98 | class_alias(AccountsLocations::class, 'Google_Service_MyBusinessBusinessInformation_Resource_AccountsLocations');
|
---|