from typing import Any
from typing import Protocol

from libcanonical.protocols import ITransaction
from .idatastoreentity import IDatastoreEntity


class IDatastoreTransaction(ITransaction, Protocol):
    __module__: str = 'canonical.ext.google.protocols'

    def begin(self) -> None: ...
    def commit(self) -> None: ...
    def put(self, entity: IDatastoreEntity) -> None: ...
    def rollback(self) -> None: ...
    def __enter__(self): ...
    def __exit__(self, *args: Any): ...