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