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\ListSmimeInfoResponse;
|
---|
21 | use Google\Service\Gmail\SmimeInfo;
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * The "smimeInfo" collection of methods.
|
---|
25 | * Typical usage is:
|
---|
26 | * <code>
|
---|
27 | * $gmailService = new Google\Service\Gmail(...);
|
---|
28 | * $smimeInfo = $gmailService->users_settings_sendAs_smimeInfo;
|
---|
29 | * </code>
|
---|
30 | */
|
---|
31 | class UsersSettingsSendAsSmimeInfo extends \Google\Service\Resource
|
---|
32 | {
|
---|
33 | /**
|
---|
34 | * Deletes the specified S/MIME config for the specified send-as alias.
|
---|
35 | * (smimeInfo.delete)
|
---|
36 | *
|
---|
37 | * @param string $userId The user's email address. The special value `me` can be
|
---|
38 | * used to indicate the authenticated user.
|
---|
39 | * @param string $sendAsEmail The email address that appears in the "From:"
|
---|
40 | * header for mail sent using this alias.
|
---|
41 | * @param string $id The immutable ID for the SmimeInfo.
|
---|
42 | * @param array $optParams Optional parameters.
|
---|
43 | * @throws \Google\Service\Exception
|
---|
44 | */
|
---|
45 | public function delete($userId, $sendAsEmail, $id, $optParams = [])
|
---|
46 | {
|
---|
47 | $params = ['userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'id' => $id];
|
---|
48 | $params = array_merge($params, $optParams);
|
---|
49 | return $this->call('delete', [$params]);
|
---|
50 | }
|
---|
51 | /**
|
---|
52 | * Gets the specified S/MIME config for the specified send-as alias.
|
---|
53 | * (smimeInfo.get)
|
---|
54 | *
|
---|
55 | * @param string $userId The user's email address. The special value `me` can be
|
---|
56 | * used to indicate the authenticated user.
|
---|
57 | * @param string $sendAsEmail The email address that appears in the "From:"
|
---|
58 | * header for mail sent using this alias.
|
---|
59 | * @param string $id The immutable ID for the SmimeInfo.
|
---|
60 | * @param array $optParams Optional parameters.
|
---|
61 | * @return SmimeInfo
|
---|
62 | * @throws \Google\Service\Exception
|
---|
63 | */
|
---|
64 | public function get($userId, $sendAsEmail, $id, $optParams = [])
|
---|
65 | {
|
---|
66 | $params = ['userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'id' => $id];
|
---|
67 | $params = array_merge($params, $optParams);
|
---|
68 | return $this->call('get', [$params], SmimeInfo::class);
|
---|
69 | }
|
---|
70 | /**
|
---|
71 | * Insert (upload) the given S/MIME config for the specified send-as alias. Note
|
---|
72 | * that pkcs12 format is required for the key. (smimeInfo.insert)
|
---|
73 | *
|
---|
74 | * @param string $userId The user's email address. The special value `me` can be
|
---|
75 | * used to indicate the authenticated user.
|
---|
76 | * @param string $sendAsEmail The email address that appears in the "From:"
|
---|
77 | * header for mail sent using this alias.
|
---|
78 | * @param SmimeInfo $postBody
|
---|
79 | * @param array $optParams Optional parameters.
|
---|
80 | * @return SmimeInfo
|
---|
81 | * @throws \Google\Service\Exception
|
---|
82 | */
|
---|
83 | public function insert($userId, $sendAsEmail, SmimeInfo $postBody, $optParams = [])
|
---|
84 | {
|
---|
85 | $params = ['userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'postBody' => $postBody];
|
---|
86 | $params = array_merge($params, $optParams);
|
---|
87 | return $this->call('insert', [$params], SmimeInfo::class);
|
---|
88 | }
|
---|
89 | /**
|
---|
90 | * Lists S/MIME configs for the specified send-as alias.
|
---|
91 | * (smimeInfo.listUsersSettingsSendAsSmimeInfo)
|
---|
92 | *
|
---|
93 | * @param string $userId The user's email address. The special value `me` can be
|
---|
94 | * used to indicate the authenticated user.
|
---|
95 | * @param string $sendAsEmail The email address that appears in the "From:"
|
---|
96 | * header for mail sent using this alias.
|
---|
97 | * @param array $optParams Optional parameters.
|
---|
98 | * @return ListSmimeInfoResponse
|
---|
99 | * @throws \Google\Service\Exception
|
---|
100 | */
|
---|
101 | public function listUsersSettingsSendAsSmimeInfo($userId, $sendAsEmail, $optParams = [])
|
---|
102 | {
|
---|
103 | $params = ['userId' => $userId, 'sendAsEmail' => $sendAsEmail];
|
---|
104 | $params = array_merge($params, $optParams);
|
---|
105 | return $this->call('list', [$params], ListSmimeInfoResponse::class);
|
---|
106 | }
|
---|
107 | /**
|
---|
108 | * Sets the default S/MIME config for the specified send-as alias.
|
---|
109 | * (smimeInfo.setDefault)
|
---|
110 | *
|
---|
111 | * @param string $userId The user's email address. The special value `me` can be
|
---|
112 | * used to indicate the authenticated user.
|
---|
113 | * @param string $sendAsEmail The email address that appears in the "From:"
|
---|
114 | * header for mail sent using this alias.
|
---|
115 | * @param string $id The immutable ID for the SmimeInfo.
|
---|
116 | * @param array $optParams Optional parameters.
|
---|
117 | * @throws \Google\Service\Exception
|
---|
118 | */
|
---|
119 | public function setDefault($userId, $sendAsEmail, $id, $optParams = [])
|
---|
120 | {
|
---|
121 | $params = ['userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'id' => $id];
|
---|
122 | $params = array_merge($params, $optParams);
|
---|
123 | return $this->call('setDefault', [$params]);
|
---|
124 | }
|
---|
125 | }
|
---|
126 |
|
---|
127 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
128 | class_alias(UsersSettingsSendAsSmimeInfo::class, 'Google_Service_Gmail_Resource_UsersSettingsSendAsSmimeInfo');
|
---|