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\Dfareporting\Resource; 19 20use Google\Service\Dfareporting\Advertiser; 21use Google\Service\Dfareporting\AdvertisersListResponse; 22 23/** 24 * The "advertisers" collection of methods. 25 * Typical usage is: 26 * <code> 27 * $dfareportingService = new Google\Service\Dfareporting(...); 28 * $advertisers = $dfareportingService->advertisers; 29 * </code> 30 */ 31class Advertisers extends \Google\Service\Resource 32{ 33 /** 34 * Gets one advertiser by ID. (advertisers.get) 35 * 36 * @param string $profileId User profile ID associated with this request. 37 * @param string $id Advertiser ID. 38 * @param array $optParams Optional parameters. 39 * @return Advertiser 40 */ 41 public function get($profileId, $id, $optParams = []) 42 { 43 $params = ['profileId' => $profileId, 'id' => $id]; 44 $params = array_merge($params, $optParams); 45 return $this->call('get', [$params], Advertiser::class); 46 } 47 /** 48 * Inserts a new advertiser. (advertisers.insert) 49 * 50 * @param string $profileId User profile ID associated with this request. 51 * @param Advertiser $postBody 52 * @param array $optParams Optional parameters. 53 * @return Advertiser 54 */ 55 public function insert($profileId, Advertiser $postBody, $optParams = []) 56 { 57 $params = ['profileId' => $profileId, 'postBody' => $postBody]; 58 $params = array_merge($params, $optParams); 59 return $this->call('insert', [$params], Advertiser::class); 60 } 61 /** 62 * Retrieves a list of advertisers, possibly filtered. This method supports 63 * paging. (advertisers.listAdvertisers) 64 * 65 * @param string $profileId User profile ID associated with this request. 66 * @param array $optParams Optional parameters. 67 * 68 * @opt_param string advertiserGroupIds Select only advertisers with these 69 * advertiser group IDs. 70 * @opt_param string floodlightConfigurationIds Select only advertisers with 71 * these floodlight configuration IDs. 72 * @opt_param string ids Select only advertisers with these IDs. 73 * @opt_param bool includeAdvertisersWithoutGroupsOnly Select only advertisers 74 * which do not belong to any advertiser group. 75 * @opt_param int maxResults Maximum number of results to return. 76 * @opt_param bool onlyParent Select only advertisers which use another 77 * advertiser's floodlight configuration. 78 * @opt_param string pageToken Value of the nextPageToken from the previous 79 * result page. 80 * @opt_param string searchString Allows searching for objects by name or ID. 81 * Wildcards (*) are allowed. For example, "advertiser*2015" will return objects 82 * with names like "advertiser June 2015", "advertiser April 2015", or simply 83 * "advertiser 2015". Most of the searches also add wildcards implicitly at the 84 * start and the end of the search string. For example, a search string of 85 * "advertiser" will match objects with name "my advertiser", "advertiser 2015", 86 * or simply "advertiser" . 87 * @opt_param string sortField Field by which to sort the list. 88 * @opt_param string sortOrder Order of sorted results. 89 * @opt_param string status Select only advertisers with the specified status. 90 * @opt_param string subaccountId Select only advertisers with these subaccount 91 * IDs. 92 * @return AdvertisersListResponse 93 */ 94 public function listAdvertisers($profileId, $optParams = []) 95 { 96 $params = ['profileId' => $profileId]; 97 $params = array_merge($params, $optParams); 98 return $this->call('list', [$params], AdvertisersListResponse::class); 99 } 100 /** 101 * Updates an existing advertiser. This method supports patch semantics. 102 * (advertisers.patch) 103 * 104 * @param string $profileId User profile ID associated with this request. 105 * @param string $id Advertiser ID. 106 * @param Advertiser $postBody 107 * @param array $optParams Optional parameters. 108 * @return Advertiser 109 */ 110 public function patch($profileId, $id, Advertiser $postBody, $optParams = []) 111 { 112 $params = ['profileId' => $profileId, 'id' => $id, 'postBody' => $postBody]; 113 $params = array_merge($params, $optParams); 114 return $this->call('patch', [$params], Advertiser::class); 115 } 116 /** 117 * Updates an existing advertiser. (advertisers.update) 118 * 119 * @param string $profileId User profile ID associated with this request. 120 * @param Advertiser $postBody 121 * @param array $optParams Optional parameters. 122 * @return Advertiser 123 */ 124 public function update($profileId, Advertiser $postBody, $optParams = []) 125 { 126 $params = ['profileId' => $profileId, 'postBody' => $postBody]; 127 $params = array_merge($params, $optParams); 128 return $this->call('update', [$params], Advertiser::class); 129 } 130} 131 132// Adding a class alias for backwards compatibility with the previous class name. 133class_alias(Advertisers::class, 'Google_Service_Dfareporting_Resource_Advertisers'); 134