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\ListCreativesResponse; 21use Google\Service\RealTimeBidding\WatchCreativesRequest; 22use Google\Service\RealTimeBidding\WatchCreativesResponse; 23 24/** 25 * The "creatives" collection of methods. 26 * Typical usage is: 27 * <code> 28 * $realtimebiddingService = new Google\Service\RealTimeBidding(...); 29 * $creatives = $realtimebiddingService->creatives; 30 * </code> 31 */ 32class BiddersCreatives extends \Google\Service\Resource 33{ 34 /** 35 * Lists creatives. (creatives.listBiddersCreatives) 36 * 37 * @param string $parent Required. Name of the parent buyer that owns the 38 * creatives. The pattern for this resource is either `buyers/{buyerAccountId}` 39 * or `bidders/{bidderAccountId}`. For `buyers/{buyerAccountId}`, the 40 * `buyerAccountId` can be one of the following: 1. The ID of the buyer that is 41 * accessing their own creatives. 2. The ID of the child seat buyer under a 42 * bidder account. So for listing creatives pertaining to the child seat buyer 43 * (`456`) under bidder account (`123`), you would use the pattern: 44 * `buyers/456`. 3. The ID of the bidder itself. So for listing creatives 45 * pertaining to bidder (`123`), you would use `buyers/123`. If you want to 46 * access all creatives pertaining to both the bidder and all of its child seat 47 * accounts, you would use `bidders/{bidderAccountId}`, e.g., for all creatives 48 * pertaining to bidder (`123`), use `bidders/123`. 49 * @param array $optParams Optional parameters. 50 * 51 * @opt_param string filter Query string to filter creatives. If no filter is 52 * specified, all active creatives will be returned. Example: 'accountId=12345 53 * AND (dealsStatus:DISAPPROVED AND disapprovalReason:UNACCEPTABLE_CONTENT) OR 54 * declaredAttributes:IS_COOKIE_TARGETED' 55 * @opt_param int pageSize Requested page size. The server may return fewer 56 * creatives than requested (due to timeout constraint) even if more are 57 * available via another call. If unspecified, server will pick an appropriate 58 * default. Acceptable values are 1 to 1000, inclusive. 59 * @opt_param string pageToken A token identifying a page of results the server 60 * should return. Typically, this is the value of 61 * ListCreativesResponse.nextPageToken returned from the previous call to the 62 * 'ListCreatives' method. Page tokens for continued pages are valid for up to 63 * five hours, counting from the call to 'ListCreatives' for the first page. 64 * @opt_param string view Controls the amount of information included in the 65 * response. By default only creativeServingDecision is included. To retrieve 66 * the entire creative resource (including the declared fields and the creative 67 * content) specify the view as "FULL". 68 * @return ListCreativesResponse 69 */ 70 public function listBiddersCreatives($parent, $optParams = []) 71 { 72 $params = ['parent' => $parent]; 73 $params = array_merge($params, $optParams); 74 return $this->call('list', [$params], ListCreativesResponse::class); 75 } 76 /** 77 * Watches all creatives pertaining to a bidder. It is sufficient to invoke this 78 * endpoint once per bidder. A Pub/Sub topic will be created and notifications 79 * will be pushed to the topic when any of the bidder's creatives change status. 80 * All of the bidder's service accounts will have access to read from the topic. 81 * Subsequent invocations of this method will return the existing Pub/Sub 82 * configuration. (creatives.watch) 83 * 84 * @param string $parent Required. To watch all creatives pertaining to the 85 * bidder and all its child seat accounts, the bidder must follow the pattern 86 * `bidders/{bidderAccountId}`. 87 * @param WatchCreativesRequest $postBody 88 * @param array $optParams Optional parameters. 89 * @return WatchCreativesResponse 90 */ 91 public function watch($parent, WatchCreativesRequest $postBody, $optParams = []) 92 { 93 $params = ['parent' => $parent, 'postBody' => $postBody]; 94 $params = array_merge($params, $optParams); 95 return $this->call('watch', [$params], WatchCreativesResponse::class); 96 } 97} 98 99// Adding a class alias for backwards compatibility with the previous class name. 100class_alias(BiddersCreatives::class, 'Google_Service_RealTimeBidding_Resource_BiddersCreatives'); 101