from typing import Any, Dict, Optional, Union

from pymongo.collation import Collation
from pymongo.collection import Collection
from pymongo.write_concern import WriteConcern

class BulkUpsertOperation:
    def __init__(self, selector: Dict[str, Any], bulk: Any, collation: Collation) -> None: ...
    def update_one(self, update: Dict[str, Any]) -> None: ...
    def update(self, update: Dict[str, Any]) -> None: ...
    def replace_one(self, replacement: Dict[str, Any]) -> None: ...

class BulkWriteOperation:
    def __init__(self, selector: Dict[str, Any], bulk: Any, collation: Collation) -> None: ...
    def update_one(self, update: Dict[str, Any]) -> None: ...
    def update(self, update: Dict[str, Any]) -> None: ...
    def replace_one(self, replacement: Dict[str, Any]) -> None: ...
    def remove_one(self) -> None: ...
    def remove(self) -> None: ...
    def upsert(self) -> BulkUpsertOperation: ...

class BulkOperationBuilder:
    def __init__(self, collection: Collection, ordered: bool = ..., bypass_document_validation: bool = ...) -> None: ...
    def find(self, selector: Dict[str, Any], collation: Optional[Collation] = ...) -> BulkWriteOperation: ...
    def insert(self, document: Dict[str, Any]) -> None: ...
    def execute(self, write_concern: Optional[WriteConcern] = ...) -> Union[Dict[str, Any], None]: ...
