from typing import Any
from thrift.Thrift import TException

class TTransportException(TException):
    UNKNOWN = ...  # type: Any
    NOT_OPEN = ...  # type: Any
    ALREADY_OPEN = ...  # type: Any
    TIMED_OUT = ...  # type: Any
    END_OF_FILE = ...  # type: Any
    type = ...  # type: Any
    def __init__(self, type=..., message=...) -> None: ...

class TTransportBase:
    def isOpen(self): ...
    def open(self): ...
    def close(self): ...
    def read(self, sz): ...
    def readAll(self, sz): ...
    def write(self, buf): ...
    def flush(self): ...

class CReadableTransport:
    @property
    def cstringio_buf(self): ...
    def cstringio_refill(self, partialread, reqlen): ...

class TServerTransportBase:
    def listen(self): ...
    def accept(self): ...
    def close(self): ...

class TTransportFactoryBase:
    def getTransport(self, trans): ...

class TBufferedTransportFactory:
    def getTransport(self, trans): ...

class TBufferedTransport(TTransportBase, CReadableTransport):
    DEFAULT_BUFFER = ...  # type: Any
    def __init__(self, trans, rbuf_size=...) -> None: ...
    def isOpen(self): ...
    def open(self): ...
    def close(self): ...
    def read(self, sz): ...
    def write(self, buf): ...
    def flush(self): ...
    @property
    def cstringio_buf(self): ...
    def cstringio_refill(self, partialread, reqlen): ...

class TMemoryBuffer(TTransportBase, CReadableTransport):
    def __init__(self, value=...) -> None: ...
    def isOpen(self): ...
    def open(self): ...
    def close(self): ...
    def read(self, sz): ...
    def write(self, buf): ...
    def flush(self): ...
    def getvalue(self): ...
    @property
    def cstringio_buf(self): ...
    def cstringio_refill(self, partialread, reqlen): ...

class TFramedTransportFactory:
    def getTransport(self, trans): ...

class TFramedTransport(TTransportBase, CReadableTransport):
    def __init__(self, trans) -> None: ...
    def isOpen(self): ...
    def open(self): ...
    def close(self): ...
    def read(self, sz): ...
    def readFrame(self): ...
    def write(self, buf): ...
    def flush(self): ...
    @property
    def cstringio_buf(self): ...
    def cstringio_refill(self, prefix, reqlen): ...

class TFileObjectTransport(TTransportBase):
    fileobj = ...  # type: Any
    def __init__(self, fileobj) -> None: ...
    def isOpen(self): ...
    def close(self): ...
    def read(self, sz): ...
    def write(self, buf): ...
    def flush(self): ...

class TSaslClientTransport(TTransportBase, CReadableTransport):
    START = ...  # type: Any
    OK = ...  # type: Any
    BAD = ...  # type: Any
    ERROR = ...  # type: Any
    COMPLETE = ...  # type: Any
    transport = ...  # type: Any
    sasl = ...  # type: Any
    def __init__(self, transport, host, service, mechanism=..., **sasl_kwargs) -> None: ...
    def open(self): ...
    def send_sasl_msg(self, status, body): ...
    def recv_sasl_msg(self): ...
    def write(self, data): ...
    def flush(self): ...
    def read(self, sz): ...
    def close(self): ...
    @property
    def cstringio_buf(self): ...
    def cstringio_refill(self, prefix, reqlen): ...
