[e3d4e0a] | 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\CseIdentity;
|
---|
| 21 | use Google\Service\Gmail\ListCseIdentitiesResponse;
|
---|
| 22 |
|
---|
| 23 | /**
|
---|
| 24 | * The "identities" collection of methods.
|
---|
| 25 | * Typical usage is:
|
---|
| 26 | * <code>
|
---|
| 27 | * $gmailService = new Google\Service\Gmail(...);
|
---|
| 28 | * $identities = $gmailService->users_settings_cse_identities;
|
---|
| 29 | * </code>
|
---|
| 30 | */
|
---|
| 31 | class UsersSettingsCseIdentities extends \Google\Service\Resource
|
---|
| 32 | {
|
---|
| 33 | /**
|
---|
| 34 | * Creates and configures a client-side encryption identity that's authorized to
|
---|
| 35 | * send mail from the user account. Google publishes the S/MIME certificate to a
|
---|
| 36 | * shared domain-wide directory so that people within a Google Workspace
|
---|
| 37 | * organization can encrypt and send mail to the identity. (identities.create)
|
---|
| 38 | *
|
---|
| 39 | * @param string $userId The requester's primary email address. To indicate the
|
---|
| 40 | * authenticated user, you can use the special value `me`.
|
---|
| 41 | * @param CseIdentity $postBody
|
---|
| 42 | * @param array $optParams Optional parameters.
|
---|
| 43 | * @return CseIdentity
|
---|
| 44 | * @throws \Google\Service\Exception
|
---|
| 45 | */
|
---|
| 46 | public function create($userId, CseIdentity $postBody, $optParams = [])
|
---|
| 47 | {
|
---|
| 48 | $params = ['userId' => $userId, 'postBody' => $postBody];
|
---|
| 49 | $params = array_merge($params, $optParams);
|
---|
| 50 | return $this->call('create', [$params], CseIdentity::class);
|
---|
| 51 | }
|
---|
| 52 | /**
|
---|
| 53 | * Deletes a client-side encryption identity. The authenticated user can no
|
---|
| 54 | * longer use the identity to send encrypted messages. You cannot restore the
|
---|
| 55 | * identity after you delete it. Instead, use the CreateCseIdentity method to
|
---|
| 56 | * create another identity with the same configuration. (identities.delete)
|
---|
| 57 | *
|
---|
| 58 | * @param string $userId The requester's primary email address. To indicate the
|
---|
| 59 | * authenticated user, you can use the special value `me`.
|
---|
| 60 | * @param string $cseEmailAddress The primary email address associated with the
|
---|
| 61 | * client-side encryption identity configuration that's removed.
|
---|
| 62 | * @param array $optParams Optional parameters.
|
---|
| 63 | * @throws \Google\Service\Exception
|
---|
| 64 | */
|
---|
| 65 | public function delete($userId, $cseEmailAddress, $optParams = [])
|
---|
| 66 | {
|
---|
| 67 | $params = ['userId' => $userId, 'cseEmailAddress' => $cseEmailAddress];
|
---|
| 68 | $params = array_merge($params, $optParams);
|
---|
| 69 | return $this->call('delete', [$params]);
|
---|
| 70 | }
|
---|
| 71 | /**
|
---|
| 72 | * Retrieves a client-side encryption identity configuration. (identities.get)
|
---|
| 73 | *
|
---|
| 74 | * @param string $userId The requester's primary email address. To indicate the
|
---|
| 75 | * authenticated user, you can use the special value `me`.
|
---|
| 76 | * @param string $cseEmailAddress The primary email address associated with the
|
---|
| 77 | * client-side encryption identity configuration that's retrieved.
|
---|
| 78 | * @param array $optParams Optional parameters.
|
---|
| 79 | * @return CseIdentity
|
---|
| 80 | * @throws \Google\Service\Exception
|
---|
| 81 | */
|
---|
| 82 | public function get($userId, $cseEmailAddress, $optParams = [])
|
---|
| 83 | {
|
---|
| 84 | $params = ['userId' => $userId, 'cseEmailAddress' => $cseEmailAddress];
|
---|
| 85 | $params = array_merge($params, $optParams);
|
---|
| 86 | return $this->call('get', [$params], CseIdentity::class);
|
---|
| 87 | }
|
---|
| 88 | /**
|
---|
| 89 | * Lists the client-side encrypted identities for an authenticated user.
|
---|
| 90 | * (identities.listUsersSettingsCseIdentities)
|
---|
| 91 | *
|
---|
| 92 | * @param string $userId The requester's primary email address. To indicate the
|
---|
| 93 | * authenticated user, you can use the special value `me`.
|
---|
| 94 | * @param array $optParams Optional parameters.
|
---|
| 95 | *
|
---|
| 96 | * @opt_param int pageSize The number of identities to return. If not provided,
|
---|
| 97 | * the page size will default to 20 entries.
|
---|
| 98 | * @opt_param string pageToken Pagination token indicating which page of
|
---|
| 99 | * identities to return. If the token is not supplied, then the API will return
|
---|
| 100 | * the first page of results.
|
---|
| 101 | * @return ListCseIdentitiesResponse
|
---|
| 102 | * @throws \Google\Service\Exception
|
---|
| 103 | */
|
---|
| 104 | public function listUsersSettingsCseIdentities($userId, $optParams = [])
|
---|
| 105 | {
|
---|
| 106 | $params = ['userId' => $userId];
|
---|
| 107 | $params = array_merge($params, $optParams);
|
---|
| 108 | return $this->call('list', [$params], ListCseIdentitiesResponse::class);
|
---|
| 109 | }
|
---|
| 110 | /**
|
---|
| 111 | * Associates a different key pair with an existing client-side encryption
|
---|
| 112 | * identity. The updated key pair must validate against Google's [S/MIME
|
---|
| 113 | * certificate profiles](https://support.google.com/a/answer/7300887).
|
---|
| 114 | * (identities.patch)
|
---|
| 115 | *
|
---|
| 116 | * @param string $userId The requester's primary email address. To indicate the
|
---|
| 117 | * authenticated user, you can use the special value `me`.
|
---|
| 118 | * @param string $emailAddress The email address of the client-side encryption
|
---|
| 119 | * identity to update.
|
---|
| 120 | * @param CseIdentity $postBody
|
---|
| 121 | * @param array $optParams Optional parameters.
|
---|
| 122 | * @return CseIdentity
|
---|
| 123 | * @throws \Google\Service\Exception
|
---|
| 124 | */
|
---|
| 125 | public function patch($userId, $emailAddress, CseIdentity $postBody, $optParams = [])
|
---|
| 126 | {
|
---|
| 127 | $params = ['userId' => $userId, 'emailAddress' => $emailAddress, 'postBody' => $postBody];
|
---|
| 128 | $params = array_merge($params, $optParams);
|
---|
| 129 | return $this->call('patch', [$params], CseIdentity::class);
|
---|
| 130 | }
|
---|
| 131 | }
|
---|
| 132 |
|
---|
| 133 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 134 | class_alias(UsersSettingsCseIdentities::class, 'Google_Service_Gmail_Resource_UsersSettingsCseIdentities');
|
---|