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\RealTimeBidding\Resource; 19 20use Google\Service\RealTimeBidding\CloseUserListRequest; 21use Google\Service\RealTimeBidding\GetRemarketingTagResponse; 22use Google\Service\RealTimeBidding\ListUserListsResponse; 23use Google\Service\RealTimeBidding\OpenUserListRequest; 24use Google\Service\RealTimeBidding\UserList; 25 26/** 27 * The "userLists" collection of methods. 28 * Typical usage is: 29 * <code> 30 * $realtimebiddingService = new Google\Service\RealTimeBidding(...); 31 * $userLists = $realtimebiddingService->userLists; 32 * </code> 33 */ 34class BuyersUserLists extends \Google\Service\Resource 35{ 36 /** 37 * Change the status of a user list to CLOSED. This prevents new users from 38 * being added to the user list. (userLists.close) 39 * 40 * @param string $name Required. The name of the user list to close. See 41 * UserList.name 42 * @param CloseUserListRequest $postBody 43 * @param array $optParams Optional parameters. 44 * @return UserList 45 */ 46 public function close($name, CloseUserListRequest $postBody, $optParams = []) 47 { 48 $params = ['name' => $name, 'postBody' => $postBody]; 49 $params = array_merge($params, $optParams); 50 return $this->call('close', [$params], UserList::class); 51 } 52 /** 53 * Create a new user list. (userLists.create) 54 * 55 * @param string $parent Required. The name of the parent buyer of the user list 56 * to be retrieved that must follow the pattern `buyers/{buyerAccountId}`, where 57 * `{buyerAccountId}` represents the account ID of the buyer who owns user 58 * lists. For a bidder accessing user lists on behalf of a child seat buyer , 59 * `{buyerAccountId}` should represent the account ID of the child seat buyer. 60 * @param UserList $postBody 61 * @param array $optParams Optional parameters. 62 * @return UserList 63 */ 64 public function create($parent, UserList $postBody, $optParams = []) 65 { 66 $params = ['parent' => $parent, 'postBody' => $postBody]; 67 $params = array_merge($params, $optParams); 68 return $this->call('create', [$params], UserList::class); 69 } 70 /** 71 * Gets a user list by its name. (userLists.get) 72 * 73 * @param string $name Required. The name of the user list to be retrieved. See 74 * UserList.name. 75 * @param array $optParams Optional parameters. 76 * @return UserList 77 */ 78 public function get($name, $optParams = []) 79 { 80 $params = ['name' => $name]; 81 $params = array_merge($params, $optParams); 82 return $this->call('get', [$params], UserList::class); 83 } 84 /** 85 * Gets remarketing tag for a buyer. A remarketing tag is a piece of JavaScript 86 * code that can be placed on a web page. When a user visits a page containing a 87 * remarketing tag, Google adds the user to a user list. 88 * (userLists.getRemarketingTag) 89 * 90 * @param string $name Required. To fetch remarketing tag for an account, name 91 * must follow the pattern `buyers/{accountId}` where `{accountId}` represents 92 * ID of a buyer that owns the remarketing tag. For a bidder accessing 93 * remarketing tag on behalf of a child seat buyer, `{accountId}` should 94 * represent the ID of the child seat buyer. To fetch remarketing tag for a 95 * specific user list, name must follow the pattern 96 * `buyers/{accountId}/userLists/{userListId}`. See UserList.name. 97 * @param array $optParams Optional parameters. 98 * @return GetRemarketingTagResponse 99 */ 100 public function getRemarketingTag($name, $optParams = []) 101 { 102 $params = ['name' => $name]; 103 $params = array_merge($params, $optParams); 104 return $this->call('getRemarketingTag', [$params], GetRemarketingTagResponse::class); 105 } 106 /** 107 * Lists the user lists visible to the current user. 108 * (userLists.listBuyersUserLists) 109 * 110 * @param string $parent Required. The name of the parent buyer for the user 111 * lists to be returned that must follow the pattern `buyers/{buyerAccountId}`, 112 * where `{buyerAccountId}` represents the account ID of the buyer who owns user 113 * lists. For a bidder accessing user lists on behalf of a child seat buyer , 114 * `{buyerAccountId}` should represent the account ID of the child seat buyer. 115 * @param array $optParams Optional parameters. 116 * 117 * @opt_param int pageSize The number of results to return per page. 118 * @opt_param string pageToken Continuation page token (as received from a 119 * previous response). 120 * @return ListUserListsResponse 121 */ 122 public function listBuyersUserLists($parent, $optParams = []) 123 { 124 $params = ['parent' => $parent]; 125 $params = array_merge($params, $optParams); 126 return $this->call('list', [$params], ListUserListsResponse::class); 127 } 128 /** 129 * Change the status of a user list to OPEN. This allows new users to be added 130 * to the user list. (userLists.open) 131 * 132 * @param string $name Required. The name of the user list to open. See 133 * UserList.name 134 * @param OpenUserListRequest $postBody 135 * @param array $optParams Optional parameters. 136 * @return UserList 137 */ 138 public function open($name, OpenUserListRequest $postBody, $optParams = []) 139 { 140 $params = ['name' => $name, 'postBody' => $postBody]; 141 $params = array_merge($params, $optParams); 142 return $this->call('open', [$params], UserList::class); 143 } 144 /** 145 * Update the given user list. Only user lists with URLRestrictions can be 146 * updated. (userLists.update) 147 * 148 * @param string $name Output only. Name of the user list that must follow the 149 * pattern `buyers/{buyer}/userLists/{user_list}`, where `{buyer}` represents 150 * the account ID of the buyer who owns the user list. For a bidder accessing 151 * user lists on behalf of a child seat buyer, `{buyer}` represents the account 152 * ID of the child seat buyer. `{user_list}` is an int64 identifier assigned by 153 * Google to uniquely identify a user list. 154 * @param UserList $postBody 155 * @param array $optParams Optional parameters. 156 * @return UserList 157 */ 158 public function update($name, UserList $postBody, $optParams = []) 159 { 160 $params = ['name' => $name, 'postBody' => $postBody]; 161 $params = array_merge($params, $optParams); 162 return $this->call('update', [$params], UserList::class); 163 } 164} 165 166// Adding a class alias for backwards compatibility with the previous class name. 167class_alias(BuyersUserLists::class, 'Google_Service_RealTimeBidding_Resource_BuyersUserLists'); 168