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\AdExchangeBuyerII\Resource;
19
20use Google\Service\AdExchangeBuyerII\Client;
21use Google\Service\AdExchangeBuyerII\ListClientsResponse;
22
23/**
24 * The "clients" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $adexchangebuyer2Service = new Google\Service\AdExchangeBuyerII(...);
28 *   $clients = $adexchangebuyer2Service->clients;
29 *  </code>
30 */
31class AccountsClients extends \Google\Service\Resource
32{
33  /**
34   * Creates a new client buyer. (clients.create)
35   *
36   * @param string $accountId Unique numerical account ID for the buyer of which
37   * the client buyer is a customer; the sponsor buyer to create a client for.
38   * (required)
39   * @param Client $postBody
40   * @param array $optParams Optional parameters.
41   * @return Client
42   */
43  public function create($accountId, Client $postBody, $optParams = [])
44  {
45    $params = ['accountId' => $accountId, 'postBody' => $postBody];
46    $params = array_merge($params, $optParams);
47    return $this->call('create', [$params], Client::class);
48  }
49  /**
50   * Gets a client buyer with a given client account ID. (clients.get)
51   *
52   * @param string $accountId Numerical account ID of the client's sponsor buyer.
53   * (required)
54   * @param string $clientAccountId Numerical account ID of the client buyer to
55   * retrieve. (required)
56   * @param array $optParams Optional parameters.
57   * @return Client
58   */
59  public function get($accountId, $clientAccountId, $optParams = [])
60  {
61    $params = ['accountId' => $accountId, 'clientAccountId' => $clientAccountId];
62    $params = array_merge($params, $optParams);
63    return $this->call('get', [$params], Client::class);
64  }
65  /**
66   * Lists all the clients for the current sponsor buyer.
67   * (clients.listAccountsClients)
68   *
69   * @param string $accountId Unique numerical account ID of the sponsor buyer to
70   * list the clients for.
71   * @param array $optParams Optional parameters.
72   *
73   * @opt_param int pageSize Requested page size. The server may return fewer
74   * clients than requested. If unspecified, the server will pick an appropriate
75   * default.
76   * @opt_param string pageToken A token identifying a page of results the server
77   * should return. Typically, this is the value of
78   * ListClientsResponse.nextPageToken returned from the previous call to the
79   * accounts.clients.list method.
80   * @opt_param string partnerClientId Optional unique identifier (from the
81   * standpoint of an Ad Exchange sponsor buyer partner) of the client to return.
82   * If specified, at most one client will be returned in the response.
83   * @return ListClientsResponse
84   */
85  public function listAccountsClients($accountId, $optParams = [])
86  {
87    $params = ['accountId' => $accountId];
88    $params = array_merge($params, $optParams);
89    return $this->call('list', [$params], ListClientsResponse::class);
90  }
91  /**
92   * Updates an existing client buyer. (clients.update)
93   *
94   * @param string $accountId Unique numerical account ID for the buyer of which
95   * the client buyer is a customer; the sponsor buyer to update a client for.
96   * (required)
97   * @param string $clientAccountId Unique numerical account ID of the client to
98   * update. (required)
99   * @param Client $postBody
100   * @param array $optParams Optional parameters.
101   * @return Client
102   */
103  public function update($accountId, $clientAccountId, Client $postBody, $optParams = [])
104  {
105    $params = ['accountId' => $accountId, 'clientAccountId' => $clientAccountId, 'postBody' => $postBody];
106    $params = array_merge($params, $optParams);
107    return $this->call('update', [$params], Client::class);
108  }
109}
110
111// Adding a class alias for backwards compatibility with the previous class name.
112class_alias(AccountsClients::class, 'Google_Service_AdExchangeBuyerII_Resource_AccountsClients');
113