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\DisplayVideo\Resource; 19 20use Google\Service\DisplayVideo\ListLocationListsResponse; 21use Google\Service\DisplayVideo\LocationList; 22 23/** 24 * The "locationLists" collection of methods. 25 * Typical usage is: 26 * <code> 27 * $displayvideoService = new Google\Service\DisplayVideo(...); 28 * $locationLists = $displayvideoService->locationLists; 29 * </code> 30 */ 31class AdvertisersLocationLists extends \Google\Service\Resource 32{ 33 /** 34 * Creates a new location list. Returns the newly created location list if 35 * successful. (locationLists.create) 36 * 37 * @param string $advertiserId Required. The ID of the DV360 advertiser to which 38 * the location list belongs. 39 * @param LocationList $postBody 40 * @param array $optParams Optional parameters. 41 * @return LocationList 42 */ 43 public function create($advertiserId, LocationList $postBody, $optParams = []) 44 { 45 $params = ['advertiserId' => $advertiserId, 'postBody' => $postBody]; 46 $params = array_merge($params, $optParams); 47 return $this->call('create', [$params], LocationList::class); 48 } 49 /** 50 * Gets a location list. (locationLists.get) 51 * 52 * @param string $advertiserId Required. The ID of the DV360 advertiser to which 53 * the fetched location list belongs. 54 * @param string $locationListId Required. The ID of the location list to fetch. 55 * @param array $optParams Optional parameters. 56 * @return LocationList 57 */ 58 public function get($advertiserId, $locationListId, $optParams = []) 59 { 60 $params = ['advertiserId' => $advertiserId, 'locationListId' => $locationListId]; 61 $params = array_merge($params, $optParams); 62 return $this->call('get', [$params], LocationList::class); 63 } 64 /** 65 * Lists location lists based on a given advertiser id. 66 * (locationLists.listAdvertisersLocationLists) 67 * 68 * @param string $advertiserId Required. The ID of the DV360 advertiser to which 69 * the fetched location lists belong. 70 * @param array $optParams Optional parameters. 71 * 72 * @opt_param string filter Allows filtering by location list fields. Supported 73 * syntax: * Filter expressions are made up of one or more restrictions. * 74 * Restrictions can be combined by `AND` or `OR` logical operators. A sequence 75 * of restrictions implicitly uses `AND`. * A restriction has the form of 76 * `{field} {operator} {value}`. * The operator must be `EQUALS (=)`. * 77 * Supported fields: - `locationType` Examples: * All regional location list: 78 * `locationType="TARGETING_LOCATION_TYPE_REGIONAL"` * All proximity location 79 * list: `locationType="TARGETING_LOCATION_TYPE_PROXIMITY"` 80 * @opt_param string orderBy Field by which to sort the list. Acceptable values 81 * are: * `locationListId` (default) * `displayName` The default sorting order 82 * is ascending. To specify descending order for a field, a suffix "desc" should 83 * be added to the field name. Example: `displayName desc`. 84 * @opt_param int pageSize Requested page size. Must be between `1` and `100`. 85 * Defaults to `100` if not set. Returns error code `INVALID_ARGUMENT` if an 86 * invalid value is specified. 87 * @opt_param string pageToken A token identifying a page of results the server 88 * should return. Typically, this is the value of next_page_token returned from 89 * the previous call to `ListLocationLists` method. If not specified, the first 90 * page of results will be returned. 91 * @return ListLocationListsResponse 92 */ 93 public function listAdvertisersLocationLists($advertiserId, $optParams = []) 94 { 95 $params = ['advertiserId' => $advertiserId]; 96 $params = array_merge($params, $optParams); 97 return $this->call('list', [$params], ListLocationListsResponse::class); 98 } 99 /** 100 * Updates a location list. Returns the updated location list if successful. 101 * (locationLists.patch) 102 * 103 * @param string $advertiserId Required. The ID of the DV360 advertiser to which 104 * the location lists belongs. 105 * @param string $locationListId Output only. The unique ID of the location 106 * list. Assigned by the system. 107 * @param LocationList $postBody 108 * @param array $optParams Optional parameters. 109 * 110 * @opt_param string updateMask Required. The mask to control which fields to 111 * update. 112 * @return LocationList 113 */ 114 public function patch($advertiserId, $locationListId, LocationList $postBody, $optParams = []) 115 { 116 $params = ['advertiserId' => $advertiserId, 'locationListId' => $locationListId, 'postBody' => $postBody]; 117 $params = array_merge($params, $optParams); 118 return $this->call('patch', [$params], LocationList::class); 119 } 120} 121 122// Adding a class alias for backwards compatibility with the previous class name. 123class_alias(AdvertisersLocationLists::class, 'Google_Service_DisplayVideo_Resource_AdvertisersLocationLists'); 124