from typing import Any, List, Mapping, Optional

from bson.binary import Binary
from bson.codec_options import CodecOptions
from pymongo.mongo_client import MongoClient

class Algorithm:
    AEAD_AES_256_CBC_HMAC_SHA_512_Deterministic: str = ...
    AEAD_AES_256_CBC_HMAC_SHA_512_Random: str = ...

class ClientEncryption:
    def __init__(
        self,
        kms_providers: Mapping[str, Any],
        key_vault_namespace: str,
        key_vault_client: MongoClient,
        codec_options: CodecOptions,
    ) -> None: ...
    def create_data_key(
        self, kms_provider: str, master_key: Optional[Mapping[str, Any]] = ..., key_alt_names: Optional[List[str]] = ...
    ) -> Binary: ...
    def encrypt(
        self, value: Any, algorithm: str, key_id: Optional[Binary] = ..., key_alt_name: Optional[str] = ...
    ) -> Binary: ...
    def decrypt(self, value: Binary) -> Any: ...
    def __enter__(self) -> ClientEncryption: ...
    def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None: ...
    def close(self) -> None: ...
