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\Buyer;
21use Google\Service\RealTimeBidding\GetRemarketingTagResponse;
22use Google\Service\RealTimeBidding\ListBuyersResponse;
23
24/**
25 * The "buyers" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $realtimebiddingService = new Google\Service\RealTimeBidding(...);
29 *   $buyers = $realtimebiddingService->buyers;
30 *  </code>
31 */
32class Buyers extends \Google\Service\Resource
33{
34  /**
35   * Gets a buyer account by its name. (buyers.get)
36   *
37   * @param string $name Required. Name of the buyer to get. Format:
38   * `buyers/{buyerId}`
39   * @param array $optParams Optional parameters.
40   * @return Buyer
41   */
42  public function get($name, $optParams = [])
43  {
44    $params = ['name' => $name];
45    $params = array_merge($params, $optParams);
46    return $this->call('get', [$params], Buyer::class);
47  }
48  /**
49   * Gets remarketing tag for a buyer. A remarketing tag is a piece of JavaScript
50   * code that can be placed on a web page. When a user visits a page containing a
51   * remarketing tag, Google adds the user to a user list.
52   * (buyers.getRemarketingTag)
53   *
54   * @param string $name Required. To fetch remarketing tag for an account, name
55   * must follow the pattern `buyers/{accountId}` where `{accountId}` represents
56   * ID of a buyer that owns the remarketing tag. For a bidder accessing
57   * remarketing tag on behalf of a child seat buyer, `{accountId}` should
58   * represent the ID of the child seat buyer. To fetch remarketing tag for a
59   * specific user list, name must follow the pattern
60   * `buyers/{accountId}/userLists/{userListId}`. See UserList.name.
61   * @param array $optParams Optional parameters.
62   * @return GetRemarketingTagResponse
63   */
64  public function getRemarketingTag($name, $optParams = [])
65  {
66    $params = ['name' => $name];
67    $params = array_merge($params, $optParams);
68    return $this->call('getRemarketingTag', [$params], GetRemarketingTagResponse::class);
69  }
70  /**
71   * Lists all buyer account information the calling buyer user or service account
72   * is permissioned to manage. (buyers.listBuyers)
73   *
74   * @param array $optParams Optional parameters.
75   *
76   * @opt_param int pageSize The maximum number of buyers to return. If
77   * unspecified, at most 100 buyers will be returned. The maximum value is 500;
78   * values above 500 will be coerced to 500.
79   * @opt_param string pageToken A token identifying a page of results the server
80   * should return. This value is received from a previous `ListBuyers` call in
81   * ListBuyersResponse.nextPageToken.
82   * @return ListBuyersResponse
83   */
84  public function listBuyers($optParams = [])
85  {
86    $params = [];
87    $params = array_merge($params, $optParams);
88    return $this->call('list', [$params], ListBuyersResponse::class);
89  }
90}
91
92// Adding a class alias for backwards compatibility with the previous class name.
93class_alias(Buyers::class, 'Google_Service_RealTimeBidding_Resource_Buyers');
94