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\RealTimeBidding\Resource;
19
20use Google\Service\RealTimeBidding\ActivatePretargetingConfigRequest;
21use Google\Service\RealTimeBidding\AddTargetedAppsRequest;
22use Google\Service\RealTimeBidding\AddTargetedPublishersRequest;
23use Google\Service\RealTimeBidding\AddTargetedSitesRequest;
24use Google\Service\RealTimeBidding\ListPretargetingConfigsResponse;
25use Google\Service\RealTimeBidding\PretargetingConfig;
26use Google\Service\RealTimeBidding\RealtimebiddingEmpty;
27use Google\Service\RealTimeBidding\RemoveTargetedAppsRequest;
28use Google\Service\RealTimeBidding\RemoveTargetedPublishersRequest;
29use Google\Service\RealTimeBidding\RemoveTargetedSitesRequest;
30use Google\Service\RealTimeBidding\SuspendPretargetingConfigRequest;
31
32/**
33 * The "pretargetingConfigs" collection of methods.
34 * Typical usage is:
35 *  <code>
36 *   $realtimebiddingService = new Google\Service\RealTimeBidding(...);
37 *   $pretargetingConfigs = $realtimebiddingService->pretargetingConfigs;
38 *  </code>
39 */
40class BiddersPretargetingConfigs extends \Google\Service\Resource
41{
42  /**
43   * Activates a pretargeting configuration. (pretargetingConfigs.activate)
44   *
45   * @param string $name Required. The name of the pretargeting configuration.
46   * Format: bidders/{bidderAccountId}/pretargetingConfig/{configId}
47   * @param ActivatePretargetingConfigRequest $postBody
48   * @param array $optParams Optional parameters.
49   * @return PretargetingConfig
50   */
51  public function activate($name, ActivatePretargetingConfigRequest $postBody, $optParams = [])
52  {
53    $params = ['name' => $name, 'postBody' => $postBody];
54    $params = array_merge($params, $optParams);
55    return $this->call('activate', [$params], PretargetingConfig::class);
56  }
57  /**
58   * Adds targeted apps to the pretargeting configuration.
59   * (pretargetingConfigs.addTargetedApps)
60   *
61   * @param string $pretargetingConfig Required. The name of the pretargeting
62   * configuration. Format:
63   * bidders/{bidderAccountId}/pretargetingConfig/{configId}
64   * @param AddTargetedAppsRequest $postBody
65   * @param array $optParams Optional parameters.
66   * @return PretargetingConfig
67   */
68  public function addTargetedApps($pretargetingConfig, AddTargetedAppsRequest $postBody, $optParams = [])
69  {
70    $params = ['pretargetingConfig' => $pretargetingConfig, 'postBody' => $postBody];
71    $params = array_merge($params, $optParams);
72    return $this->call('addTargetedApps', [$params], PretargetingConfig::class);
73  }
74  /**
75   * Adds targeted publishers to the pretargeting config.
76   * (pretargetingConfigs.addTargetedPublishers)
77   *
78   * @param string $pretargetingConfig Required. The name of the pretargeting
79   * configuration. Format:
80   * bidders/{bidderAccountId}/pretargetingConfig/{configId}
81   * @param AddTargetedPublishersRequest $postBody
82   * @param array $optParams Optional parameters.
83   * @return PretargetingConfig
84   */
85  public function addTargetedPublishers($pretargetingConfig, AddTargetedPublishersRequest $postBody, $optParams = [])
86  {
87    $params = ['pretargetingConfig' => $pretargetingConfig, 'postBody' => $postBody];
88    $params = array_merge($params, $optParams);
89    return $this->call('addTargetedPublishers', [$params], PretargetingConfig::class);
90  }
91  /**
92   * Adds targeted sites to the pretargeting configuration.
93   * (pretargetingConfigs.addTargetedSites)
94   *
95   * @param string $pretargetingConfig Required. The name of the pretargeting
96   * configuration. Format:
97   * bidders/{bidderAccountId}/pretargetingConfig/{configId}
98   * @param AddTargetedSitesRequest $postBody
99   * @param array $optParams Optional parameters.
100   * @return PretargetingConfig
101   */
102  public function addTargetedSites($pretargetingConfig, AddTargetedSitesRequest $postBody, $optParams = [])
103  {
104    $params = ['pretargetingConfig' => $pretargetingConfig, 'postBody' => $postBody];
105    $params = array_merge($params, $optParams);
106    return $this->call('addTargetedSites', [$params], PretargetingConfig::class);
107  }
108  /**
109   * Creates a pretargeting configuration. A pretargeting configuration's state
110   * (PretargetingConfig.state) is active upon creation, and it will start to
111   * affect traffic shortly after. A bidder may create a maximum of 10
112   * pretargeting configurations. Attempts to exceed this maximum results in a 400
113   * bad request error. (pretargetingConfigs.create)
114   *
115   * @param string $parent Required. Name of the bidder to create the pretargeting
116   * configuration for. Format: bidders/{bidderAccountId}
117   * @param PretargetingConfig $postBody
118   * @param array $optParams Optional parameters.
119   * @return PretargetingConfig
120   */
121  public function create($parent, PretargetingConfig $postBody, $optParams = [])
122  {
123    $params = ['parent' => $parent, 'postBody' => $postBody];
124    $params = array_merge($params, $optParams);
125    return $this->call('create', [$params], PretargetingConfig::class);
126  }
127  /**
128   * Deletes a pretargeting configuration. (pretargetingConfigs.delete)
129   *
130   * @param string $name Required. The name of the pretargeting configuration to
131   * delete. Format: bidders/{bidderAccountId}/pretargetingConfig/{configId}
132   * @param array $optParams Optional parameters.
133   * @return RealtimebiddingEmpty
134   */
135  public function delete($name, $optParams = [])
136  {
137    $params = ['name' => $name];
138    $params = array_merge($params, $optParams);
139    return $this->call('delete', [$params], RealtimebiddingEmpty::class);
140  }
141  /**
142   * Gets a pretargeting configuration. (pretargetingConfigs.get)
143   *
144   * @param string $name Required. Name of the pretargeting configuration to get.
145   * Format: bidders/{bidderAccountId}/pretargetingConfig/{configId}
146   * @param array $optParams Optional parameters.
147   * @return PretargetingConfig
148   */
149  public function get($name, $optParams = [])
150  {
151    $params = ['name' => $name];
152    $params = array_merge($params, $optParams);
153    return $this->call('get', [$params], PretargetingConfig::class);
154  }
155  /**
156   * Lists all pretargeting configurations for a single bidder.
157   * (pretargetingConfigs.listBiddersPretargetingConfigs)
158   *
159   * @param string $parent Required. Name of the bidder whose pretargeting
160   * configurations will be listed. Format: bidders/{bidderAccountId}
161   * @param array $optParams Optional parameters.
162   *
163   * @opt_param int pageSize The maximum number of pretargeting configurations to
164   * return. If unspecified, at most 10 pretargeting configurations will be
165   * returned. The maximum value is 100; values above 100 will be coerced to 100.
166   * @opt_param string pageToken A token identifying a page of results the server
167   * should return. This value is received from a previous
168   * `ListPretargetingConfigs` call in
169   * ListPretargetingConfigsResponse.nextPageToken.
170   * @return ListPretargetingConfigsResponse
171   */
172  public function listBiddersPretargetingConfigs($parent, $optParams = [])
173  {
174    $params = ['parent' => $parent];
175    $params = array_merge($params, $optParams);
176    return $this->call('list', [$params], ListPretargetingConfigsResponse::class);
177  }
178  /**
179   * Updates a pretargeting configuration. (pretargetingConfigs.patch)
180   *
181   * @param string $name Output only. Name of the pretargeting configuration that
182   * must follow the pattern
183   * `bidders/{bidder_account_id}/pretargetingConfigs/{config_id}`
184   * @param PretargetingConfig $postBody
185   * @param array $optParams Optional parameters.
186   *
187   * @opt_param string updateMask Field mask to use for partial in-place updates.
188   * @return PretargetingConfig
189   */
190  public function patch($name, PretargetingConfig $postBody, $optParams = [])
191  {
192    $params = ['name' => $name, 'postBody' => $postBody];
193    $params = array_merge($params, $optParams);
194    return $this->call('patch', [$params], PretargetingConfig::class);
195  }
196  /**
197   * Removes targeted apps from the pretargeting configuration.
198   * (pretargetingConfigs.removeTargetedApps)
199   *
200   * @param string $pretargetingConfig Required. The name of the pretargeting
201   * configuration. Format:
202   * bidders/{bidderAccountId}/pretargetingConfig/{configId}
203   * @param RemoveTargetedAppsRequest $postBody
204   * @param array $optParams Optional parameters.
205   * @return PretargetingConfig
206   */
207  public function removeTargetedApps($pretargetingConfig, RemoveTargetedAppsRequest $postBody, $optParams = [])
208  {
209    $params = ['pretargetingConfig' => $pretargetingConfig, 'postBody' => $postBody];
210    $params = array_merge($params, $optParams);
211    return $this->call('removeTargetedApps', [$params], PretargetingConfig::class);
212  }
213  /**
214   * Removes targeted publishers from the pretargeting config.
215   * (pretargetingConfigs.removeTargetedPublishers)
216   *
217   * @param string $pretargetingConfig Required. The name of the pretargeting
218   * configuration. Format:
219   * bidders/{bidderAccountId}/pretargetingConfig/{configId}
220   * @param RemoveTargetedPublishersRequest $postBody
221   * @param array $optParams Optional parameters.
222   * @return PretargetingConfig
223   */
224  public function removeTargetedPublishers($pretargetingConfig, RemoveTargetedPublishersRequest $postBody, $optParams = [])
225  {
226    $params = ['pretargetingConfig' => $pretargetingConfig, 'postBody' => $postBody];
227    $params = array_merge($params, $optParams);
228    return $this->call('removeTargetedPublishers', [$params], PretargetingConfig::class);
229  }
230  /**
231   * Removes targeted sites from the pretargeting configuration.
232   * (pretargetingConfigs.removeTargetedSites)
233   *
234   * @param string $pretargetingConfig Required. The name of the pretargeting
235   * configuration. Format:
236   * bidders/{bidderAccountId}/pretargetingConfig/{configId}
237   * @param RemoveTargetedSitesRequest $postBody
238   * @param array $optParams Optional parameters.
239   * @return PretargetingConfig
240   */
241  public function removeTargetedSites($pretargetingConfig, RemoveTargetedSitesRequest $postBody, $optParams = [])
242  {
243    $params = ['pretargetingConfig' => $pretargetingConfig, 'postBody' => $postBody];
244    $params = array_merge($params, $optParams);
245    return $this->call('removeTargetedSites', [$params], PretargetingConfig::class);
246  }
247  /**
248   * Suspends a pretargeting configuration. (pretargetingConfigs.suspend)
249   *
250   * @param string $name Required. The name of the pretargeting configuration.
251   * Format: bidders/{bidderAccountId}/pretargetingConfig/{configId}
252   * @param SuspendPretargetingConfigRequest $postBody
253   * @param array $optParams Optional parameters.
254   * @return PretargetingConfig
255   */
256  public function suspend($name, SuspendPretargetingConfigRequest $postBody, $optParams = [])
257  {
258    $params = ['name' => $name, 'postBody' => $postBody];
259    $params = array_merge($params, $optParams);
260    return $this->call('suspend', [$params], PretargetingConfig::class);
261  }
262}
263
264// Adding a class alias for backwards compatibility with the previous class name.
265class_alias(BiddersPretargetingConfigs::class, 'Google_Service_RealTimeBidding_Resource_BiddersPretargetingConfigs');
266