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