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 18/** 19 * The "creatives" collection of methods. 20 * Typical usage is: 21 * <code> 22 * $adexchangebuyer2Service = new Google_Service_AdExchangeBuyerII(...); 23 * $creatives = $adexchangebuyer2Service->creatives; 24 * </code> 25 */ 26class Google_Service_AdExchangeBuyerII_Resource_AccountsCreatives extends Google_Service_Resource 27{ 28 /** 29 * Creates a creative. (creatives.create) 30 * 31 * @param string $accountId The account that this creative belongs to. Can be 32 * used to filter the response of the creatives.list method. 33 * @param Google_Service_AdExchangeBuyerII_Creative $postBody 34 * @param array $optParams Optional parameters. 35 * 36 * @opt_param string duplicateIdMode Indicates if multiple creatives can share 37 * an ID or not. Default is NO_DUPLICATES (one ID per creative). 38 * @return Google_Service_AdExchangeBuyerII_Creative 39 */ 40 public function create($accountId, Google_Service_AdExchangeBuyerII_Creative $postBody, $optParams = array()) 41 { 42 $params = array('accountId' => $accountId, 'postBody' => $postBody); 43 $params = array_merge($params, $optParams); 44 return $this->call('create', array($params), "Google_Service_AdExchangeBuyerII_Creative"); 45 } 46 /** 47 * Gets a creative. (creatives.get) 48 * 49 * @param string $accountId The account the creative belongs to. 50 * @param string $creativeId The ID of the creative to retrieve. 51 * @param array $optParams Optional parameters. 52 * @return Google_Service_AdExchangeBuyerII_Creative 53 */ 54 public function get($accountId, $creativeId, $optParams = array()) 55 { 56 $params = array('accountId' => $accountId, 'creativeId' => $creativeId); 57 $params = array_merge($params, $optParams); 58 return $this->call('get', array($params), "Google_Service_AdExchangeBuyerII_Creative"); 59 } 60 /** 61 * Lists creatives. (creatives.listAccountsCreatives) 62 * 63 * @param string $accountId The account to list the creatives from. Specify "-" 64 * to list all creatives the current user has access to. 65 * @param array $optParams Optional parameters. 66 * 67 * @opt_param int pageSize Requested page size. The server may return fewer 68 * creatives than requested (due to timeout constraint) even if more are 69 * available via another call. If unspecified, server will pick an appropriate 70 * default. Acceptable values are 1 to 1000, inclusive. 71 * @opt_param string pageToken A token identifying a page of results the server 72 * should return. Typically, this is the value of 73 * ListCreativesResponse.next_page_token returned from the previous call to 74 * 'ListCreatives' method. 75 * @opt_param string query An optional query string to filter creatives. If no 76 * filter is specified, all active creatives will be returned. Supported queries 77 * are: - accountId=*account_id_string* - creativeId=*creative_id_string* - 78 * dealsStatus: {approved, conditionally_approved, disapproved, not_checked} - 79 * openAuctionStatus: {approved, conditionally_approved, disapproved, 80 * not_checked} - attribute: {a numeric attribute from the list of attributes} - 81 * disapprovalReason: {a reason from DisapprovalReason} Example: 82 * 'accountId=12345 AND (dealsStatus:disapproved AND 83 * disapprovalReason:unacceptable_content) OR attribute:47' 84 * @return Google_Service_AdExchangeBuyerII_ListCreativesResponse 85 */ 86 public function listAccountsCreatives($accountId, $optParams = array()) 87 { 88 $params = array('accountId' => $accountId); 89 $params = array_merge($params, $optParams); 90 return $this->call('list', array($params), "Google_Service_AdExchangeBuyerII_ListCreativesResponse"); 91 } 92 /** 93 * Stops watching a creative. Will stop push notifications being sent to the 94 * topics when the creative changes status. (creatives.stopWatching) 95 * 96 * @param string $accountId The account of the creative to stop notifications 97 * for. 98 * @param string $creativeId The creative ID of the creative to stop 99 * notifications for. Specify "-" to specify stopping account level 100 * notifications. 101 * @param Google_Service_AdExchangeBuyerII_StopWatchingCreativeRequest $postBody 102 * @param array $optParams Optional parameters. 103 * @return Google_Service_AdExchangeBuyerII_Adexchangebuyer2Empty 104 */ 105 public function stopWatching($accountId, $creativeId, Google_Service_AdExchangeBuyerII_StopWatchingCreativeRequest $postBody, $optParams = array()) 106 { 107 $params = array('accountId' => $accountId, 'creativeId' => $creativeId, 'postBody' => $postBody); 108 $params = array_merge($params, $optParams); 109 return $this->call('stopWatching', array($params), "Google_Service_AdExchangeBuyerII_Adexchangebuyer2Empty"); 110 } 111 /** 112 * Updates a creative. (creatives.update) 113 * 114 * @param string $accountId The account that this creative belongs to. Can be 115 * used to filter the response of the creatives.list method. 116 * @param string $creativeId The buyer-defined creative ID of this creative. Can 117 * be used to filter the response of the creatives.list method. 118 * @param Google_Service_AdExchangeBuyerII_Creative $postBody 119 * @param array $optParams Optional parameters. 120 * @return Google_Service_AdExchangeBuyerII_Creative 121 */ 122 public function update($accountId, $creativeId, Google_Service_AdExchangeBuyerII_Creative $postBody, $optParams = array()) 123 { 124 $params = array('accountId' => $accountId, 'creativeId' => $creativeId, 'postBody' => $postBody); 125 $params = array_merge($params, $optParams); 126 return $this->call('update', array($params), "Google_Service_AdExchangeBuyerII_Creative"); 127 } 128 /** 129 * Watches a creative. Will result in push notifications being sent to the topic 130 * when the creative changes status. (creatives.watch) 131 * 132 * @param string $accountId The account of the creative to watch. 133 * @param string $creativeId The creative ID to watch for status changes. 134 * Specify "-" to watch all creatives under the above account. If both creative- 135 * level and account-level notifications are sent, only a single notification 136 * will be sent to the creative-level notification topic. 137 * @param Google_Service_AdExchangeBuyerII_WatchCreativeRequest $postBody 138 * @param array $optParams Optional parameters. 139 * @return Google_Service_AdExchangeBuyerII_Adexchangebuyer2Empty 140 */ 141 public function watch($accountId, $creativeId, Google_Service_AdExchangeBuyerII_WatchCreativeRequest $postBody, $optParams = array()) 142 { 143 $params = array('accountId' => $accountId, 'creativeId' => $creativeId, 'postBody' => $postBody); 144 $params = array_merge($params, $optParams); 145 return $this->call('watch', array($params), "Google_Service_AdExchangeBuyerII_Adexchangebuyer2Empty"); 146 } 147} 148