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\Placement;
21use Google\Service\Dfareporting\PlacementsGenerateTagsResponse;
22use Google\Service\Dfareporting\PlacementsListResponse;
23
24/**
25 * The "placements" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $dfareportingService = new Google\Service\Dfareporting(...);
29 *   $placements = $dfareportingService->placements;
30 *  </code>
31 */
32class Placements extends \Google\Service\Resource
33{
34  /**
35   * Generates tags for a placement. (placements.generatetags)
36   *
37   * @param string $profileId User profile ID associated with this request.
38   * @param array $optParams Optional parameters.
39   *
40   * @opt_param string campaignId Generate placements belonging to this campaign.
41   * This is a required field.
42   * @opt_param string placementIds Generate tags for these placements.
43   * @opt_param string tagFormats Tag formats to generate for these placements.
44   * *Note:* PLACEMENT_TAG_STANDARD can only be generated for 1x1 placements.
45   * @return PlacementsGenerateTagsResponse
46   */
47  public function generatetags($profileId, $optParams = [])
48  {
49    $params = ['profileId' => $profileId];
50    $params = array_merge($params, $optParams);
51    return $this->call('generatetags', [$params], PlacementsGenerateTagsResponse::class);
52  }
53  /**
54   * Gets one placement by ID. (placements.get)
55   *
56   * @param string $profileId User profile ID associated with this request.
57   * @param string $id Placement ID.
58   * @param array $optParams Optional parameters.
59   * @return Placement
60   */
61  public function get($profileId, $id, $optParams = [])
62  {
63    $params = ['profileId' => $profileId, 'id' => $id];
64    $params = array_merge($params, $optParams);
65    return $this->call('get', [$params], Placement::class);
66  }
67  /**
68   * Inserts a new placement. (placements.insert)
69   *
70   * @param string $profileId User profile ID associated with this request.
71   * @param Placement $postBody
72   * @param array $optParams Optional parameters.
73   * @return Placement
74   */
75  public function insert($profileId, Placement $postBody, $optParams = [])
76  {
77    $params = ['profileId' => $profileId, 'postBody' => $postBody];
78    $params = array_merge($params, $optParams);
79    return $this->call('insert', [$params], Placement::class);
80  }
81  /**
82   * Retrieves a list of placements, possibly filtered. This method supports
83   * paging. (placements.listPlacements)
84   *
85   * @param string $profileId User profile ID associated with this request.
86   * @param array $optParams Optional parameters.
87   *
88   * @opt_param string advertiserIds Select only placements that belong to these
89   * advertisers.
90   * @opt_param bool archived Select only archived placements. Don't set this
91   * field to select both archived and non-archived placements.
92   * @opt_param string campaignIds Select only placements that belong to these
93   * campaigns.
94   * @opt_param string compatibilities Select only placements that are associated
95   * with these compatibilities. DISPLAY and DISPLAY_INTERSTITIAL refer to
96   * rendering either on desktop or on mobile devices for regular or interstitial
97   * ads respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps.
98   * IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with the
99   * VAST standard.
100   * @opt_param string contentCategoryIds Select only placements that are
101   * associated with these content categories.
102   * @opt_param string directorySiteIds Select only placements that are associated
103   * with these directory sites.
104   * @opt_param string groupIds Select only placements that belong to these
105   * placement groups.
106   * @opt_param string ids Select only placements with these IDs.
107   * @opt_param string maxEndDate Select only placements or placement groups whose
108   * end date is on or before the specified maxEndDate. The date should be
109   * formatted as "yyyy-MM-dd".
110   * @opt_param int maxResults Maximum number of results to return.
111   * @opt_param string maxStartDate Select only placements or placement groups
112   * whose start date is on or before the specified maxStartDate. The date should
113   * be formatted as "yyyy-MM-dd".
114   * @opt_param string minEndDate Select only placements or placement groups whose
115   * end date is on or after the specified minEndDate. The date should be
116   * formatted as "yyyy-MM-dd".
117   * @opt_param string minStartDate Select only placements or placement groups
118   * whose start date is on or after the specified minStartDate. The date should
119   * be formatted as "yyyy-MM-dd".
120   * @opt_param string pageToken Value of the nextPageToken from the previous
121   * result page.
122   * @opt_param string paymentSource Select only placements with this payment
123   * source.
124   * @opt_param string placementStrategyIds Select only placements that are
125   * associated with these placement strategies.
126   * @opt_param string pricingTypes Select only placements with these pricing
127   * types.
128   * @opt_param string searchString Allows searching for placements by name or ID.
129   * Wildcards (*) are allowed. For example, "placement*2015" will return
130   * placements with names like "placement June 2015", "placement May 2015", or
131   * simply "placements 2015". Most of the searches also add wildcards implicitly
132   * at the start and the end of the search string. For example, a search string
133   * of "placement" will match placements with name "my placement", "placement
134   * 2015", or simply "placement" .
135   * @opt_param string siteIds Select only placements that are associated with
136   * these sites.
137   * @opt_param string sizeIds Select only placements that are associated with
138   * these sizes.
139   * @opt_param string sortField Field by which to sort the list.
140   * @opt_param string sortOrder Order of sorted results.
141   * @return PlacementsListResponse
142   */
143  public function listPlacements($profileId, $optParams = [])
144  {
145    $params = ['profileId' => $profileId];
146    $params = array_merge($params, $optParams);
147    return $this->call('list', [$params], PlacementsListResponse::class);
148  }
149  /**
150   * Updates an existing placement. This method supports patch semantics.
151   * (placements.patch)
152   *
153   * @param string $profileId User profile ID associated with this request.
154   * @param string $id Placement ID.
155   * @param Placement $postBody
156   * @param array $optParams Optional parameters.
157   * @return Placement
158   */
159  public function patch($profileId, $id, Placement $postBody, $optParams = [])
160  {
161    $params = ['profileId' => $profileId, 'id' => $id, 'postBody' => $postBody];
162    $params = array_merge($params, $optParams);
163    return $this->call('patch', [$params], Placement::class);
164  }
165  /**
166   * Updates an existing placement. (placements.update)
167   *
168   * @param string $profileId User profile ID associated with this request.
169   * @param Placement $postBody
170   * @param array $optParams Optional parameters.
171   * @return Placement
172   */
173  public function update($profileId, Placement $postBody, $optParams = [])
174  {
175    $params = ['profileId' => $profileId, 'postBody' => $postBody];
176    $params = array_merge($params, $optParams);
177    return $this->call('update', [$params], Placement::class);
178  }
179}
180
181// Adding a class alias for backwards compatibility with the previous class name.
182class_alias(Placements::class, 'Google_Service_Dfareporting_Resource_Placements');
183