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\Admin;
21use Google\Service\MyBusinessAccountManagement\ListLocationAdminsResponse;
22use Google\Service\MyBusinessAccountManagement\MybusinessaccountmanagementEmpty;
23
24/**
25 * The "admins" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $mybusinessaccountmanagementService = new Google\Service\MyBusinessAccountManagement(...);
29 *   $admins = $mybusinessaccountmanagementService->admins;
30 *  </code>
31 */
32class LocationsAdmins extends \Google\Service\Resource
33{
34  /**
35   * Invites the specified user to become an administrator for the specified
36   * location. The invitee must accept the invitation in order to be granted
37   * access to the location. See AcceptInvitation to programmatically accept an
38   * invitation. (admins.create)
39   *
40   * @param string $parent Required. The resource name of the location this admin
41   * is created for. `locations/{location_id}/admins`.
42   * @param Admin $postBody
43   * @param array $optParams Optional parameters.
44   * @return Admin
45   */
46  public function create($parent, Admin $postBody, $optParams = [])
47  {
48    $params = ['parent' => $parent, 'postBody' => $postBody];
49    $params = array_merge($params, $optParams);
50    return $this->call('create', [$params], Admin::class);
51  }
52  /**
53   * Removes the specified admin as a manager of the specified location.
54   * (admins.delete)
55   *
56   * @param string $name Required. The resource name of the admin to remove from
57   * the location.
58   * @param array $optParams Optional parameters.
59   * @return MybusinessaccountmanagementEmpty
60   */
61  public function delete($name, $optParams = [])
62  {
63    $params = ['name' => $name];
64    $params = array_merge($params, $optParams);
65    return $this->call('delete', [$params], MybusinessaccountmanagementEmpty::class);
66  }
67  /**
68   * Lists all of the admins for the specified location.
69   * (admins.listLocationsAdmins)
70   *
71   * @param string $parent Required. The name of the location to list admins of.
72   * `locations/{location_id}/admins`.
73   * @param array $optParams Optional parameters.
74   * @return ListLocationAdminsResponse
75   */
76  public function listLocationsAdmins($parent, $optParams = [])
77  {
78    $params = ['parent' => $parent];
79    $params = array_merge($params, $optParams);
80    return $this->call('list', [$params], ListLocationAdminsResponse::class);
81  }
82  /**
83   * Updates the Admin for the specified location. Only the AdminRole of the Admin
84   * can be updated. (admins.patch)
85   *
86   * @param string $name Immutable. The resource name. For account admins, this is
87   * in the form: `accounts/{account_id}/admins/{admin_id}` For location admins,
88   * this is in the form: `locations/{location_id}/admins/{admin_id}` This field
89   * will be ignored if set during admin creation.
90   * @param Admin $postBody
91   * @param array $optParams Optional parameters.
92   *
93   * @opt_param string updateMask Required. The specific fields that should be
94   * updated. The only editable field is role.
95   * @return Admin
96   */
97  public function patch($name, Admin $postBody, $optParams = [])
98  {
99    $params = ['name' => $name, 'postBody' => $postBody];
100    $params = array_merge($params, $optParams);
101    return $this->call('patch', [$params], Admin::class);
102  }
103}
104
105// Adding a class alias for backwards compatibility with the previous class name.
106class_alias(LocationsAdmins::class, 'Google_Service_MyBusinessAccountManagement_Resource_LocationsAdmins');
107