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