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