[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\MyBusinessAccountManagement\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\MyBusinessAccountManagement\Admin;
|
---|
| 21 | use Google\Service\MyBusinessAccountManagement\ListLocationAdminsResponse;
|
---|
| 22 | use 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->locations_admins;
|
---|
| 30 | * </code>
|
---|
| 31 | */
|
---|
| 32 | class 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 | * @throws \Google\Service\Exception
|
---|
| 46 | */
|
---|
| 47 | public function create($parent, Admin $postBody, $optParams = [])
|
---|
| 48 | {
|
---|
| 49 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 50 | $params = array_merge($params, $optParams);
|
---|
| 51 | return $this->call('create', [$params], Admin::class);
|
---|
| 52 | }
|
---|
| 53 | /**
|
---|
| 54 | * Removes the specified admin as a manager of the specified location.
|
---|
| 55 | * (admins.delete)
|
---|
| 56 | *
|
---|
| 57 | * @param string $name Required. The resource name of the admin to remove from
|
---|
| 58 | * the location.
|
---|
| 59 | * @param array $optParams Optional parameters.
|
---|
| 60 | * @return MybusinessaccountmanagementEmpty
|
---|
| 61 | * @throws \Google\Service\Exception
|
---|
| 62 | */
|
---|
| 63 | public function delete($name, $optParams = [])
|
---|
| 64 | {
|
---|
| 65 | $params = ['name' => $name];
|
---|
| 66 | $params = array_merge($params, $optParams);
|
---|
| 67 | return $this->call('delete', [$params], MybusinessaccountmanagementEmpty::class);
|
---|
| 68 | }
|
---|
| 69 | /**
|
---|
| 70 | * Lists all of the admins for the specified location.
|
---|
| 71 | * (admins.listLocationsAdmins)
|
---|
| 72 | *
|
---|
| 73 | * @param string $parent Required. The name of the location to list admins of.
|
---|
| 74 | * `locations/{location_id}/admins`.
|
---|
| 75 | * @param array $optParams Optional parameters.
|
---|
| 76 | * @return ListLocationAdminsResponse
|
---|
| 77 | * @throws \Google\Service\Exception
|
---|
| 78 | */
|
---|
| 79 | public function listLocationsAdmins($parent, $optParams = [])
|
---|
| 80 | {
|
---|
| 81 | $params = ['parent' => $parent];
|
---|
| 82 | $params = array_merge($params, $optParams);
|
---|
| 83 | return $this->call('list', [$params], ListLocationAdminsResponse::class);
|
---|
| 84 | }
|
---|
| 85 | /**
|
---|
| 86 | * Updates the Admin for the specified location. Only the AdminRole of the Admin
|
---|
| 87 | * can be updated. (admins.patch)
|
---|
| 88 | *
|
---|
| 89 | * @param string $name Immutable. The resource name. For account admins, this is
|
---|
| 90 | * in the form: `accounts/{account_id}/admins/{admin_id}` For location admins,
|
---|
| 91 | * this is in the form: `locations/{location_id}/admins/{admin_id}` This field
|
---|
| 92 | * will be ignored if set during admin creation.
|
---|
| 93 | * @param Admin $postBody
|
---|
| 94 | * @param array $optParams Optional parameters.
|
---|
| 95 | *
|
---|
| 96 | * @opt_param string updateMask Required. The specific fields that should be
|
---|
| 97 | * updated. The only editable field is role.
|
---|
| 98 | * @return Admin
|
---|
| 99 | * @throws \Google\Service\Exception
|
---|
| 100 | */
|
---|
| 101 | public function patch($name, Admin $postBody, $optParams = [])
|
---|
| 102 | {
|
---|
| 103 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 104 | $params = array_merge($params, $optParams);
|
---|
| 105 | return $this->call('patch', [$params], Admin::class);
|
---|
| 106 | }
|
---|
| 107 | }
|
---|
| 108 |
|
---|
| 109 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 110 | class_alias(LocationsAdmins::class, 'Google_Service_MyBusinessAccountManagement_Resource_LocationsAdmins');
|
---|