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\MyBusinessPlaceActions\Resource; 19 20use Google\Service\MyBusinessPlaceActions\ListPlaceActionLinksResponse; 21use Google\Service\MyBusinessPlaceActions\MybusinessplaceactionsEmpty; 22use Google\Service\MyBusinessPlaceActions\PlaceActionLink; 23 24/** 25 * The "placeActionLinks" collection of methods. 26 * Typical usage is: 27 * <code> 28 * $mybusinessplaceactionsService = new Google\Service\MyBusinessPlaceActions(...); 29 * $placeActionLinks = $mybusinessplaceactionsService->placeActionLinks; 30 * </code> 31 */ 32class LocationsPlaceActionLinks extends \Google\Service\Resource 33{ 34 /** 35 * Creates a place action link associated with the specified location, and 36 * returns it. The request is considered duplicate if the `parent`, 37 * `place_action_link.uri` and `place_action_link.place_action_type` are the 38 * same as a previous request. (placeActionLinks.create) 39 * 40 * @param string $parent Required. The resource name of the location where to 41 * create this place action link. `locations/{location_id}`. 42 * @param PlaceActionLink $postBody 43 * @param array $optParams Optional parameters. 44 * @return PlaceActionLink 45 */ 46 public function create($parent, PlaceActionLink $postBody, $optParams = []) 47 { 48 $params = ['parent' => $parent, 'postBody' => $postBody]; 49 $params = array_merge($params, $optParams); 50 return $this->call('create', [$params], PlaceActionLink::class); 51 } 52 /** 53 * Deletes a place action link from the specified location. 54 * (placeActionLinks.delete) 55 * 56 * @param string $name Required. The resource name of the place action link to 57 * remove from the location. 58 * @param array $optParams Optional parameters. 59 * @return MybusinessplaceactionsEmpty 60 */ 61 public function delete($name, $optParams = []) 62 { 63 $params = ['name' => $name]; 64 $params = array_merge($params, $optParams); 65 return $this->call('delete', [$params], MybusinessplaceactionsEmpty::class); 66 } 67 /** 68 * Gets the specified place action link. (placeActionLinks.get) 69 * 70 * @param string $name Required. The name of the place action link to fetch. 71 * @param array $optParams Optional parameters. 72 * @return PlaceActionLink 73 */ 74 public function get($name, $optParams = []) 75 { 76 $params = ['name' => $name]; 77 $params = array_merge($params, $optParams); 78 return $this->call('get', [$params], PlaceActionLink::class); 79 } 80 /** 81 * Lists the place action links for the specified location. 82 * (placeActionLinks.listLocationsPlaceActionLinks) 83 * 84 * @param string $parent Required. The name of the location whose place action 85 * links will be listed. `locations/{location_id}`. 86 * @param array $optParams Optional parameters. 87 * 88 * @opt_param string filter Optional. A filter constraining the place action 89 * links to return. The response includes entries that match the filter. We 90 * support only the following filter: 1. place_action_type=XYZ where XYZ is a 91 * valid PlaceActionType. 92 * @opt_param int pageSize Optional. How many place action links to return per 93 * page. Default of 10. The minimum is 1. 94 * @opt_param string pageToken Optional. If specified, returns the next page of 95 * place action links. 96 * @return ListPlaceActionLinksResponse 97 */ 98 public function listLocationsPlaceActionLinks($parent, $optParams = []) 99 { 100 $params = ['parent' => $parent]; 101 $params = array_merge($params, $optParams); 102 return $this->call('list', [$params], ListPlaceActionLinksResponse::class); 103 } 104 /** 105 * Updates the specified place action link and returns it. 106 * (placeActionLinks.patch) 107 * 108 * @param string $name Optional. The resource name, in the format 109 * `locations/{location_id}/placeActionLinks/{place_action_link_id}`. The name 110 * field will only be considered in UpdatePlaceActionLink and 111 * DeletePlaceActionLink requests for updating and deleting links respectively. 112 * However, it will be ignored in CreatePlaceActionLink request, where 113 * `place_action_link_id` will be assigned by the server on successful creation 114 * of a new link and returned as part of the response. 115 * @param PlaceActionLink $postBody 116 * @param array $optParams Optional parameters. 117 * 118 * @opt_param string updateMask Required. The specific fields to update. The 119 * only editable fields are `uri`, `place_action_type` and `is_preferred`. If 120 * the updated link already exists at the same location with the same 121 * `place_action_type` and `uri`, fails with an `ALREADY_EXISTS` error. 122 * @return PlaceActionLink 123 */ 124 public function patch($name, PlaceActionLink $postBody, $optParams = []) 125 { 126 $params = ['name' => $name, 'postBody' => $postBody]; 127 $params = array_merge($params, $optParams); 128 return $this->call('patch', [$params], PlaceActionLink::class); 129 } 130} 131 132// Adding a class alias for backwards compatibility with the previous class name. 133class_alias(LocationsPlaceActionLinks::class, 'Google_Service_MyBusinessPlaceActions_Resource_LocationsPlaceActionLinks'); 134