* $gmailService = new Google\Service\Gmail(...); * $keypairs = $gmailService->users_settings_cse_keypairs; * */ class UsersSettingsCseKeypairs extends \Google\Service\Resource { /** * Creates and uploads a client-side encryption S/MIME public key certificate * chain and private key metadata for the authenticated user. (keypairs.create) * * @param string $userId The requester's primary email address. To indicate the * authenticated user, you can use the special value `me`. * @param CseKeyPair $postBody * @param array $optParams Optional parameters. * @return CseKeyPair * @throws \Google\Service\Exception */ public function create($userId, CseKeyPair $postBody, $optParams = []) { $params = ['userId' => $userId, 'postBody' => $postBody]; $params = array_merge($params, $optParams); return $this->call('create', [$params], CseKeyPair::class); } /** * Turns off a client-side encryption key pair. The authenticated user can no * longer use the key pair to decrypt incoming CSE message texts or sign * outgoing CSE mail. To regain access, use the EnableCseKeyPair to turn on the * key pair. After 30 days, you can permanently delete the key pair by using the * ObliterateCseKeyPair method. (keypairs.disable) * * @param string $userId The requester's primary email address. To indicate the * authenticated user, you can use the special value `me`. * @param string $keyPairId The identifier of the key pair to turn off. * @param DisableCseKeyPairRequest $postBody * @param array $optParams Optional parameters. * @return CseKeyPair * @throws \Google\Service\Exception */ public function disable($userId, $keyPairId, DisableCseKeyPairRequest $postBody, $optParams = []) { $params = ['userId' => $userId, 'keyPairId' => $keyPairId, 'postBody' => $postBody]; $params = array_merge($params, $optParams); return $this->call('disable', [$params], CseKeyPair::class); } /** * Turns on a client-side encryption key pair that was turned off. The key pair * becomes active again for any associated client-side encryption identities. * (keypairs.enable) * * @param string $userId The requester's primary email address. To indicate the * authenticated user, you can use the special value `me`. * @param string $keyPairId The identifier of the key pair to turn on. * @param EnableCseKeyPairRequest $postBody * @param array $optParams Optional parameters. * @return CseKeyPair * @throws \Google\Service\Exception */ public function enable($userId, $keyPairId, EnableCseKeyPairRequest $postBody, $optParams = []) { $params = ['userId' => $userId, 'keyPairId' => $keyPairId, 'postBody' => $postBody]; $params = array_merge($params, $optParams); return $this->call('enable', [$params], CseKeyPair::class); } /** * Retrieves an existing client-side encryption key pair. (keypairs.get) * * @param string $userId The requester's primary email address. To indicate the * authenticated user, you can use the special value `me`. * @param string $keyPairId The identifier of the key pair to retrieve. * @param array $optParams Optional parameters. * @return CseKeyPair * @throws \Google\Service\Exception */ public function get($userId, $keyPairId, $optParams = []) { $params = ['userId' => $userId, 'keyPairId' => $keyPairId]; $params = array_merge($params, $optParams); return $this->call('get', [$params], CseKeyPair::class); } /** * Lists client-side encryption key pairs for an authenticated user. * (keypairs.listUsersSettingsCseKeypairs) * * @param string $userId The requester's primary email address. To indicate the * authenticated user, you can use the special value `me`. * @param array $optParams Optional parameters. * * @opt_param int pageSize The number of key pairs to return. If not provided, * the page size will default to 20 entries. * @opt_param string pageToken Pagination token indicating which page of key * pairs to return. If the token is not supplied, then the API will return the * first page of results. * @return ListCseKeyPairsResponse * @throws \Google\Service\Exception */ public function listUsersSettingsCseKeypairs($userId, $optParams = []) { $params = ['userId' => $userId]; $params = array_merge($params, $optParams); return $this->call('list', [$params], ListCseKeyPairsResponse::class); } /** * Deletes a client-side encryption key pair permanently and immediately. You * can only permanently delete key pairs that have been turned off for more than * 30 days. To turn off a key pair, use the DisableCseKeyPair method. Gmail * can't restore or decrypt any messages that were encrypted by an obliterated * key. Authenticated users and Google Workspace administrators lose access to * reading the encrypted messages. (keypairs.obliterate) * * @param string $userId The requester's primary email address. To indicate the * authenticated user, you can use the special value `me`. * @param string $keyPairId The identifier of the key pair to obliterate. * @param ObliterateCseKeyPairRequest $postBody * @param array $optParams Optional parameters. * @throws \Google\Service\Exception */ public function obliterate($userId, $keyPairId, ObliterateCseKeyPairRequest $postBody, $optParams = []) { $params = ['userId' => $userId, 'keyPairId' => $keyPairId, 'postBody' => $postBody]; $params = array_merge($params, $optParams); return $this->call('obliterate', [$params]); } } // Adding a class alias for backwards compatibility with the previous class name. class_alias(UsersSettingsCseKeypairs::class, 'Google_Service_Gmail_Resource_UsersSettingsCseKeypairs');