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\DisplayvideoEmpty; 21use Google\Service\DisplayVideo\ListNegativeKeywordListsResponse; 22use Google\Service\DisplayVideo\NegativeKeywordList; 23 24/** 25 * The "negativeKeywordLists" collection of methods. 26 * Typical usage is: 27 * <code> 28 * $displayvideoService = new Google\Service\DisplayVideo(...); 29 * $negativeKeywordLists = $displayvideoService->negativeKeywordLists; 30 * </code> 31 */ 32class AdvertisersNegativeKeywordLists extends \Google\Service\Resource 33{ 34 /** 35 * Creates a new negative keyword list. Returns the newly created negative 36 * keyword list if successful. (negativeKeywordLists.create) 37 * 38 * @param string $advertiserId Required. The ID of the DV360 advertiser to which 39 * the negative keyword list will belong. 40 * @param NegativeKeywordList $postBody 41 * @param array $optParams Optional parameters. 42 * @return NegativeKeywordList 43 */ 44 public function create($advertiserId, NegativeKeywordList $postBody, $optParams = []) 45 { 46 $params = ['advertiserId' => $advertiserId, 'postBody' => $postBody]; 47 $params = array_merge($params, $optParams); 48 return $this->call('create', [$params], NegativeKeywordList::class); 49 } 50 /** 51 * Deletes a negative keyword list given an advertiser ID and a negative keyword 52 * list ID. (negativeKeywordLists.delete) 53 * 54 * @param string $advertiserId Required. The ID of the DV360 advertiser to which 55 * the negative keyword list belongs. 56 * @param string $negativeKeywordListId Required. The ID of the negative keyword 57 * list to delete. 58 * @param array $optParams Optional parameters. 59 * @return DisplayvideoEmpty 60 */ 61 public function delete($advertiserId, $negativeKeywordListId, $optParams = []) 62 { 63 $params = ['advertiserId' => $advertiserId, 'negativeKeywordListId' => $negativeKeywordListId]; 64 $params = array_merge($params, $optParams); 65 return $this->call('delete', [$params], DisplayvideoEmpty::class); 66 } 67 /** 68 * Gets a negative keyword list given an advertiser ID and a negative keyword 69 * list ID. (negativeKeywordLists.get) 70 * 71 * @param string $advertiserId Required. The ID of the DV360 advertiser to which 72 * the fetched negative keyword list belongs. 73 * @param string $negativeKeywordListId Required. The ID of the negative keyword 74 * list to fetch. 75 * @param array $optParams Optional parameters. 76 * @return NegativeKeywordList 77 */ 78 public function get($advertiserId, $negativeKeywordListId, $optParams = []) 79 { 80 $params = ['advertiserId' => $advertiserId, 'negativeKeywordListId' => $negativeKeywordListId]; 81 $params = array_merge($params, $optParams); 82 return $this->call('get', [$params], NegativeKeywordList::class); 83 } 84 /** 85 * Lists negative keyword lists based on a given advertiser id. 86 * (negativeKeywordLists.listAdvertisersNegativeKeywordLists) 87 * 88 * @param string $advertiserId Required. The ID of the DV360 advertiser to which 89 * the fetched negative keyword lists belong. 90 * @param array $optParams Optional parameters. 91 * 92 * @opt_param int pageSize Requested page size. Must be between `1` and `100`. 93 * Defaults to `100` if not set. Returns error code `INVALID_ARGUMENT` if an 94 * invalid value is specified. 95 * @opt_param string pageToken A token identifying a page of results the server 96 * should return. Typically, this is the value of next_page_token returned from 97 * the previous call to `ListNegativeKeywordLists` method. If not specified, the 98 * first page of results will be returned. 99 * @return ListNegativeKeywordListsResponse 100 */ 101 public function listAdvertisersNegativeKeywordLists($advertiserId, $optParams = []) 102 { 103 $params = ['advertiserId' => $advertiserId]; 104 $params = array_merge($params, $optParams); 105 return $this->call('list', [$params], ListNegativeKeywordListsResponse::class); 106 } 107 /** 108 * Updates a negative keyword list. Returns the updated negative keyword list if 109 * successful. (negativeKeywordLists.patch) 110 * 111 * @param string $advertiserId Required. The ID of the DV360 advertiser to which 112 * the negative keyword list belongs. 113 * @param string $negativeKeywordListId Output only. The unique ID of the 114 * negative keyword list. Assigned by the system. 115 * @param NegativeKeywordList $postBody 116 * @param array $optParams Optional parameters. 117 * 118 * @opt_param string updateMask Required. The mask to control which fields to 119 * update. 120 * @return NegativeKeywordList 121 */ 122 public function patch($advertiserId, $negativeKeywordListId, NegativeKeywordList $postBody, $optParams = []) 123 { 124 $params = ['advertiserId' => $advertiserId, 'negativeKeywordListId' => $negativeKeywordListId, 'postBody' => $postBody]; 125 $params = array_merge($params, $optParams); 126 return $this->call('patch', [$params], NegativeKeywordList::class); 127 } 128} 129 130// Adding a class alias for backwards compatibility with the previous class name. 131class_alias(AdvertisersNegativeKeywordLists::class, 'Google_Service_DisplayVideo_Resource_AdvertisersNegativeKeywordLists'); 132