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;
19
20use Google\Client;
21
22/**
23 * Service definition for RealTimeBidding (v1).
24 *
25 * <p>
26 * Allows external bidders to manage their RTB integration with Google. This
27 * includes managing bidder endpoints, QPS quotas, configuring what ad inventory
28 * to receive via pretargeting, submitting creatives for verification, and
29 * accessing creative metadata such as approval status.</p>
30 *
31 * <p>
32 * For more information about this service, see the API
33 * <a href="https://developers.google.com/authorized-buyers/apis/realtimebidding/reference/rest/" target="_blank">Documentation</a>
34 * </p>
35 *
36 * @author Google, Inc.
37 */
38class RealTimeBidding extends \Google\Service
39{
40  /** See, create, edit, and delete your Authorized Buyers and Open Bidding account entities. */
41  const REALTIME_BIDDING =
42      "https://www.googleapis.com/auth/realtime-bidding";
43
44  public $bidders;
45  public $bidders_creatives;
46  public $bidders_endpoints;
47  public $bidders_pretargetingConfigs;
48  public $buyers;
49  public $buyers_creatives;
50  public $buyers_userLists;
51
52  /**
53   * Constructs the internal representation of the RealTimeBidding service.
54   *
55   * @param Client|array $clientOrConfig The client used to deliver requests, or a
56   *                                     config array to pass to a new Client instance.
57   * @param string $rootUrl The root URL used for requests to the service.
58   */
59  public function __construct($clientOrConfig = [], $rootUrl = null)
60  {
61    parent::__construct($clientOrConfig);
62    $this->rootUrl = $rootUrl ?: 'https://realtimebidding.googleapis.com/';
63    $this->servicePath = '';
64    $this->batchPath = 'batch';
65    $this->version = 'v1';
66    $this->serviceName = 'realtimebidding';
67
68    $this->bidders = new RealTimeBidding\Resource\Bidders(
69        $this,
70        $this->serviceName,
71        'bidders',
72        [
73          'methods' => [
74            'get' => [
75              'path' => 'v1/{+name}',
76              'httpMethod' => 'GET',
77              'parameters' => [
78                'name' => [
79                  'location' => 'path',
80                  'type' => 'string',
81                  'required' => true,
82                ],
83              ],
84            ],'list' => [
85              'path' => 'v1/bidders',
86              'httpMethod' => 'GET',
87              'parameters' => [
88                'pageSize' => [
89                  'location' => 'query',
90                  'type' => 'integer',
91                ],
92                'pageToken' => [
93                  'location' => 'query',
94                  'type' => 'string',
95                ],
96              ],
97            ],
98          ]
99        ]
100    );
101    $this->bidders_creatives = new RealTimeBidding\Resource\BiddersCreatives(
102        $this,
103        $this->serviceName,
104        'creatives',
105        [
106          'methods' => [
107            'list' => [
108              'path' => 'v1/{+parent}/creatives',
109              'httpMethod' => 'GET',
110              'parameters' => [
111                'parent' => [
112                  'location' => 'path',
113                  'type' => 'string',
114                  'required' => true,
115                ],
116                'filter' => [
117                  'location' => 'query',
118                  'type' => 'string',
119                ],
120                'pageSize' => [
121                  'location' => 'query',
122                  'type' => 'integer',
123                ],
124                'pageToken' => [
125                  'location' => 'query',
126                  'type' => 'string',
127                ],
128                'view' => [
129                  'location' => 'query',
130                  'type' => 'string',
131                ],
132              ],
133            ],'watch' => [
134              'path' => 'v1/{+parent}/creatives:watch',
135              'httpMethod' => 'POST',
136              'parameters' => [
137                'parent' => [
138                  'location' => 'path',
139                  'type' => 'string',
140                  'required' => true,
141                ],
142              ],
143            ],
144          ]
145        ]
146    );
147    $this->bidders_endpoints = new RealTimeBidding\Resource\BiddersEndpoints(
148        $this,
149        $this->serviceName,
150        'endpoints',
151        [
152          'methods' => [
153            'get' => [
154              'path' => 'v1/{+name}',
155              'httpMethod' => 'GET',
156              'parameters' => [
157                'name' => [
158                  'location' => 'path',
159                  'type' => 'string',
160                  'required' => true,
161                ],
162              ],
163            ],'list' => [
164              'path' => 'v1/{+parent}/endpoints',
165              'httpMethod' => 'GET',
166              'parameters' => [
167                'parent' => [
168                  'location' => 'path',
169                  'type' => 'string',
170                  'required' => true,
171                ],
172                'pageSize' => [
173                  'location' => 'query',
174                  'type' => 'integer',
175                ],
176                'pageToken' => [
177                  'location' => 'query',
178                  'type' => 'string',
179                ],
180              ],
181            ],'patch' => [
182              'path' => 'v1/{+name}',
183              'httpMethod' => 'PATCH',
184              'parameters' => [
185                'name' => [
186                  'location' => 'path',
187                  'type' => 'string',
188                  'required' => true,
189                ],
190                'updateMask' => [
191                  'location' => 'query',
192                  'type' => 'string',
193                ],
194              ],
195            ],
196          ]
197        ]
198    );
199    $this->bidders_pretargetingConfigs = new RealTimeBidding\Resource\BiddersPretargetingConfigs(
200        $this,
201        $this->serviceName,
202        'pretargetingConfigs',
203        [
204          'methods' => [
205            'activate' => [
206              'path' => 'v1/{+name}:activate',
207              'httpMethod' => 'POST',
208              'parameters' => [
209                'name' => [
210                  'location' => 'path',
211                  'type' => 'string',
212                  'required' => true,
213                ],
214              ],
215            ],'addTargetedApps' => [
216              'path' => 'v1/{+pretargetingConfig}:addTargetedApps',
217              'httpMethod' => 'POST',
218              'parameters' => [
219                'pretargetingConfig' => [
220                  'location' => 'path',
221                  'type' => 'string',
222                  'required' => true,
223                ],
224              ],
225            ],'addTargetedPublishers' => [
226              'path' => 'v1/{+pretargetingConfig}:addTargetedPublishers',
227              'httpMethod' => 'POST',
228              'parameters' => [
229                'pretargetingConfig' => [
230                  'location' => 'path',
231                  'type' => 'string',
232                  'required' => true,
233                ],
234              ],
235            ],'addTargetedSites' => [
236              'path' => 'v1/{+pretargetingConfig}:addTargetedSites',
237              'httpMethod' => 'POST',
238              'parameters' => [
239                'pretargetingConfig' => [
240                  'location' => 'path',
241                  'type' => 'string',
242                  'required' => true,
243                ],
244              ],
245            ],'create' => [
246              'path' => 'v1/{+parent}/pretargetingConfigs',
247              'httpMethod' => 'POST',
248              'parameters' => [
249                'parent' => [
250                  'location' => 'path',
251                  'type' => 'string',
252                  'required' => true,
253                ],
254              ],
255            ],'delete' => [
256              'path' => 'v1/{+name}',
257              'httpMethod' => 'DELETE',
258              'parameters' => [
259                'name' => [
260                  'location' => 'path',
261                  'type' => 'string',
262                  'required' => true,
263                ],
264              ],
265            ],'get' => [
266              'path' => 'v1/{+name}',
267              'httpMethod' => 'GET',
268              'parameters' => [
269                'name' => [
270                  'location' => 'path',
271                  'type' => 'string',
272                  'required' => true,
273                ],
274              ],
275            ],'list' => [
276              'path' => 'v1/{+parent}/pretargetingConfigs',
277              'httpMethod' => 'GET',
278              'parameters' => [
279                'parent' => [
280                  'location' => 'path',
281                  'type' => 'string',
282                  'required' => true,
283                ],
284                'pageSize' => [
285                  'location' => 'query',
286                  'type' => 'integer',
287                ],
288                'pageToken' => [
289                  'location' => 'query',
290                  'type' => 'string',
291                ],
292              ],
293            ],'patch' => [
294              'path' => 'v1/{+name}',
295              'httpMethod' => 'PATCH',
296              'parameters' => [
297                'name' => [
298                  'location' => 'path',
299                  'type' => 'string',
300                  'required' => true,
301                ],
302                'updateMask' => [
303                  'location' => 'query',
304                  'type' => 'string',
305                ],
306              ],
307            ],'removeTargetedApps' => [
308              'path' => 'v1/{+pretargetingConfig}:removeTargetedApps',
309              'httpMethod' => 'POST',
310              'parameters' => [
311                'pretargetingConfig' => [
312                  'location' => 'path',
313                  'type' => 'string',
314                  'required' => true,
315                ],
316              ],
317            ],'removeTargetedPublishers' => [
318              'path' => 'v1/{+pretargetingConfig}:removeTargetedPublishers',
319              'httpMethod' => 'POST',
320              'parameters' => [
321                'pretargetingConfig' => [
322                  'location' => 'path',
323                  'type' => 'string',
324                  'required' => true,
325                ],
326              ],
327            ],'removeTargetedSites' => [
328              'path' => 'v1/{+pretargetingConfig}:removeTargetedSites',
329              'httpMethod' => 'POST',
330              'parameters' => [
331                'pretargetingConfig' => [
332                  'location' => 'path',
333                  'type' => 'string',
334                  'required' => true,
335                ],
336              ],
337            ],'suspend' => [
338              'path' => 'v1/{+name}:suspend',
339              'httpMethod' => 'POST',
340              'parameters' => [
341                'name' => [
342                  'location' => 'path',
343                  'type' => 'string',
344                  'required' => true,
345                ],
346              ],
347            ],
348          ]
349        ]
350    );
351    $this->buyers = new RealTimeBidding\Resource\Buyers(
352        $this,
353        $this->serviceName,
354        'buyers',
355        [
356          'methods' => [
357            'get' => [
358              'path' => 'v1/{+name}',
359              'httpMethod' => 'GET',
360              'parameters' => [
361                'name' => [
362                  'location' => 'path',
363                  'type' => 'string',
364                  'required' => true,
365                ],
366              ],
367            ],'getRemarketingTag' => [
368              'path' => 'v1/{+name}:getRemarketingTag',
369              'httpMethod' => 'GET',
370              'parameters' => [
371                'name' => [
372                  'location' => 'path',
373                  'type' => 'string',
374                  'required' => true,
375                ],
376              ],
377            ],'list' => [
378              'path' => 'v1/buyers',
379              'httpMethod' => 'GET',
380              'parameters' => [
381                'pageSize' => [
382                  'location' => 'query',
383                  'type' => 'integer',
384                ],
385                'pageToken' => [
386                  'location' => 'query',
387                  'type' => 'string',
388                ],
389              ],
390            ],
391          ]
392        ]
393    );
394    $this->buyers_creatives = new RealTimeBidding\Resource\BuyersCreatives(
395        $this,
396        $this->serviceName,
397        'creatives',
398        [
399          'methods' => [
400            'create' => [
401              'path' => 'v1/{+parent}/creatives',
402              'httpMethod' => 'POST',
403              'parameters' => [
404                'parent' => [
405                  'location' => 'path',
406                  'type' => 'string',
407                  'required' => true,
408                ],
409              ],
410            ],'get' => [
411              'path' => 'v1/{+name}',
412              'httpMethod' => 'GET',
413              'parameters' => [
414                'name' => [
415                  'location' => 'path',
416                  'type' => 'string',
417                  'required' => true,
418                ],
419                'view' => [
420                  'location' => 'query',
421                  'type' => 'string',
422                ],
423              ],
424            ],'list' => [
425              'path' => 'v1/{+parent}/creatives',
426              'httpMethod' => 'GET',
427              'parameters' => [
428                'parent' => [
429                  'location' => 'path',
430                  'type' => 'string',
431                  'required' => true,
432                ],
433                'filter' => [
434                  'location' => 'query',
435                  'type' => 'string',
436                ],
437                'pageSize' => [
438                  'location' => 'query',
439                  'type' => 'integer',
440                ],
441                'pageToken' => [
442                  'location' => 'query',
443                  'type' => 'string',
444                ],
445                'view' => [
446                  'location' => 'query',
447                  'type' => 'string',
448                ],
449              ],
450            ],'patch' => [
451              'path' => 'v1/{+name}',
452              'httpMethod' => 'PATCH',
453              'parameters' => [
454                'name' => [
455                  'location' => 'path',
456                  'type' => 'string',
457                  'required' => true,
458                ],
459                'updateMask' => [
460                  'location' => 'query',
461                  'type' => 'string',
462                ],
463              ],
464            ],
465          ]
466        ]
467    );
468    $this->buyers_userLists = new RealTimeBidding\Resource\BuyersUserLists(
469        $this,
470        $this->serviceName,
471        'userLists',
472        [
473          'methods' => [
474            'close' => [
475              'path' => 'v1/{+name}:close',
476              'httpMethod' => 'POST',
477              'parameters' => [
478                'name' => [
479                  'location' => 'path',
480                  'type' => 'string',
481                  'required' => true,
482                ],
483              ],
484            ],'create' => [
485              'path' => 'v1/{+parent}/userLists',
486              'httpMethod' => 'POST',
487              'parameters' => [
488                'parent' => [
489                  'location' => 'path',
490                  'type' => 'string',
491                  'required' => true,
492                ],
493              ],
494            ],'get' => [
495              'path' => 'v1/{+name}',
496              'httpMethod' => 'GET',
497              'parameters' => [
498                'name' => [
499                  'location' => 'path',
500                  'type' => 'string',
501                  'required' => true,
502                ],
503              ],
504            ],'getRemarketingTag' => [
505              'path' => 'v1/{+name}:getRemarketingTag',
506              'httpMethod' => 'GET',
507              'parameters' => [
508                'name' => [
509                  'location' => 'path',
510                  'type' => 'string',
511                  'required' => true,
512                ],
513              ],
514            ],'list' => [
515              'path' => 'v1/{+parent}/userLists',
516              'httpMethod' => 'GET',
517              'parameters' => [
518                'parent' => [
519                  'location' => 'path',
520                  'type' => 'string',
521                  'required' => true,
522                ],
523                'pageSize' => [
524                  'location' => 'query',
525                  'type' => 'integer',
526                ],
527                'pageToken' => [
528                  'location' => 'query',
529                  'type' => 'string',
530                ],
531              ],
532            ],'open' => [
533              'path' => 'v1/{+name}:open',
534              'httpMethod' => 'POST',
535              'parameters' => [
536                'name' => [
537                  'location' => 'path',
538                  'type' => 'string',
539                  'required' => true,
540                ],
541              ],
542            ],'update' => [
543              'path' => 'v1/{+name}',
544              'httpMethod' => 'PUT',
545              'parameters' => [
546                'name' => [
547                  'location' => 'path',
548                  'type' => 'string',
549                  'required' => true,
550                ],
551              ],
552            ],
553          ]
554        ]
555    );
556  }
557}
558
559// Adding a class alias for backwards compatibility with the previous class name.
560class_alias(RealTimeBidding::class, 'Google_Service_RealTimeBidding');
561