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\CseKeyPair;
|
---|
21 | use Google\Service\Gmail\DisableCseKeyPairRequest;
|
---|
22 | use Google\Service\Gmail\EnableCseKeyPairRequest;
|
---|
23 | use Google\Service\Gmail\ListCseKeyPairsResponse;
|
---|
24 | use Google\Service\Gmail\ObliterateCseKeyPairRequest;
|
---|
25 |
|
---|
26 | /**
|
---|
27 | * The "keypairs" collection of methods.
|
---|
28 | * Typical usage is:
|
---|
29 | * <code>
|
---|
30 | * $gmailService = new Google\Service\Gmail(...);
|
---|
31 | * $keypairs = $gmailService->users_settings_cse_keypairs;
|
---|
32 | * </code>
|
---|
33 | */
|
---|
34 | class UsersSettingsCseKeypairs extends \Google\Service\Resource
|
---|
35 | {
|
---|
36 | /**
|
---|
37 | * Creates and uploads a client-side encryption S/MIME public key certificate
|
---|
38 | * chain and private key metadata for the authenticated user. (keypairs.create)
|
---|
39 | *
|
---|
40 | * @param string $userId The requester's primary email address. To indicate the
|
---|
41 | * authenticated user, you can use the special value `me`.
|
---|
42 | * @param CseKeyPair $postBody
|
---|
43 | * @param array $optParams Optional parameters.
|
---|
44 | * @return CseKeyPair
|
---|
45 | * @throws \Google\Service\Exception
|
---|
46 | */
|
---|
47 | public function create($userId, CseKeyPair $postBody, $optParams = [])
|
---|
48 | {
|
---|
49 | $params = ['userId' => $userId, 'postBody' => $postBody];
|
---|
50 | $params = array_merge($params, $optParams);
|
---|
51 | return $this->call('create', [$params], CseKeyPair::class);
|
---|
52 | }
|
---|
53 | /**
|
---|
54 | * Turns off a client-side encryption key pair. The authenticated user can no
|
---|
55 | * longer use the key pair to decrypt incoming CSE message texts or sign
|
---|
56 | * outgoing CSE mail. To regain access, use the EnableCseKeyPair to turn on the
|
---|
57 | * key pair. After 30 days, you can permanently delete the key pair by using the
|
---|
58 | * ObliterateCseKeyPair method. (keypairs.disable)
|
---|
59 | *
|
---|
60 | * @param string $userId The requester's primary email address. To indicate the
|
---|
61 | * authenticated user, you can use the special value `me`.
|
---|
62 | * @param string $keyPairId The identifier of the key pair to turn off.
|
---|
63 | * @param DisableCseKeyPairRequest $postBody
|
---|
64 | * @param array $optParams Optional parameters.
|
---|
65 | * @return CseKeyPair
|
---|
66 | * @throws \Google\Service\Exception
|
---|
67 | */
|
---|
68 | public function disable($userId, $keyPairId, DisableCseKeyPairRequest $postBody, $optParams = [])
|
---|
69 | {
|
---|
70 | $params = ['userId' => $userId, 'keyPairId' => $keyPairId, 'postBody' => $postBody];
|
---|
71 | $params = array_merge($params, $optParams);
|
---|
72 | return $this->call('disable', [$params], CseKeyPair::class);
|
---|
73 | }
|
---|
74 | /**
|
---|
75 | * Turns on a client-side encryption key pair that was turned off. The key pair
|
---|
76 | * becomes active again for any associated client-side encryption identities.
|
---|
77 | * (keypairs.enable)
|
---|
78 | *
|
---|
79 | * @param string $userId The requester's primary email address. To indicate the
|
---|
80 | * authenticated user, you can use the special value `me`.
|
---|
81 | * @param string $keyPairId The identifier of the key pair to turn on.
|
---|
82 | * @param EnableCseKeyPairRequest $postBody
|
---|
83 | * @param array $optParams Optional parameters.
|
---|
84 | * @return CseKeyPair
|
---|
85 | * @throws \Google\Service\Exception
|
---|
86 | */
|
---|
87 | public function enable($userId, $keyPairId, EnableCseKeyPairRequest $postBody, $optParams = [])
|
---|
88 | {
|
---|
89 | $params = ['userId' => $userId, 'keyPairId' => $keyPairId, 'postBody' => $postBody];
|
---|
90 | $params = array_merge($params, $optParams);
|
---|
91 | return $this->call('enable', [$params], CseKeyPair::class);
|
---|
92 | }
|
---|
93 | /**
|
---|
94 | * Retrieves an existing client-side encryption key pair. (keypairs.get)
|
---|
95 | *
|
---|
96 | * @param string $userId The requester's primary email address. To indicate the
|
---|
97 | * authenticated user, you can use the special value `me`.
|
---|
98 | * @param string $keyPairId The identifier of the key pair to retrieve.
|
---|
99 | * @param array $optParams Optional parameters.
|
---|
100 | * @return CseKeyPair
|
---|
101 | * @throws \Google\Service\Exception
|
---|
102 | */
|
---|
103 | public function get($userId, $keyPairId, $optParams = [])
|
---|
104 | {
|
---|
105 | $params = ['userId' => $userId, 'keyPairId' => $keyPairId];
|
---|
106 | $params = array_merge($params, $optParams);
|
---|
107 | return $this->call('get', [$params], CseKeyPair::class);
|
---|
108 | }
|
---|
109 | /**
|
---|
110 | * Lists client-side encryption key pairs for an authenticated user.
|
---|
111 | * (keypairs.listUsersSettingsCseKeypairs)
|
---|
112 | *
|
---|
113 | * @param string $userId The requester's primary email address. To indicate the
|
---|
114 | * authenticated user, you can use the special value `me`.
|
---|
115 | * @param array $optParams Optional parameters.
|
---|
116 | *
|
---|
117 | * @opt_param int pageSize The number of key pairs to return. If not provided,
|
---|
118 | * the page size will default to 20 entries.
|
---|
119 | * @opt_param string pageToken Pagination token indicating which page of key
|
---|
120 | * pairs to return. If the token is not supplied, then the API will return the
|
---|
121 | * first page of results.
|
---|
122 | * @return ListCseKeyPairsResponse
|
---|
123 | * @throws \Google\Service\Exception
|
---|
124 | */
|
---|
125 | public function listUsersSettingsCseKeypairs($userId, $optParams = [])
|
---|
126 | {
|
---|
127 | $params = ['userId' => $userId];
|
---|
128 | $params = array_merge($params, $optParams);
|
---|
129 | return $this->call('list', [$params], ListCseKeyPairsResponse::class);
|
---|
130 | }
|
---|
131 | /**
|
---|
132 | * Deletes a client-side encryption key pair permanently and immediately. You
|
---|
133 | * can only permanently delete key pairs that have been turned off for more than
|
---|
134 | * 30 days. To turn off a key pair, use the DisableCseKeyPair method. Gmail
|
---|
135 | * can't restore or decrypt any messages that were encrypted by an obliterated
|
---|
136 | * key. Authenticated users and Google Workspace administrators lose access to
|
---|
137 | * reading the encrypted messages. (keypairs.obliterate)
|
---|
138 | *
|
---|
139 | * @param string $userId The requester's primary email address. To indicate the
|
---|
140 | * authenticated user, you can use the special value `me`.
|
---|
141 | * @param string $keyPairId The identifier of the key pair to obliterate.
|
---|
142 | * @param ObliterateCseKeyPairRequest $postBody
|
---|
143 | * @param array $optParams Optional parameters.
|
---|
144 | * @throws \Google\Service\Exception
|
---|
145 | */
|
---|
146 | public function obliterate($userId, $keyPairId, ObliterateCseKeyPairRequest $postBody, $optParams = [])
|
---|
147 | {
|
---|
148 | $params = ['userId' => $userId, 'keyPairId' => $keyPairId, 'postBody' => $postBody];
|
---|
149 | $params = array_merge($params, $optParams);
|
---|
150 | return $this->call('obliterate', [$params]);
|
---|
151 | }
|
---|
152 | }
|
---|
153 |
|
---|
154 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
155 | class_alias(UsersSettingsCseKeypairs::class, 'Google_Service_Gmail_Resource_UsersSettingsCseKeypairs');
|
---|