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\ClientUser;
21use Google\Service\AdExchangeBuyerII\ListClientUsersResponse;
22
23/**
24 * The "users" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $adexchangebuyer2Service = new Google\Service\AdExchangeBuyerII(...);
28 *   $users = $adexchangebuyer2Service->users;
29 *  </code>
30 */
31class AccountsClientsUsers extends \Google\Service\Resource
32{
33  /**
34   * Retrieves an existing client user. (users.get)
35   *
36   * @param string $accountId Numerical account ID of the client's sponsor buyer.
37   * (required)
38   * @param string $clientAccountId Numerical account ID of the client buyer that
39   * the user to be retrieved is associated with. (required)
40   * @param string $userId Numerical identifier of the user to retrieve.
41   * (required)
42   * @param array $optParams Optional parameters.
43   * @return ClientUser
44   */
45  public function get($accountId, $clientAccountId, $userId, $optParams = [])
46  {
47    $params = ['accountId' => $accountId, 'clientAccountId' => $clientAccountId, 'userId' => $userId];
48    $params = array_merge($params, $optParams);
49    return $this->call('get', [$params], ClientUser::class);
50  }
51  /**
52   * Lists all the known client users for a specified sponsor buyer account ID.
53   * (users.listAccountsClientsUsers)
54   *
55   * @param string $accountId Numerical account ID of the sponsor buyer of the
56   * client to list users for. (required)
57   * @param string $clientAccountId The account ID of the client buyer to list
58   * users for. (required) You must specify either a string representation of a
59   * numerical account identifier or the `-` character to list all the client
60   * users for all the clients of a given sponsor buyer.
61   * @param array $optParams Optional parameters.
62   *
63   * @opt_param int pageSize Requested page size. The server may return fewer
64   * clients than requested. If unspecified, the server will pick an appropriate
65   * default.
66   * @opt_param string pageToken A token identifying a page of results the server
67   * should return. Typically, this is the value of
68   * ListClientUsersResponse.nextPageToken returned from the previous call to the
69   * accounts.clients.users.list method.
70   * @return ListClientUsersResponse
71   */
72  public function listAccountsClientsUsers($accountId, $clientAccountId, $optParams = [])
73  {
74    $params = ['accountId' => $accountId, 'clientAccountId' => $clientAccountId];
75    $params = array_merge($params, $optParams);
76    return $this->call('list', [$params], ListClientUsersResponse::class);
77  }
78  /**
79   * Updates an existing client user. Only the user status can be changed on
80   * update. (users.update)
81   *
82   * @param string $accountId Numerical account ID of the client's sponsor buyer.
83   * (required)
84   * @param string $clientAccountId Numerical account ID of the client buyer that
85   * the user to be retrieved is associated with. (required)
86   * @param string $userId Numerical identifier of the user to retrieve.
87   * (required)
88   * @param ClientUser $postBody
89   * @param array $optParams Optional parameters.
90   * @return ClientUser
91   */
92  public function update($accountId, $clientAccountId, $userId, ClientUser $postBody, $optParams = [])
93  {
94    $params = ['accountId' => $accountId, 'clientAccountId' => $clientAccountId, 'userId' => $userId, 'postBody' => $postBody];
95    $params = array_merge($params, $optParams);
96    return $this->call('update', [$params], ClientUser::class);
97  }
98}
99
100// Adding a class alias for backwards compatibility with the previous class name.
101class_alias(AccountsClientsUsers::class, 'Google_Service_AdExchangeBuyerII_Resource_AccountsClientsUsers');
102