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\Gmail\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Gmail\AutoForwarding;
|
---|
21 | use Google\Service\Gmail\ImapSettings;
|
---|
22 | use Google\Service\Gmail\LanguageSettings;
|
---|
23 | use Google\Service\Gmail\PopSettings;
|
---|
24 | use Google\Service\Gmail\VacationSettings;
|
---|
25 |
|
---|
26 | /**
|
---|
27 | * The "settings" collection of methods.
|
---|
28 | * Typical usage is:
|
---|
29 | * <code>
|
---|
30 | * $gmailService = new Google\Service\Gmail(...);
|
---|
31 | * $settings = $gmailService->users_settings;
|
---|
32 | * </code>
|
---|
33 | */
|
---|
34 | class UsersSettings extends \Google\Service\Resource
|
---|
35 | {
|
---|
36 | /**
|
---|
37 | * Gets the auto-forwarding setting for the specified account.
|
---|
38 | * (settings.getAutoForwarding)
|
---|
39 | *
|
---|
40 | * @param string $userId User's email address. The special value "me" can be
|
---|
41 | * used to indicate the authenticated user.
|
---|
42 | * @param array $optParams Optional parameters.
|
---|
43 | * @return AutoForwarding
|
---|
44 | * @throws \Google\Service\Exception
|
---|
45 | */
|
---|
46 | public function getAutoForwarding($userId, $optParams = [])
|
---|
47 | {
|
---|
48 | $params = ['userId' => $userId];
|
---|
49 | $params = array_merge($params, $optParams);
|
---|
50 | return $this->call('getAutoForwarding', [$params], AutoForwarding::class);
|
---|
51 | }
|
---|
52 | /**
|
---|
53 | * Gets IMAP settings. (settings.getImap)
|
---|
54 | *
|
---|
55 | * @param string $userId User's email address. The special value "me" can be
|
---|
56 | * used to indicate the authenticated user.
|
---|
57 | * @param array $optParams Optional parameters.
|
---|
58 | * @return ImapSettings
|
---|
59 | * @throws \Google\Service\Exception
|
---|
60 | */
|
---|
61 | public function getImap($userId, $optParams = [])
|
---|
62 | {
|
---|
63 | $params = ['userId' => $userId];
|
---|
64 | $params = array_merge($params, $optParams);
|
---|
65 | return $this->call('getImap', [$params], ImapSettings::class);
|
---|
66 | }
|
---|
67 | /**
|
---|
68 | * Gets language settings. (settings.getLanguage)
|
---|
69 | *
|
---|
70 | * @param string $userId User's email address. The special value "me" can be
|
---|
71 | * used to indicate the authenticated user.
|
---|
72 | * @param array $optParams Optional parameters.
|
---|
73 | * @return LanguageSettings
|
---|
74 | * @throws \Google\Service\Exception
|
---|
75 | */
|
---|
76 | public function getLanguage($userId, $optParams = [])
|
---|
77 | {
|
---|
78 | $params = ['userId' => $userId];
|
---|
79 | $params = array_merge($params, $optParams);
|
---|
80 | return $this->call('getLanguage', [$params], LanguageSettings::class);
|
---|
81 | }
|
---|
82 | /**
|
---|
83 | * Gets POP settings. (settings.getPop)
|
---|
84 | *
|
---|
85 | * @param string $userId User's email address. The special value "me" can be
|
---|
86 | * used to indicate the authenticated user.
|
---|
87 | * @param array $optParams Optional parameters.
|
---|
88 | * @return PopSettings
|
---|
89 | * @throws \Google\Service\Exception
|
---|
90 | */
|
---|
91 | public function getPop($userId, $optParams = [])
|
---|
92 | {
|
---|
93 | $params = ['userId' => $userId];
|
---|
94 | $params = array_merge($params, $optParams);
|
---|
95 | return $this->call('getPop', [$params], PopSettings::class);
|
---|
96 | }
|
---|
97 | /**
|
---|
98 | * Gets vacation responder settings. (settings.getVacation)
|
---|
99 | *
|
---|
100 | * @param string $userId User's email address. The special value "me" can be
|
---|
101 | * used to indicate the authenticated user.
|
---|
102 | * @param array $optParams Optional parameters.
|
---|
103 | * @return VacationSettings
|
---|
104 | * @throws \Google\Service\Exception
|
---|
105 | */
|
---|
106 | public function getVacation($userId, $optParams = [])
|
---|
107 | {
|
---|
108 | $params = ['userId' => $userId];
|
---|
109 | $params = array_merge($params, $optParams);
|
---|
110 | return $this->call('getVacation', [$params], VacationSettings::class);
|
---|
111 | }
|
---|
112 | /**
|
---|
113 | * Updates the auto-forwarding setting for the specified account. A verified
|
---|
114 | * forwarding address must be specified when auto-forwarding is enabled. This
|
---|
115 | * method is only available to service account clients that have been delegated
|
---|
116 | * domain-wide authority. (settings.updateAutoForwarding)
|
---|
117 | *
|
---|
118 | * @param string $userId User's email address. The special value "me" can be
|
---|
119 | * used to indicate the authenticated user.
|
---|
120 | * @param AutoForwarding $postBody
|
---|
121 | * @param array $optParams Optional parameters.
|
---|
122 | * @return AutoForwarding
|
---|
123 | * @throws \Google\Service\Exception
|
---|
124 | */
|
---|
125 | public function updateAutoForwarding($userId, AutoForwarding $postBody, $optParams = [])
|
---|
126 | {
|
---|
127 | $params = ['userId' => $userId, 'postBody' => $postBody];
|
---|
128 | $params = array_merge($params, $optParams);
|
---|
129 | return $this->call('updateAutoForwarding', [$params], AutoForwarding::class);
|
---|
130 | }
|
---|
131 | /**
|
---|
132 | * Updates IMAP settings. (settings.updateImap)
|
---|
133 | *
|
---|
134 | * @param string $userId User's email address. The special value "me" can be
|
---|
135 | * used to indicate the authenticated user.
|
---|
136 | * @param ImapSettings $postBody
|
---|
137 | * @param array $optParams Optional parameters.
|
---|
138 | * @return ImapSettings
|
---|
139 | * @throws \Google\Service\Exception
|
---|
140 | */
|
---|
141 | public function updateImap($userId, ImapSettings $postBody, $optParams = [])
|
---|
142 | {
|
---|
143 | $params = ['userId' => $userId, 'postBody' => $postBody];
|
---|
144 | $params = array_merge($params, $optParams);
|
---|
145 | return $this->call('updateImap', [$params], ImapSettings::class);
|
---|
146 | }
|
---|
147 | /**
|
---|
148 | * Updates language settings. If successful, the return object contains the
|
---|
149 | * `displayLanguage` that was saved for the user, which may differ from the
|
---|
150 | * value passed into the request. This is because the requested
|
---|
151 | * `displayLanguage` may not be directly supported by Gmail but have a close
|
---|
152 | * variant that is, and so the variant may be chosen and saved instead.
|
---|
153 | * (settings.updateLanguage)
|
---|
154 | *
|
---|
155 | * @param string $userId User's email address. The special value "me" can be
|
---|
156 | * used to indicate the authenticated user.
|
---|
157 | * @param LanguageSettings $postBody
|
---|
158 | * @param array $optParams Optional parameters.
|
---|
159 | * @return LanguageSettings
|
---|
160 | * @throws \Google\Service\Exception
|
---|
161 | */
|
---|
162 | public function updateLanguage($userId, LanguageSettings $postBody, $optParams = [])
|
---|
163 | {
|
---|
164 | $params = ['userId' => $userId, 'postBody' => $postBody];
|
---|
165 | $params = array_merge($params, $optParams);
|
---|
166 | return $this->call('updateLanguage', [$params], LanguageSettings::class);
|
---|
167 | }
|
---|
168 | /**
|
---|
169 | * Updates POP settings. (settings.updatePop)
|
---|
170 | *
|
---|
171 | * @param string $userId User's email address. The special value "me" can be
|
---|
172 | * used to indicate the authenticated user.
|
---|
173 | * @param PopSettings $postBody
|
---|
174 | * @param array $optParams Optional parameters.
|
---|
175 | * @return PopSettings
|
---|
176 | * @throws \Google\Service\Exception
|
---|
177 | */
|
---|
178 | public function updatePop($userId, PopSettings $postBody, $optParams = [])
|
---|
179 | {
|
---|
180 | $params = ['userId' => $userId, 'postBody' => $postBody];
|
---|
181 | $params = array_merge($params, $optParams);
|
---|
182 | return $this->call('updatePop', [$params], PopSettings::class);
|
---|
183 | }
|
---|
184 | /**
|
---|
185 | * Updates vacation responder settings. (settings.updateVacation)
|
---|
186 | *
|
---|
187 | * @param string $userId User's email address. The special value "me" can be
|
---|
188 | * used to indicate the authenticated user.
|
---|
189 | * @param VacationSettings $postBody
|
---|
190 | * @param array $optParams Optional parameters.
|
---|
191 | * @return VacationSettings
|
---|
192 | * @throws \Google\Service\Exception
|
---|
193 | */
|
---|
194 | public function updateVacation($userId, VacationSettings $postBody, $optParams = [])
|
---|
195 | {
|
---|
196 | $params = ['userId' => $userId, 'postBody' => $postBody];
|
---|
197 | $params = array_merge($params, $optParams);
|
---|
198 | return $this->call('updateVacation', [$params], VacationSettings::class);
|
---|
199 | }
|
---|
200 | }
|
---|
201 |
|
---|
202 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
203 | class_alias(UsersSettings::class, 'Google_Service_Gmail_Resource_UsersSettings');
|
---|