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