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\PlacementGroup; 21use Google\Service\Dfareporting\PlacementGroupsListResponse; 22 23/** 24 * The "placementGroups" collection of methods. 25 * Typical usage is: 26 * <code> 27 * $dfareportingService = new Google\Service\Dfareporting(...); 28 * $placementGroups = $dfareportingService->placementGroups; 29 * </code> 30 */ 31class PlacementGroups extends \Google\Service\Resource 32{ 33 /** 34 * Gets one placement group by ID. (placementGroups.get) 35 * 36 * @param string $profileId User profile ID associated with this request. 37 * @param string $id Placement group ID. 38 * @param array $optParams Optional parameters. 39 * @return PlacementGroup 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], PlacementGroup::class); 46 } 47 /** 48 * Inserts a new placement group. (placementGroups.insert) 49 * 50 * @param string $profileId User profile ID associated with this request. 51 * @param PlacementGroup $postBody 52 * @param array $optParams Optional parameters. 53 * @return PlacementGroup 54 */ 55 public function insert($profileId, PlacementGroup $postBody, $optParams = []) 56 { 57 $params = ['profileId' => $profileId, 'postBody' => $postBody]; 58 $params = array_merge($params, $optParams); 59 return $this->call('insert', [$params], PlacementGroup::class); 60 } 61 /** 62 * Retrieves a list of placement groups, possibly filtered. This method supports 63 * paging. (placementGroups.listPlacementGroups) 64 * 65 * @param string $profileId User profile ID associated with this request. 66 * @param array $optParams Optional parameters. 67 * 68 * @opt_param string advertiserIds Select only placement groups that belong to 69 * these advertisers. 70 * @opt_param bool archived Select only archived placements. Don't set this 71 * field to select both archived and non-archived placements. 72 * @opt_param string campaignIds Select only placement groups that belong to 73 * these campaigns. 74 * @opt_param string contentCategoryIds Select only placement groups that are 75 * associated with these content categories. 76 * @opt_param string directorySiteIds Select only placement groups that are 77 * associated with these directory sites. 78 * @opt_param string ids Select only placement groups with these IDs. 79 * @opt_param string maxEndDate Select only placements or placement groups whose 80 * end date is on or before the specified maxEndDate. The date should be 81 * formatted as "yyyy-MM-dd". 82 * @opt_param int maxResults Maximum number of results to return. 83 * @opt_param string maxStartDate Select only placements or placement groups 84 * whose start date is on or before the specified maxStartDate. The date should 85 * be formatted as "yyyy-MM-dd". 86 * @opt_param string minEndDate Select only placements or placement groups whose 87 * end date is on or after the specified minEndDate. The date should be 88 * formatted as "yyyy-MM-dd". 89 * @opt_param string minStartDate Select only placements or placement groups 90 * whose start date is on or after the specified minStartDate. The date should 91 * be formatted as "yyyy-MM-dd". 92 * @opt_param string pageToken Value of the nextPageToken from the previous 93 * result page. 94 * @opt_param string placementGroupType Select only placement groups belonging 95 * with this group type. A package is a simple group of placements that acts as 96 * a single pricing point for a group of tags. A roadblock is a group of 97 * placements that not only acts as a single pricing point but also assumes that 98 * all the tags in it will be served at the same time. A roadblock requires one 99 * of its assigned placements to be marked as primary for reporting. 100 * @opt_param string placementStrategyIds Select only placement groups that are 101 * associated with these placement strategies. 102 * @opt_param string pricingTypes Select only placement groups with these 103 * pricing types. 104 * @opt_param string searchString Allows searching for placement groups by name 105 * or ID. Wildcards (*) are allowed. For example, "placement*2015" will return 106 * placement groups with names like "placement group June 2015", "placement 107 * group May 2015", or simply "placements 2015". Most of the searches also add 108 * wildcards implicitly at the start and the end of the search string. For 109 * example, a search string of "placementgroup" will match placement groups with 110 * name "my placementgroup", "placementgroup 2015", or simply "placementgroup". 111 * @opt_param string siteIds Select only placement groups that are associated 112 * with these sites. 113 * @opt_param string sortField Field by which to sort the list. 114 * @opt_param string sortOrder Order of sorted results. 115 * @return PlacementGroupsListResponse 116 */ 117 public function listPlacementGroups($profileId, $optParams = []) 118 { 119 $params = ['profileId' => $profileId]; 120 $params = array_merge($params, $optParams); 121 return $this->call('list', [$params], PlacementGroupsListResponse::class); 122 } 123 /** 124 * Updates an existing placement group. This method supports patch semantics. 125 * (placementGroups.patch) 126 * 127 * @param string $profileId User profile ID associated with this request. 128 * @param string $id PlacementGroup ID. 129 * @param PlacementGroup $postBody 130 * @param array $optParams Optional parameters. 131 * @return PlacementGroup 132 */ 133 public function patch($profileId, $id, PlacementGroup $postBody, $optParams = []) 134 { 135 $params = ['profileId' => $profileId, 'id' => $id, 'postBody' => $postBody]; 136 $params = array_merge($params, $optParams); 137 return $this->call('patch', [$params], PlacementGroup::class); 138 } 139 /** 140 * Updates an existing placement group. (placementGroups.update) 141 * 142 * @param string $profileId User profile ID associated with this request. 143 * @param PlacementGroup $postBody 144 * @param array $optParams Optional parameters. 145 * @return PlacementGroup 146 */ 147 public function update($profileId, PlacementGroup $postBody, $optParams = []) 148 { 149 $params = ['profileId' => $profileId, 'postBody' => $postBody]; 150 $params = array_merge($params, $optParams); 151 return $this->call('update', [$params], PlacementGroup::class); 152 } 153} 154 155// Adding a class alias for backwards compatibility with the previous class name. 156class_alias(PlacementGroups::class, 'Google_Service_Dfareporting_Resource_PlacementGroups'); 157