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\Directory\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Directory\Alias;
|
---|
21 | use Google\Service\Directory\Aliases;
|
---|
22 | use Google\Service\Directory\Channel;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * The "aliases" collection of methods.
|
---|
26 | * Typical usage is:
|
---|
27 | * <code>
|
---|
28 | * $adminService = new Google\Service\Directory(...);
|
---|
29 | * $aliases = $adminService->users_aliases;
|
---|
30 | * </code>
|
---|
31 | */
|
---|
32 | class UsersAliases extends \Google\Service\Resource
|
---|
33 | {
|
---|
34 | /**
|
---|
35 | * Removes an alias. (aliases.delete)
|
---|
36 | *
|
---|
37 | * @param string $userKey Identifies the user in the API request. The value can
|
---|
38 | * be the user's primary email address, alias email address, or unique user ID.
|
---|
39 | * @param string $alias The alias to be removed.
|
---|
40 | * @param array $optParams Optional parameters.
|
---|
41 | * @throws \Google\Service\Exception
|
---|
42 | */
|
---|
43 | public function delete($userKey, $alias, $optParams = [])
|
---|
44 | {
|
---|
45 | $params = ['userKey' => $userKey, 'alias' => $alias];
|
---|
46 | $params = array_merge($params, $optParams);
|
---|
47 | return $this->call('delete', [$params]);
|
---|
48 | }
|
---|
49 | /**
|
---|
50 | * Adds an alias. (aliases.insert)
|
---|
51 | *
|
---|
52 | * @param string $userKey Identifies the user in the API request. The value can
|
---|
53 | * be the user's primary email address, alias email address, or unique user ID.
|
---|
54 | * @param Alias $postBody
|
---|
55 | * @param array $optParams Optional parameters.
|
---|
56 | * @return Alias
|
---|
57 | * @throws \Google\Service\Exception
|
---|
58 | */
|
---|
59 | public function insert($userKey, Alias $postBody, $optParams = [])
|
---|
60 | {
|
---|
61 | $params = ['userKey' => $userKey, 'postBody' => $postBody];
|
---|
62 | $params = array_merge($params, $optParams);
|
---|
63 | return $this->call('insert', [$params], Alias::class);
|
---|
64 | }
|
---|
65 | /**
|
---|
66 | * Lists all aliases for a user. (aliases.listUsersAliases)
|
---|
67 | *
|
---|
68 | * @param string $userKey Identifies the user in the API request. The value can
|
---|
69 | * be the user's primary email address, alias email address, or unique user ID.
|
---|
70 | * @param array $optParams Optional parameters.
|
---|
71 | *
|
---|
72 | * @opt_param string event Events to watch for.
|
---|
73 | * @return Aliases
|
---|
74 | * @throws \Google\Service\Exception
|
---|
75 | */
|
---|
76 | public function listUsersAliases($userKey, $optParams = [])
|
---|
77 | {
|
---|
78 | $params = ['userKey' => $userKey];
|
---|
79 | $params = array_merge($params, $optParams);
|
---|
80 | return $this->call('list', [$params], Aliases::class);
|
---|
81 | }
|
---|
82 | /**
|
---|
83 | * Watches for changes in users list. (aliases.watch)
|
---|
84 | *
|
---|
85 | * @param string $userKey Email or immutable ID of the user
|
---|
86 | * @param Channel $postBody
|
---|
87 | * @param array $optParams Optional parameters.
|
---|
88 | *
|
---|
89 | * @opt_param string event Events to watch for.
|
---|
90 | * @return Channel
|
---|
91 | * @throws \Google\Service\Exception
|
---|
92 | */
|
---|
93 | public function watch($userKey, Channel $postBody, $optParams = [])
|
---|
94 | {
|
---|
95 | $params = ['userKey' => $userKey, 'postBody' => $postBody];
|
---|
96 | $params = array_merge($params, $optParams);
|
---|
97 | return $this->call('watch', [$params], Channel::class);
|
---|
98 | }
|
---|
99 | }
|
---|
100 |
|
---|
101 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
102 | class_alias(UsersAliases::class, 'Google_Service_Directory_Resource_UsersAliases');
|
---|