from typing import Callable, ClassVar, overload

class InitFromTag:
    __members__: ClassVar[dict] = ...  # read-only
    __entries: ClassVar[dict] = ...
    capsule: ClassVar[InitFromTag] = ...
    capsule_direct_only: ClassVar[InitFromTag] = ...
    serialized: ClassVar[InitFromTag] = ...
    def __init__(self, value: int) -> None: ...
    def __eq__(self, other: object) -> bool: ...
    def __hash__(self) -> int: ...
    def __index__(self) -> int: ...
    def __int__(self) -> int: ...
    def __ne__(self, other: object) -> bool: ...
    @property
    def name(self) -> str: ...
    @property
    def value(self) -> int: ...

class Status:
    @overload
    def __init__(self) -> None: ...
    @overload
    def __init__(self) -> None: ...
    @overload
    def __init__(self, init_from_tag: InitFromTag, obj: object) -> None: ...
    @overload
    def __init__(self, code: StatusCode, msg: str) -> None: ...
    def AllPayloads(self) -> tuple: ...
    def ErasePayload(self, arg0: str) -> bool: ...
    def IgnoreError(self) -> None: ...
    @staticmethod
    def OkStatus() -> object: ...
    def SetPayload(self, arg0: str, arg1: str) -> None: ...
    def as_absl_Status(self) -> object: ...
    def code(self) -> StatusCode: ...
    def code_int(self) -> int: ...
    def message(self) -> str: ...
    def message_bytes(self) -> bytes: ...
    def ok(self) -> bool: ...
    def raw_code(self) -> int: ...
    def status_not_ok_str(self) -> str: ...
    def to_string(self, with_source_location: bool = ...) -> str: ...
    def update(self, other: None) -> None: ...
    def __eq__(self, arg0: object) -> bool: ...
    def __hash__(self) -> int: ...
    def __reduce_ex__(self, protocol: int = ...) -> tuple: ...

class StatusCode:
    __members__: ClassVar[dict] = ...  # read-only
    ABORTED: ClassVar[StatusCode] = ...
    ALREADY_EXISTS: ClassVar[StatusCode] = ...
    CANCELLED: ClassVar[StatusCode] = ...
    DATA_LOSS: ClassVar[StatusCode] = ...
    DEADLINE_EXCEEDED: ClassVar[StatusCode] = ...
    FAILED_PRECONDITION: ClassVar[StatusCode] = ...
    INTERNAL: ClassVar[StatusCode] = ...
    INVALID_ARGUMENT: ClassVar[StatusCode] = ...
    NOT_FOUND: ClassVar[StatusCode] = ...
    OK: ClassVar[StatusCode] = ...
    OUT_OF_RANGE: ClassVar[StatusCode] = ...
    PERMISSION_DENIED: ClassVar[StatusCode] = ...
    RESOURCE_EXHAUSTED: ClassVar[StatusCode] = ...
    UNAUTHENTICATED: ClassVar[StatusCode] = ...
    UNAVAILABLE: ClassVar[StatusCode] = ...
    UNIMPLEMENTED: ClassVar[StatusCode] = ...
    UNKNOWN: ClassVar[StatusCode] = ...
    __entries: ClassVar[dict] = ...
    def __init__(self, value: int) -> None: ...
    def __eq__(self, other: object) -> bool: ...
    def __hash__(self) -> int: ...
    def __index__(self) -> int: ...
    def __int__(self) -> int: ...
    def __ne__(self, other: object) -> bool: ...
    @property
    def name(self) -> str: ...
    @property
    def value(self) -> int: ...

class StatusNotOk(Exception):
    __init__: ClassVar[Callable] = ...
    __eq__: ClassVar[Callable] = ...
    __reduce_ex__: ClassVar[Callable] = ...
    @property
    def code(self): ...
    @property
    def message(self): ...
    @property
    def status(self): ...

def BuildStatusNotOk(arg0: StatusCode, arg1: str) -> object: ...
def StatusCodeAsInt(code: StatusCode) -> int: ...
def StatusCodeFromInt(code_int: int) -> StatusCode: ...
def aborted_error(message: str) -> Status: ...
def already_exists_error(message: str) -> Status: ...
def cancelled_error(message: str) -> Status: ...
def data_loss_error(message: str) -> Status: ...
def deadline_exceeded_error(message: str) -> Status: ...
def failed_precondition_error(message: str) -> Status: ...
def internal_error(message: str) -> Status: ...
def invalid_argument_error(message: str) -> Status: ...
def is_ok(status_or: object) -> bool: ...
def not_found_error(message: str) -> Status: ...
def out_of_range_error(message: str) -> Status: ...
def permission_denied_error(message: str) -> Status: ...
def resource_exhausted_error(message: str) -> Status: ...
def unauthenticated_error(message: str) -> Status: ...
def unavailable_error(message: str) -> Status: ...
def unimplemented_error(message: str) -> Status: ...
def unknown_error(message: str) -> Status: ...
