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\MyBusinessAccountManagement\Resource;
19
20use Google\Service\MyBusinessAccountManagement\AcceptInvitationRequest;
21use Google\Service\MyBusinessAccountManagement\DeclineInvitationRequest;
22use Google\Service\MyBusinessAccountManagement\ListInvitationsResponse;
23use Google\Service\MyBusinessAccountManagement\MybusinessaccountmanagementEmpty;
24
25/**
26 * The "invitations" collection of methods.
27 * Typical usage is:
28 *  <code>
29 *   $mybusinessaccountmanagementService = new Google\Service\MyBusinessAccountManagement(...);
30 *   $invitations = $mybusinessaccountmanagementService->invitations;
31 *  </code>
32 */
33class AccountsInvitations extends \Google\Service\Resource
34{
35  /**
36   * Accepts the specified invitation. (invitations.accept)
37   *
38   * @param string $name Required. The name of the invitation that is being
39   * accepted. `accounts/{account_id}/invitations/{invitation_id}`
40   * @param AcceptInvitationRequest $postBody
41   * @param array $optParams Optional parameters.
42   * @return MybusinessaccountmanagementEmpty
43   */
44  public function accept($name, AcceptInvitationRequest $postBody, $optParams = [])
45  {
46    $params = ['name' => $name, 'postBody' => $postBody];
47    $params = array_merge($params, $optParams);
48    return $this->call('accept', [$params], MybusinessaccountmanagementEmpty::class);
49  }
50  /**
51   * Declines the specified invitation. (invitations.decline)
52   *
53   * @param string $name Required. The name of the account invitation that is
54   * being declined. `accounts/{account_id}/invitations/{invitation_id}`
55   * @param DeclineInvitationRequest $postBody
56   * @param array $optParams Optional parameters.
57   * @return MybusinessaccountmanagementEmpty
58   */
59  public function decline($name, DeclineInvitationRequest $postBody, $optParams = [])
60  {
61    $params = ['name' => $name, 'postBody' => $postBody];
62    $params = array_merge($params, $optParams);
63    return $this->call('decline', [$params], MybusinessaccountmanagementEmpty::class);
64  }
65  /**
66   * Lists pending invitations for the specified account.
67   * (invitations.listAccountsInvitations)
68   *
69   * @param string $parent Required. The name of the account from which the list
70   * of invitations is being retrieved. `accounts/{account_id}/invitations`
71   * @param array $optParams Optional parameters.
72   *
73   * @opt_param string filter Optional. Filtering the response is supported via
74   * the Invitation.target_type field.
75   * @return ListInvitationsResponse
76   */
77  public function listAccountsInvitations($parent, $optParams = [])
78  {
79    $params = ['parent' => $parent];
80    $params = array_merge($params, $optParams);
81    return $this->call('list', [$params], ListInvitationsResponse::class);
82  }
83}
84
85// Adding a class alias for backwards compatibility with the previous class name.
86class_alias(AccountsInvitations::class, 'Google_Service_MyBusinessAccountManagement_Resource_AccountsInvitations');
87