#
# Autogenerated by Thrift Compiler (0.22.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
#  options string: py
#

from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
from thrift.protocol.TProtocol import TProtocolException
from thrift.TRecursive import fix_spec
from uuid import UUID

import sys

from thrift.transport import TTransport

all_structs = []


class ResponseStatus(object):
    RESPONSE_STATUS_UNSPECIFIED = 0
    RESPONSE_STATUS_SUCCESS = 1
    RESPONSE_STATUS_ERROR = 2
    RESPONSE_STATUS_PARTIAL = 3

    _VALUES_TO_NAMES = {
        0: "RESPONSE_STATUS_UNSPECIFIED",
        1: "RESPONSE_STATUS_SUCCESS",
        2: "RESPONSE_STATUS_ERROR",
        3: "RESPONSE_STATUS_PARTIAL",
    }

    _NAMES_TO_VALUES = {
        "RESPONSE_STATUS_UNSPECIFIED": 0,
        "RESPONSE_STATUS_SUCCESS": 1,
        "RESPONSE_STATUS_ERROR": 2,
        "RESPONSE_STATUS_PARTIAL": 3,
    }


class AuthScheme(object):
    AUTH_SCHEME_UNSPECIFIED = 0
    AUTH_SCHEME_BEARER = 1
    AUTH_SCHEME_API_KEY = 2
    AUTH_SCHEME_MTLS = 3

    _VALUES_TO_NAMES = {
        0: "AUTH_SCHEME_UNSPECIFIED",
        1: "AUTH_SCHEME_BEARER",
        2: "AUTH_SCHEME_API_KEY",
        3: "AUTH_SCHEME_MTLS",
    }

    _NAMES_TO_VALUES = {
        "AUTH_SCHEME_UNSPECIFIED": 0,
        "AUTH_SCHEME_BEARER": 1,
        "AUTH_SCHEME_API_KEY": 2,
        "AUTH_SCHEME_MTLS": 3,
    }


class Priority(object):
    PRIORITY_UNSPECIFIED = 0
    PRIORITY_LOW = 1
    PRIORITY_NORMAL = 2
    PRIORITY_HIGH = 3
    PRIORITY_CRITICAL = 4

    _VALUES_TO_NAMES = {
        0: "PRIORITY_UNSPECIFIED",
        1: "PRIORITY_LOW",
        2: "PRIORITY_NORMAL",
        3: "PRIORITY_HIGH",
        4: "PRIORITY_CRITICAL",
    }

    _NAMES_TO_VALUES = {
        "PRIORITY_UNSPECIFIED": 0,
        "PRIORITY_LOW": 1,
        "PRIORITY_NORMAL": 2,
        "PRIORITY_HIGH": 3,
        "PRIORITY_CRITICAL": 4,
    }


class HealthStatus(object):
    HEALTH_STATUS_UNSPECIFIED = 0
    HEALTH_STATUS_HEALTHY = 1
    HEALTH_STATUS_UNHEALTHY = 2
    HEALTH_STATUS_DEGRADED = 3
    HEALTH_STATUS_UNKNOWN = 4

    _VALUES_TO_NAMES = {
        0: "HEALTH_STATUS_UNSPECIFIED",
        1: "HEALTH_STATUS_HEALTHY",
        2: "HEALTH_STATUS_UNHEALTHY",
        3: "HEALTH_STATUS_DEGRADED",
        4: "HEALTH_STATUS_UNKNOWN",
    }

    _NAMES_TO_VALUES = {
        "HEALTH_STATUS_UNSPECIFIED": 0,
        "HEALTH_STATUS_HEALTHY": 1,
        "HEALTH_STATUS_UNHEALTHY": 2,
        "HEALTH_STATUS_DEGRADED": 3,
        "HEALTH_STATUS_UNKNOWN": 4,
    }


class TaskStatus(object):
    TASK_STATUS_UNSPECIFIED = 0
    TASK_STATUS_PENDING = 1
    TASK_STATUS_SCHEDULED = 2
    TASK_STATUS_RUNNING = 3
    TASK_STATUS_SUCCEEDED = 4
    TASK_STATUS_FAILED = 5
    TASK_STATUS_CANCELED = 6
    TASK_STATUS_RETRYING = 7

    _VALUES_TO_NAMES = {
        0: "TASK_STATUS_UNSPECIFIED",
        1: "TASK_STATUS_PENDING",
        2: "TASK_STATUS_SCHEDULED",
        3: "TASK_STATUS_RUNNING",
        4: "TASK_STATUS_SUCCEEDED",
        5: "TASK_STATUS_FAILED",
        6: "TASK_STATUS_CANCELED",
        7: "TASK_STATUS_RETRYING",
    }

    _NAMES_TO_VALUES = {
        "TASK_STATUS_UNSPECIFIED": 0,
        "TASK_STATUS_PENDING": 1,
        "TASK_STATUS_SCHEDULED": 2,
        "TASK_STATUS_RUNNING": 3,
        "TASK_STATUS_SUCCEEDED": 4,
        "TASK_STATUS_FAILED": 5,
        "TASK_STATUS_CANCELED": 6,
        "TASK_STATUS_RETRYING": 7,
    }


class TraceContext(object):
    """
    Attributes:
     - trace_id
     - span_id
     - parent_span_id
     - sampled
     - baggage

    """

    thrift_spec = None

    def __init__(
        self,
        trace_id=None,
        span_id=None,
        parent_span_id=None,
        sampled=None,
        baggage=None,
    ):
        self.trace_id = trace_id
        self.span_id = span_id
        self.parent_span_id = parent_span_id
        self.sampled = sampled
        self.baggage = baggage

    def read(self, iprot):
        if (
            iprot._fast_decode is not None
            and isinstance(iprot.trans, TTransport.CReadableTransport)
            and self.thrift_spec is not None
        ):
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.trace_id = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.span_id = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.parent_span_id = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.BOOL:
                    self.sampled = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.MAP:
                    self.baggage = {}
                    (_ktype1, _vtype2, _size0) = iprot.readMapBegin()
                    for _i4 in range(_size0):
                        _key5 = (
                            iprot.readString().decode("utf-8", errors="replace")
                            if sys.version_info[0] == 2
                            else iprot.readString()
                        )
                        _val6 = (
                            iprot.readString().decode("utf-8", errors="replace")
                            if sys.version_info[0] == 2
                            else iprot.readString()
                        )
                        self.baggage[_key5] = _val6
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        self.validate()
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin("TraceContext")
        if self.trace_id is not None:
            oprot.writeFieldBegin("trace_id", TType.STRING, 1)
            oprot.writeString(self.trace_id.encode("utf-8") if sys.version_info[0] == 2 else self.trace_id)
            oprot.writeFieldEnd()
        if self.span_id is not None:
            oprot.writeFieldBegin("span_id", TType.STRING, 2)
            oprot.writeString(self.span_id.encode("utf-8") if sys.version_info[0] == 2 else self.span_id)
            oprot.writeFieldEnd()
        if self.parent_span_id is not None:
            oprot.writeFieldBegin("parent_span_id", TType.STRING, 3)
            oprot.writeString(self.parent_span_id.encode("utf-8") if sys.version_info[0] == 2 else self.parent_span_id)
            oprot.writeFieldEnd()
        if self.sampled is not None:
            oprot.writeFieldBegin("sampled", TType.BOOL, 4)
            oprot.writeBool(self.sampled)
            oprot.writeFieldEnd()
        if self.baggage is not None:
            oprot.writeFieldBegin("baggage", TType.MAP, 5)
            oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.baggage))
            for kiter7, viter8 in self.baggage.items():
                oprot.writeString(kiter7.encode("utf-8") if sys.version_info[0] == 2 else kiter7)
                oprot.writeString(viter8.encode("utf-8") if sys.version_info[0] == 2 else viter8)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()]
        return "%s(%s)" % (self.__class__.__name__, ", ".join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class ErrorDetail(object):
    """
    Attributes:
     - type
     - field
     - reason
     - metadata

    """

    thrift_spec = None

    def __init__(
        self,
        type=None,
        field=None,
        reason=None,
        metadata=None,
    ):
        self.type = type
        self.field = field
        self.reason = reason
        self.metadata = metadata

    def read(self, iprot):
        if (
            iprot._fast_decode is not None
            and isinstance(iprot.trans, TTransport.CReadableTransport)
            and self.thrift_spec is not None
        ):
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.type = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.field = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.reason = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.MAP:
                    self.metadata = {}
                    (_ktype10, _vtype11, _size9) = iprot.readMapBegin()
                    for _i13 in range(_size9):
                        _key14 = (
                            iprot.readString().decode("utf-8", errors="replace")
                            if sys.version_info[0] == 2
                            else iprot.readString()
                        )
                        _val15 = (
                            iprot.readString().decode("utf-8", errors="replace")
                            if sys.version_info[0] == 2
                            else iprot.readString()
                        )
                        self.metadata[_key14] = _val15
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        self.validate()
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin("ErrorDetail")
        if self.type is not None:
            oprot.writeFieldBegin("type", TType.STRING, 1)
            oprot.writeString(self.type.encode("utf-8") if sys.version_info[0] == 2 else self.type)
            oprot.writeFieldEnd()
        if self.field is not None:
            oprot.writeFieldBegin("field", TType.STRING, 2)
            oprot.writeString(self.field.encode("utf-8") if sys.version_info[0] == 2 else self.field)
            oprot.writeFieldEnd()
        if self.reason is not None:
            oprot.writeFieldBegin("reason", TType.STRING, 3)
            oprot.writeString(self.reason.encode("utf-8") if sys.version_info[0] == 2 else self.reason)
            oprot.writeFieldEnd()
        if self.metadata is not None:
            oprot.writeFieldBegin("metadata", TType.MAP, 4)
            oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.metadata))
            for kiter16, viter17 in self.metadata.items():
                oprot.writeString(kiter16.encode("utf-8") if sys.version_info[0] == 2 else kiter16)
                oprot.writeString(viter17.encode("utf-8") if sys.version_info[0] == 2 else viter17)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()]
        return "%s(%s)" % (self.__class__.__name__, ", ".join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class DebugInfo(object):
    """
    Attributes:
     - stack_trace
     - internal_message
     - timestamp_ms

    """

    thrift_spec = None

    def __init__(
        self,
        stack_trace=None,
        internal_message=None,
        timestamp_ms=None,
    ):
        self.stack_trace = stack_trace
        self.internal_message = internal_message
        self.timestamp_ms = timestamp_ms

    def read(self, iprot):
        if (
            iprot._fast_decode is not None
            and isinstance(iprot.trans, TTransport.CReadableTransport)
            and self.thrift_spec is not None
        ):
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.stack_trace = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.internal_message = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I64:
                    self.timestamp_ms = iprot.readI64()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        self.validate()
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin("DebugInfo")
        if self.stack_trace is not None:
            oprot.writeFieldBegin("stack_trace", TType.STRING, 1)
            oprot.writeString(self.stack_trace.encode("utf-8") if sys.version_info[0] == 2 else self.stack_trace)
            oprot.writeFieldEnd()
        if self.internal_message is not None:
            oprot.writeFieldBegin("internal_message", TType.STRING, 2)
            oprot.writeString(
                self.internal_message.encode("utf-8") if sys.version_info[0] == 2 else self.internal_message
            )
            oprot.writeFieldEnd()
        if self.timestamp_ms is not None:
            oprot.writeFieldBegin("timestamp_ms", TType.I64, 3)
            oprot.writeI64(self.timestamp_ms)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()]
        return "%s(%s)" % (self.__class__.__name__, ", ".join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class RpcError(object):
    """
    Attributes:
     - code
     - name
     - message
     - details
     - debug

    """

    thrift_spec = None

    def __init__(
        self,
        code=None,
        name=None,
        message=None,
        details=None,
        debug=None,
    ):
        self.code = code
        self.name = name
        self.message = message
        self.details = details
        self.debug = debug

    def read(self, iprot):
        if (
            iprot._fast_decode is not None
            and isinstance(iprot.trans, TTransport.CReadableTransport)
            and self.thrift_spec is not None
        ):
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I32:
                    self.code = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.name = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.message = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.LIST:
                    self.details = []
                    (_etype21, _size18) = iprot.readListBegin()
                    for _i22 in range(_size18):
                        _elem23 = ErrorDetail()
                        _elem23.read(iprot)
                        self.details.append(_elem23)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRUCT:
                    self.debug = DebugInfo()
                    self.debug.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        self.validate()
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin("RpcError")
        if self.code is not None:
            oprot.writeFieldBegin("code", TType.I32, 1)
            oprot.writeI32(self.code)
            oprot.writeFieldEnd()
        if self.name is not None:
            oprot.writeFieldBegin("name", TType.STRING, 2)
            oprot.writeString(self.name.encode("utf-8") if sys.version_info[0] == 2 else self.name)
            oprot.writeFieldEnd()
        if self.message is not None:
            oprot.writeFieldBegin("message", TType.STRING, 3)
            oprot.writeString(self.message.encode("utf-8") if sys.version_info[0] == 2 else self.message)
            oprot.writeFieldEnd()
        if self.details is not None:
            oprot.writeFieldBegin("details", TType.LIST, 4)
            oprot.writeListBegin(TType.STRUCT, len(self.details))
            for iter24 in self.details:
                iter24.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.debug is not None:
            oprot.writeFieldBegin("debug", TType.STRUCT, 5)
            self.debug.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()]
        return "%s(%s)" % (self.__class__.__name__, ", ".join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class AuthContext(object):
    """
    Attributes:
     - scheme
     - credentials
     - principal
     - roles

    """

    thrift_spec = None

    def __init__(
        self,
        scheme=None,
        credentials=None,
        principal=None,
        roles=None,
    ):
        self.scheme = scheme
        self.credentials = credentials
        self.principal = principal
        self.roles = roles

    def read(self, iprot):
        if (
            iprot._fast_decode is not None
            and isinstance(iprot.trans, TTransport.CReadableTransport)
            and self.thrift_spec is not None
        ):
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I32:
                    self.scheme = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.credentials = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.principal = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.LIST:
                    self.roles = []
                    (_etype28, _size25) = iprot.readListBegin()
                    for _i29 in range(_size25):
                        _elem30 = (
                            iprot.readString().decode("utf-8", errors="replace")
                            if sys.version_info[0] == 2
                            else iprot.readString()
                        )
                        self.roles.append(_elem30)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        self.validate()
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin("AuthContext")
        if self.scheme is not None:
            oprot.writeFieldBegin("scheme", TType.I32, 1)
            oprot.writeI32(self.scheme)
            oprot.writeFieldEnd()
        if self.credentials is not None:
            oprot.writeFieldBegin("credentials", TType.STRING, 2)
            oprot.writeString(self.credentials.encode("utf-8") if sys.version_info[0] == 2 else self.credentials)
            oprot.writeFieldEnd()
        if self.principal is not None:
            oprot.writeFieldBegin("principal", TType.STRING, 3)
            oprot.writeString(self.principal.encode("utf-8") if sys.version_info[0] == 2 else self.principal)
            oprot.writeFieldEnd()
        if self.roles is not None:
            oprot.writeFieldBegin("roles", TType.LIST, 4)
            oprot.writeListBegin(TType.STRING, len(self.roles))
            for iter31 in self.roles:
                oprot.writeString(iter31.encode("utf-8") if sys.version_info[0] == 2 else iter31)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()]
        return "%s(%s)" % (self.__class__.__name__, ", ".join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class RequestMetadata(object):
    """
    Attributes:
     - timestamp_ms
     - client_id
     - client_version
     - auth
     - tenant_id
     - headers
     - long_task
     - long_task_method
     - long_task_timeout

    """

    thrift_spec = None

    def __init__(
        self,
        timestamp_ms=None,
        client_id=None,
        client_version=None,
        auth=None,
        tenant_id=None,
        headers=None,
        long_task=None,
        long_task_method=None,
        long_task_timeout=None,
    ):
        self.timestamp_ms = timestamp_ms
        self.client_id = client_id
        self.client_version = client_version
        self.auth = auth
        self.tenant_id = tenant_id
        self.headers = headers
        self.long_task = long_task
        self.long_task_method = long_task_method
        self.long_task_timeout = long_task_timeout

    def read(self, iprot):
        if (
            iprot._fast_decode is not None
            and isinstance(iprot.trans, TTransport.CReadableTransport)
            and self.thrift_spec is not None
        ):
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.timestamp_ms = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.client_id = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.client_version = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRUCT:
                    self.auth = AuthContext()
                    self.auth.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRING:
                    self.tenant_id = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 9:
                if ftype == TType.MAP:
                    self.headers = {}
                    (_ktype33, _vtype34, _size32) = iprot.readMapBegin()
                    for _i36 in range(_size32):
                        _key37 = (
                            iprot.readString().decode("utf-8", errors="replace")
                            if sys.version_info[0] == 2
                            else iprot.readString()
                        )
                        _val38 = (
                            iprot.readString().decode("utf-8", errors="replace")
                            if sys.version_info[0] == 2
                            else iprot.readString()
                        )
                        self.headers[_key37] = _val38
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 10:
                if ftype == TType.BOOL:
                    self.long_task = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 11:
                if ftype == TType.STRING:
                    self.long_task_method = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 12:
                if ftype == TType.I32:
                    self.long_task_timeout = iprot.readI32()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        self.validate()
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin("RequestMetadata")
        if self.timestamp_ms is not None:
            oprot.writeFieldBegin("timestamp_ms", TType.I64, 1)
            oprot.writeI64(self.timestamp_ms)
            oprot.writeFieldEnd()
        if self.client_id is not None:
            oprot.writeFieldBegin("client_id", TType.STRING, 2)
            oprot.writeString(self.client_id.encode("utf-8") if sys.version_info[0] == 2 else self.client_id)
            oprot.writeFieldEnd()
        if self.client_version is not None:
            oprot.writeFieldBegin("client_version", TType.STRING, 3)
            oprot.writeString(self.client_version.encode("utf-8") if sys.version_info[0] == 2 else self.client_version)
            oprot.writeFieldEnd()
        if self.auth is not None:
            oprot.writeFieldBegin("auth", TType.STRUCT, 4)
            self.auth.write(oprot)
            oprot.writeFieldEnd()
        if self.tenant_id is not None:
            oprot.writeFieldBegin("tenant_id", TType.STRING, 5)
            oprot.writeString(self.tenant_id.encode("utf-8") if sys.version_info[0] == 2 else self.tenant_id)
            oprot.writeFieldEnd()
        if self.headers is not None:
            oprot.writeFieldBegin("headers", TType.MAP, 9)
            oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.headers))
            for kiter39, viter40 in self.headers.items():
                oprot.writeString(kiter39.encode("utf-8") if sys.version_info[0] == 2 else kiter39)
                oprot.writeString(viter40.encode("utf-8") if sys.version_info[0] == 2 else viter40)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        if self.long_task is not None:
            oprot.writeFieldBegin("long_task", TType.BOOL, 10)
            oprot.writeBool(self.long_task)
            oprot.writeFieldEnd()
        if self.long_task_method is not None:
            oprot.writeFieldBegin("long_task_method", TType.STRING, 11)
            oprot.writeString(
                self.long_task_method.encode("utf-8") if sys.version_info[0] == 2 else self.long_task_method
            )
            oprot.writeFieldEnd()
        if self.long_task_timeout is not None:
            oprot.writeFieldBegin("long_task_timeout", TType.I32, 12)
            oprot.writeI32(self.long_task_timeout)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()]
        return "%s(%s)" % (self.__class__.__name__, ", ".join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class ResponseMetadata(object):
    """
    Attributes:
     - timestamp_ms
     - duration_ms
     - server_id
     - server_version

    """

    thrift_spec = None

    def __init__(
        self,
        timestamp_ms=None,
        duration_ms=None,
        server_id=None,
        server_version=None,
    ):
        self.timestamp_ms = timestamp_ms
        self.duration_ms = duration_ms
        self.server_id = server_id
        self.server_version = server_version

    def read(self, iprot):
        if (
            iprot._fast_decode is not None
            and isinstance(iprot.trans, TTransport.CReadableTransport)
            and self.thrift_spec is not None
        ):
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.timestamp_ms = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I64:
                    self.duration_ms = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.server_id = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRING:
                    self.server_version = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        self.validate()
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin("ResponseMetadata")
        if self.timestamp_ms is not None:
            oprot.writeFieldBegin("timestamp_ms", TType.I64, 1)
            oprot.writeI64(self.timestamp_ms)
            oprot.writeFieldEnd()
        if self.duration_ms is not None:
            oprot.writeFieldBegin("duration_ms", TType.I64, 2)
            oprot.writeI64(self.duration_ms)
            oprot.writeFieldEnd()
        if self.server_id is not None:
            oprot.writeFieldBegin("server_id", TType.STRING, 3)
            oprot.writeString(self.server_id.encode("utf-8") if sys.version_info[0] == 2 else self.server_id)
            oprot.writeFieldEnd()
        if self.server_version is not None:
            oprot.writeFieldBegin("server_version", TType.STRING, 4)
            oprot.writeString(self.server_version.encode("utf-8") if sys.version_info[0] == 2 else self.server_version)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()]
        return "%s(%s)" % (self.__class__.__name__, ", ".join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class RetryConfig(object):
    """
    Attributes:
     - max_attempts
     - initial_delay_ms
     - max_delay_ms
     - backoff_multiplier
     - retryable_codes

    """

    thrift_spec = None

    def __init__(
        self,
        max_attempts=None,
        initial_delay_ms=None,
        max_delay_ms=None,
        backoff_multiplier=None,
        retryable_codes=None,
    ):
        self.max_attempts = max_attempts
        self.initial_delay_ms = initial_delay_ms
        self.max_delay_ms = max_delay_ms
        self.backoff_multiplier = backoff_multiplier
        self.retryable_codes = retryable_codes

    def read(self, iprot):
        if (
            iprot._fast_decode is not None
            and isinstance(iprot.trans, TTransport.CReadableTransport)
            and self.thrift_spec is not None
        ):
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I32:
                    self.max_attempts = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I64:
                    self.initial_delay_ms = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I64:
                    self.max_delay_ms = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.DOUBLE:
                    self.backoff_multiplier = iprot.readDouble()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.LIST:
                    self.retryable_codes = []
                    (_etype44, _size41) = iprot.readListBegin()
                    for _i45 in range(_size41):
                        _elem46 = iprot.readI32()
                        self.retryable_codes.append(_elem46)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        self.validate()
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin("RetryConfig")
        if self.max_attempts is not None:
            oprot.writeFieldBegin("max_attempts", TType.I32, 1)
            oprot.writeI32(self.max_attempts)
            oprot.writeFieldEnd()
        if self.initial_delay_ms is not None:
            oprot.writeFieldBegin("initial_delay_ms", TType.I64, 2)
            oprot.writeI64(self.initial_delay_ms)
            oprot.writeFieldEnd()
        if self.max_delay_ms is not None:
            oprot.writeFieldBegin("max_delay_ms", TType.I64, 3)
            oprot.writeI64(self.max_delay_ms)
            oprot.writeFieldEnd()
        if self.backoff_multiplier is not None:
            oprot.writeFieldBegin("backoff_multiplier", TType.DOUBLE, 4)
            oprot.writeDouble(self.backoff_multiplier)
            oprot.writeFieldEnd()
        if self.retryable_codes is not None:
            oprot.writeFieldBegin("retryable_codes", TType.LIST, 5)
            oprot.writeListBegin(TType.I32, len(self.retryable_codes))
            for iter47 in self.retryable_codes:
                oprot.writeI32(iter47)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()]
        return "%s(%s)" % (self.__class__.__name__, ", ".join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class QosConfig(object):
    """
    Attributes:
     - priority
     - timeout_ms
     - retry_config
     - idempotency_key

    """

    thrift_spec = None

    def __init__(
        self,
        priority=None,
        timeout_ms=None,
        retry_config=None,
        idempotency_key=None,
    ):
        self.priority = priority
        self.timeout_ms = timeout_ms
        self.retry_config = retry_config
        self.idempotency_key = idempotency_key

    def read(self, iprot):
        if (
            iprot._fast_decode is not None
            and isinstance(iprot.trans, TTransport.CReadableTransport)
            and self.thrift_spec is not None
        ):
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I32:
                    self.priority = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I64:
                    self.timeout_ms = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRUCT:
                    self.retry_config = RetryConfig()
                    self.retry_config.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRING:
                    self.idempotency_key = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        self.validate()
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin("QosConfig")
        if self.priority is not None:
            oprot.writeFieldBegin("priority", TType.I32, 1)
            oprot.writeI32(self.priority)
            oprot.writeFieldEnd()
        if self.timeout_ms is not None:
            oprot.writeFieldBegin("timeout_ms", TType.I64, 2)
            oprot.writeI64(self.timeout_ms)
            oprot.writeFieldEnd()
        if self.retry_config is not None:
            oprot.writeFieldBegin("retry_config", TType.STRUCT, 3)
            self.retry_config.write(oprot)
            oprot.writeFieldEnd()
        if self.idempotency_key is not None:
            oprot.writeFieldBegin("idempotency_key", TType.STRING, 4)
            oprot.writeString(
                self.idempotency_key.encode("utf-8") if sys.version_info[0] == 2 else self.idempotency_key
            )
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()]
        return "%s(%s)" % (self.__class__.__name__, ", ".join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class Request(object):
    """
    Attributes:
     - aduib_rpc
     - id
     - method
     - name
     - data_json
     - trace_context
     - metadata
     - qos

    """

    thrift_spec = None

    def __init__(
        self,
        aduib_rpc=None,
        id=None,
        method=None,
        name=None,
        data_json=None,
        trace_context=None,
        metadata=None,
        qos=None,
    ):
        self.aduib_rpc = aduib_rpc
        self.id = id
        self.method = method
        self.name = name
        self.data_json = data_json
        self.trace_context = trace_context
        self.metadata = metadata
        self.qos = qos

    def read(self, iprot):
        if (
            iprot._fast_decode is not None
            and isinstance(iprot.trans, TTransport.CReadableTransport)
            and self.thrift_spec is not None
        ):
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.aduib_rpc = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.id = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.method = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRING:
                    self.name = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRING:
                    self.data_json = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.STRUCT:
                    self.trace_context = TraceContext()
                    self.trace_context.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 7:
                if ftype == TType.STRUCT:
                    self.metadata = RequestMetadata()
                    self.metadata.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 8:
                if ftype == TType.STRUCT:
                    self.qos = QosConfig()
                    self.qos.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        self.validate()
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin("Request")
        if self.aduib_rpc is not None:
            oprot.writeFieldBegin("aduib_rpc", TType.STRING, 1)
            oprot.writeString(self.aduib_rpc.encode("utf-8") if sys.version_info[0] == 2 else self.aduib_rpc)
            oprot.writeFieldEnd()
        if self.id is not None:
            oprot.writeFieldBegin("id", TType.STRING, 2)
            oprot.writeString(self.id.encode("utf-8") if sys.version_info[0] == 2 else self.id)
            oprot.writeFieldEnd()
        if self.method is not None:
            oprot.writeFieldBegin("method", TType.STRING, 3)
            oprot.writeString(self.method.encode("utf-8") if sys.version_info[0] == 2 else self.method)
            oprot.writeFieldEnd()
        if self.name is not None:
            oprot.writeFieldBegin("name", TType.STRING, 4)
            oprot.writeString(self.name.encode("utf-8") if sys.version_info[0] == 2 else self.name)
            oprot.writeFieldEnd()
        if self.data_json is not None:
            oprot.writeFieldBegin("data_json", TType.STRING, 5)
            oprot.writeString(self.data_json.encode("utf-8") if sys.version_info[0] == 2 else self.data_json)
            oprot.writeFieldEnd()
        if self.trace_context is not None:
            oprot.writeFieldBegin("trace_context", TType.STRUCT, 6)
            self.trace_context.write(oprot)
            oprot.writeFieldEnd()
        if self.metadata is not None:
            oprot.writeFieldBegin("metadata", TType.STRUCT, 7)
            self.metadata.write(oprot)
            oprot.writeFieldEnd()
        if self.qos is not None:
            oprot.writeFieldBegin("qos", TType.STRUCT, 8)
            self.qos.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()]
        return "%s(%s)" % (self.__class__.__name__, ", ".join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class ResponsePayload(object):
    """
    Attributes:
     - result_json
     - error

    """

    thrift_spec = None

    def __init__(
        self,
        result_json=None,
        error=None,
    ):
        self.result_json = result_json
        self.error = error

    def read(self, iprot):
        if (
            iprot._fast_decode is not None
            and isinstance(iprot.trans, TTransport.CReadableTransport)
            and self.thrift_spec is not None
        ):
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.result_json = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRUCT:
                    self.error = RpcError()
                    self.error.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        self.validate()
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin("ResponsePayload")
        if self.result_json is not None:
            oprot.writeFieldBegin("result_json", TType.STRING, 1)
            oprot.writeString(self.result_json.encode("utf-8") if sys.version_info[0] == 2 else self.result_json)
            oprot.writeFieldEnd()
        if self.error is not None:
            oprot.writeFieldBegin("error", TType.STRUCT, 2)
            self.error.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()]
        return "%s(%s)" % (self.__class__.__name__, ", ".join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class Response(object):
    """
    Attributes:
     - aduib_rpc
     - id
     - status
     - payload
     - trace_context
     - metadata

    """

    thrift_spec = None

    def __init__(
        self,
        aduib_rpc=None,
        id=None,
        status=None,
        payload=None,
        trace_context=None,
        metadata=None,
    ):
        self.aduib_rpc = aduib_rpc
        self.id = id
        self.status = status
        self.payload = payload
        self.trace_context = trace_context
        self.metadata = metadata

    def read(self, iprot):
        if (
            iprot._fast_decode is not None
            and isinstance(iprot.trans, TTransport.CReadableTransport)
            and self.thrift_spec is not None
        ):
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.aduib_rpc = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.id = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.status = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRUCT:
                    self.payload = ResponsePayload()
                    self.payload.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRUCT:
                    self.trace_context = TraceContext()
                    self.trace_context.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.STRUCT:
                    self.metadata = ResponseMetadata()
                    self.metadata.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        self.validate()
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin("Response")
        if self.aduib_rpc is not None:
            oprot.writeFieldBegin("aduib_rpc", TType.STRING, 1)
            oprot.writeString(self.aduib_rpc.encode("utf-8") if sys.version_info[0] == 2 else self.aduib_rpc)
            oprot.writeFieldEnd()
        if self.id is not None:
            oprot.writeFieldBegin("id", TType.STRING, 2)
            oprot.writeString(self.id.encode("utf-8") if sys.version_info[0] == 2 else self.id)
            oprot.writeFieldEnd()
        if self.status is not None:
            oprot.writeFieldBegin("status", TType.I32, 3)
            oprot.writeI32(self.status)
            oprot.writeFieldEnd()
        if self.payload is not None:
            oprot.writeFieldBegin("payload", TType.STRUCT, 4)
            self.payload.write(oprot)
            oprot.writeFieldEnd()
        if self.trace_context is not None:
            oprot.writeFieldBegin("trace_context", TType.STRUCT, 5)
            self.trace_context.write(oprot)
            oprot.writeFieldEnd()
        if self.metadata is not None:
            oprot.writeFieldBegin("metadata", TType.STRUCT, 6)
            self.metadata.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()]
        return "%s(%s)" % (self.__class__.__name__, ", ".join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class TaskRecord(object):
    """
    Attributes:
     - task_id
     - parent_task_id
     - status
     - priority
     - created_at_ms
     - scheduled_at_ms
     - started_at_ms
     - completed_at_ms
     - attempt
     - max_attempts
     - next_retry_at_ms
     - result
     - error
     - progress
     - metadata
     - tags

    """

    thrift_spec = None

    def __init__(
        self,
        task_id=None,
        parent_task_id=None,
        status=None,
        priority=None,
        created_at_ms=None,
        scheduled_at_ms=None,
        started_at_ms=None,
        completed_at_ms=None,
        attempt=None,
        max_attempts=None,
        next_retry_at_ms=None,
        result=None,
        error=None,
        progress=None,
        metadata=None,
        tags=None,
    ):
        self.task_id = task_id
        self.parent_task_id = parent_task_id
        self.status = status
        self.priority = priority
        self.created_at_ms = created_at_ms
        self.scheduled_at_ms = scheduled_at_ms
        self.started_at_ms = started_at_ms
        self.completed_at_ms = completed_at_ms
        self.attempt = attempt
        self.max_attempts = max_attempts
        self.next_retry_at_ms = next_retry_at_ms
        self.result = result
        self.error = error
        self.progress = progress
        self.metadata = metadata
        self.tags = tags

    def read(self, iprot):
        if (
            iprot._fast_decode is not None
            and isinstance(iprot.trans, TTransport.CReadableTransport)
            and self.thrift_spec is not None
        ):
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.task_id = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.parent_task_id = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.status = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I32:
                    self.priority = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.I64:
                    self.created_at_ms = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.I64:
                    self.scheduled_at_ms = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 7:
                if ftype == TType.I64:
                    self.started_at_ms = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 8:
                if ftype == TType.I64:
                    self.completed_at_ms = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 9:
                if ftype == TType.I32:
                    self.attempt = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 10:
                if ftype == TType.I32:
                    self.max_attempts = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 11:
                if ftype == TType.I64:
                    self.next_retry_at_ms = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 12:
                if ftype == TType.STRING:
                    self.result = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 13:
                if ftype == TType.STRUCT:
                    self.error = RpcError()
                    self.error.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 14:
                if ftype == TType.STRUCT:
                    self.progress = TaskProgress()
                    self.progress.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 15:
                if ftype == TType.MAP:
                    self.metadata = {}
                    (_ktype49, _vtype50, _size48) = iprot.readMapBegin()
                    for _i52 in range(_size48):
                        _key53 = (
                            iprot.readString().decode("utf-8", errors="replace")
                            if sys.version_info[0] == 2
                            else iprot.readString()
                        )
                        _val54 = (
                            iprot.readString().decode("utf-8", errors="replace")
                            if sys.version_info[0] == 2
                            else iprot.readString()
                        )
                        self.metadata[_key53] = _val54
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 16:
                if ftype == TType.LIST:
                    self.tags = []
                    (_etype58, _size55) = iprot.readListBegin()
                    for _i59 in range(_size55):
                        _elem60 = (
                            iprot.readString().decode("utf-8", errors="replace")
                            if sys.version_info[0] == 2
                            else iprot.readString()
                        )
                        self.tags.append(_elem60)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        self.validate()
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin("TaskRecord")
        if self.task_id is not None:
            oprot.writeFieldBegin("task_id", TType.STRING, 1)
            oprot.writeString(self.task_id.encode("utf-8") if sys.version_info[0] == 2 else self.task_id)
            oprot.writeFieldEnd()
        if self.parent_task_id is not None:
            oprot.writeFieldBegin("parent_task_id", TType.STRING, 2)
            oprot.writeString(self.parent_task_id.encode("utf-8") if sys.version_info[0] == 2 else self.parent_task_id)
            oprot.writeFieldEnd()
        if self.status is not None:
            oprot.writeFieldBegin("status", TType.I32, 3)
            oprot.writeI32(self.status)
            oprot.writeFieldEnd()
        if self.priority is not None:
            oprot.writeFieldBegin("priority", TType.I32, 4)
            oprot.writeI32(self.priority)
            oprot.writeFieldEnd()
        if self.created_at_ms is not None:
            oprot.writeFieldBegin("created_at_ms", TType.I64, 5)
            oprot.writeI64(self.created_at_ms)
            oprot.writeFieldEnd()
        if self.scheduled_at_ms is not None:
            oprot.writeFieldBegin("scheduled_at_ms", TType.I64, 6)
            oprot.writeI64(self.scheduled_at_ms)
            oprot.writeFieldEnd()
        if self.started_at_ms is not None:
            oprot.writeFieldBegin("started_at_ms", TType.I64, 7)
            oprot.writeI64(self.started_at_ms)
            oprot.writeFieldEnd()
        if self.completed_at_ms is not None:
            oprot.writeFieldBegin("completed_at_ms", TType.I64, 8)
            oprot.writeI64(self.completed_at_ms)
            oprot.writeFieldEnd()
        if self.attempt is not None:
            oprot.writeFieldBegin("attempt", TType.I32, 9)
            oprot.writeI32(self.attempt)
            oprot.writeFieldEnd()
        if self.max_attempts is not None:
            oprot.writeFieldBegin("max_attempts", TType.I32, 10)
            oprot.writeI32(self.max_attempts)
            oprot.writeFieldEnd()
        if self.next_retry_at_ms is not None:
            oprot.writeFieldBegin("next_retry_at_ms", TType.I64, 11)
            oprot.writeI64(self.next_retry_at_ms)
            oprot.writeFieldEnd()
        if self.result is not None:
            oprot.writeFieldBegin("result", TType.STRING, 12)
            oprot.writeString(self.result.encode("utf-8") if sys.version_info[0] == 2 else self.result)
            oprot.writeFieldEnd()
        if self.error is not None:
            oprot.writeFieldBegin("error", TType.STRUCT, 13)
            self.error.write(oprot)
            oprot.writeFieldEnd()
        if self.progress is not None:
            oprot.writeFieldBegin("progress", TType.STRUCT, 14)
            self.progress.write(oprot)
            oprot.writeFieldEnd()
        if self.metadata is not None:
            oprot.writeFieldBegin("metadata", TType.MAP, 15)
            oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.metadata))
            for kiter61, viter62 in self.metadata.items():
                oprot.writeString(kiter61.encode("utf-8") if sys.version_info[0] == 2 else kiter61)
                oprot.writeString(viter62.encode("utf-8") if sys.version_info[0] == 2 else viter62)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        if self.tags is not None:
            oprot.writeFieldBegin("tags", TType.LIST, 16)
            oprot.writeListBegin(TType.STRING, len(self.tags))
            for iter63 in self.tags:
                oprot.writeString(iter63.encode("utf-8") if sys.version_info[0] == 2 else iter63)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()]
        return "%s(%s)" % (self.__class__.__name__, ", ".join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class TaskProgress(object):
    """
    Attributes:
     - current
     - total
     - message
     - percentage

    """

    thrift_spec = None

    def __init__(
        self,
        current=None,
        total=None,
        message=None,
        percentage=None,
    ):
        self.current = current
        self.total = total
        self.message = message
        self.percentage = percentage

    def read(self, iprot):
        if (
            iprot._fast_decode is not None
            and isinstance(iprot.trans, TTransport.CReadableTransport)
            and self.thrift_spec is not None
        ):
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.current = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I64:
                    self.total = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.message = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.DOUBLE:
                    self.percentage = iprot.readDouble()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        self.validate()
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin("TaskProgress")
        if self.current is not None:
            oprot.writeFieldBegin("current", TType.I64, 1)
            oprot.writeI64(self.current)
            oprot.writeFieldEnd()
        if self.total is not None:
            oprot.writeFieldBegin("total", TType.I64, 2)
            oprot.writeI64(self.total)
            oprot.writeFieldEnd()
        if self.message is not None:
            oprot.writeFieldBegin("message", TType.STRING, 3)
            oprot.writeString(self.message.encode("utf-8") if sys.version_info[0] == 2 else self.message)
            oprot.writeFieldEnd()
        if self.percentage is not None:
            oprot.writeFieldBegin("percentage", TType.DOUBLE, 4)
            oprot.writeDouble(self.percentage)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()]
        return "%s(%s)" % (self.__class__.__name__, ", ".join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class TaskSubmitRequest(object):
    """
    Attributes:
     - target_method
     - params_json
     - priority

    """

    thrift_spec = None

    def __init__(
        self,
        target_method=None,
        params_json=None,
        priority=None,
    ):
        self.target_method = target_method
        self.params_json = params_json
        self.priority = priority

    def read(self, iprot):
        if (
            iprot._fast_decode is not None
            and isinstance(iprot.trans, TTransport.CReadableTransport)
            and self.thrift_spec is not None
        ):
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.target_method = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.params_json = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.priority = iprot.readI32()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        self.validate()
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin("TaskSubmitRequest")
        if self.target_method is not None:
            oprot.writeFieldBegin("target_method", TType.STRING, 1)
            oprot.writeString(self.target_method.encode("utf-8") if sys.version_info[0] == 2 else self.target_method)
            oprot.writeFieldEnd()
        if self.params_json is not None:
            oprot.writeFieldBegin("params_json", TType.STRING, 2)
            oprot.writeString(self.params_json.encode("utf-8") if sys.version_info[0] == 2 else self.params_json)
            oprot.writeFieldEnd()
        if self.priority is not None:
            oprot.writeFieldBegin("priority", TType.I32, 3)
            oprot.writeI32(self.priority)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()]
        return "%s(%s)" % (self.__class__.__name__, ", ".join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class TaskSubmitResponse(object):
    """
    Attributes:
     - task_id
     - status
     - created_at_ms

    """

    thrift_spec = None

    def __init__(
        self,
        task_id=None,
        status=None,
        created_at_ms=None,
    ):
        self.task_id = task_id
        self.status = status
        self.created_at_ms = created_at_ms

    def read(self, iprot):
        if (
            iprot._fast_decode is not None
            and isinstance(iprot.trans, TTransport.CReadableTransport)
            and self.thrift_spec is not None
        ):
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.task_id = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I32:
                    self.status = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I64:
                    self.created_at_ms = iprot.readI64()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        self.validate()
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin("TaskSubmitResponse")
        if self.task_id is not None:
            oprot.writeFieldBegin("task_id", TType.STRING, 1)
            oprot.writeString(self.task_id.encode("utf-8") if sys.version_info[0] == 2 else self.task_id)
            oprot.writeFieldEnd()
        if self.status is not None:
            oprot.writeFieldBegin("status", TType.I32, 2)
            oprot.writeI32(self.status)
            oprot.writeFieldEnd()
        if self.created_at_ms is not None:
            oprot.writeFieldBegin("created_at_ms", TType.I64, 3)
            oprot.writeI64(self.created_at_ms)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()]
        return "%s(%s)" % (self.__class__.__name__, ", ".join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class TaskQueryRequest(object):
    """
    Attributes:
     - task_id

    """

    thrift_spec = None

    def __init__(
        self,
        task_id=None,
    ):
        self.task_id = task_id

    def read(self, iprot):
        if (
            iprot._fast_decode is not None
            and isinstance(iprot.trans, TTransport.CReadableTransport)
            and self.thrift_spec is not None
        ):
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.task_id = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        self.validate()
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin("TaskQueryRequest")
        if self.task_id is not None:
            oprot.writeFieldBegin("task_id", TType.STRING, 1)
            oprot.writeString(self.task_id.encode("utf-8") if sys.version_info[0] == 2 else self.task_id)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()]
        return "%s(%s)" % (self.__class__.__name__, ", ".join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class TaskQueryResponse(object):
    """
    Attributes:
     - task

    """

    thrift_spec = None

    def __init__(
        self,
        task=None,
    ):
        self.task = task

    def read(self, iprot):
        if (
            iprot._fast_decode is not None
            and isinstance(iprot.trans, TTransport.CReadableTransport)
            and self.thrift_spec is not None
        ):
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRUCT:
                    self.task = TaskRecord()
                    self.task.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        self.validate()
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin("TaskQueryResponse")
        if self.task is not None:
            oprot.writeFieldBegin("task", TType.STRUCT, 1)
            self.task.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()]
        return "%s(%s)" % (self.__class__.__name__, ", ".join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class TaskCancelRequest(object):
    """
    Attributes:
     - task_id
     - reason

    """

    thrift_spec = None

    def __init__(
        self,
        task_id=None,
        reason=None,
    ):
        self.task_id = task_id
        self.reason = reason

    def read(self, iprot):
        if (
            iprot._fast_decode is not None
            and isinstance(iprot.trans, TTransport.CReadableTransport)
            and self.thrift_spec is not None
        ):
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.task_id = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.reason = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        self.validate()
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin("TaskCancelRequest")
        if self.task_id is not None:
            oprot.writeFieldBegin("task_id", TType.STRING, 1)
            oprot.writeString(self.task_id.encode("utf-8") if sys.version_info[0] == 2 else self.task_id)
            oprot.writeFieldEnd()
        if self.reason is not None:
            oprot.writeFieldBegin("reason", TType.STRING, 2)
            oprot.writeString(self.reason.encode("utf-8") if sys.version_info[0] == 2 else self.reason)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()]
        return "%s(%s)" % (self.__class__.__name__, ", ".join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class TaskCancelResponse(object):
    """
    Attributes:
     - task_id
     - status
     - canceled

    """

    thrift_spec = None

    def __init__(
        self,
        task_id=None,
        status=None,
        canceled=None,
    ):
        self.task_id = task_id
        self.status = status
        self.canceled = canceled

    def read(self, iprot):
        if (
            iprot._fast_decode is not None
            and isinstance(iprot.trans, TTransport.CReadableTransport)
            and self.thrift_spec is not None
        ):
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.task_id = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I32:
                    self.status = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.BOOL:
                    self.canceled = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        self.validate()
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin("TaskCancelResponse")
        if self.task_id is not None:
            oprot.writeFieldBegin("task_id", TType.STRING, 1)
            oprot.writeString(self.task_id.encode("utf-8") if sys.version_info[0] == 2 else self.task_id)
            oprot.writeFieldEnd()
        if self.status is not None:
            oprot.writeFieldBegin("status", TType.I32, 2)
            oprot.writeI32(self.status)
            oprot.writeFieldEnd()
        if self.canceled is not None:
            oprot.writeFieldBegin("canceled", TType.BOOL, 3)
            oprot.writeBool(self.canceled)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()]
        return "%s(%s)" % (self.__class__.__name__, ", ".join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class TaskSubscribeRequest(object):
    """
    Attributes:
     - task_id
     - events

    """

    thrift_spec = None

    def __init__(
        self,
        task_id=None,
        events=None,
    ):
        self.task_id = task_id
        self.events = events

    def read(self, iprot):
        if (
            iprot._fast_decode is not None
            and isinstance(iprot.trans, TTransport.CReadableTransport)
            and self.thrift_spec is not None
        ):
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.task_id = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.LIST:
                    self.events = []
                    (_etype67, _size64) = iprot.readListBegin()
                    for _i68 in range(_size64):
                        _elem69 = (
                            iprot.readString().decode("utf-8", errors="replace")
                            if sys.version_info[0] == 2
                            else iprot.readString()
                        )
                        self.events.append(_elem69)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        self.validate()
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin("TaskSubscribeRequest")
        if self.task_id is not None:
            oprot.writeFieldBegin("task_id", TType.STRING, 1)
            oprot.writeString(self.task_id.encode("utf-8") if sys.version_info[0] == 2 else self.task_id)
            oprot.writeFieldEnd()
        if self.events is not None:
            oprot.writeFieldBegin("events", TType.LIST, 2)
            oprot.writeListBegin(TType.STRING, len(self.events))
            for iter70 in self.events:
                oprot.writeString(iter70.encode("utf-8") if sys.version_info[0] == 2 else iter70)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()]
        return "%s(%s)" % (self.__class__.__name__, ", ".join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class TaskEvent(object):
    """
    Attributes:
     - event
     - task
     - timestamp_ms

    """

    thrift_spec = None

    def __init__(
        self,
        event=None,
        task=None,
        timestamp_ms=None,
    ):
        self.event = event
        self.task = task
        self.timestamp_ms = timestamp_ms

    def read(self, iprot):
        if (
            iprot._fast_decode is not None
            and isinstance(iprot.trans, TTransport.CReadableTransport)
            and self.thrift_spec is not None
        ):
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.event = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRUCT:
                    self.task = TaskRecord()
                    self.task.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I64:
                    self.timestamp_ms = iprot.readI64()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        self.validate()
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin("TaskEvent")
        if self.event is not None:
            oprot.writeFieldBegin("event", TType.STRING, 1)
            oprot.writeString(self.event.encode("utf-8") if sys.version_info[0] == 2 else self.event)
            oprot.writeFieldEnd()
        if self.task is not None:
            oprot.writeFieldBegin("task", TType.STRUCT, 2)
            self.task.write(oprot)
            oprot.writeFieldEnd()
        if self.timestamp_ms is not None:
            oprot.writeFieldBegin("timestamp_ms", TType.I64, 3)
            oprot.writeI64(self.timestamp_ms)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()]
        return "%s(%s)" % (self.__class__.__name__, ", ".join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class HealthCheckRequest(object):
    """
    Attributes:
     - service_name

    """

    thrift_spec = None

    def __init__(
        self,
        service_name=None,
    ):
        self.service_name = service_name

    def read(self, iprot):
        if (
            iprot._fast_decode is not None
            and isinstance(iprot.trans, TTransport.CReadableTransport)
            and self.thrift_spec is not None
        ):
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.service_name = (
                        iprot.readString().decode("utf-8", errors="replace")
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        self.validate()
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin("HealthCheckRequest")
        if self.service_name is not None:
            oprot.writeFieldBegin("service_name", TType.STRING, 1)
            oprot.writeString(self.service_name.encode("utf-8") if sys.version_info[0] == 2 else self.service_name)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()]
        return "%s(%s)" % (self.__class__.__name__, ", ".join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


class HealthCheckResponse(object):
    """
    Attributes:
     - status
     - services

    """

    thrift_spec = None

    def __init__(
        self,
        status=None,
        services=None,
    ):
        self.status = status
        self.services = services

    def read(self, iprot):
        if (
            iprot._fast_decode is not None
            and isinstance(iprot.trans, TTransport.CReadableTransport)
            and self.thrift_spec is not None
        ):
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I32:
                    self.status = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.MAP:
                    self.services = {}
                    (_ktype72, _vtype73, _size71) = iprot.readMapBegin()
                    for _i75 in range(_size71):
                        _key76 = (
                            iprot.readString().decode("utf-8", errors="replace")
                            if sys.version_info[0] == 2
                            else iprot.readString()
                        )
                        _val77 = iprot.readI32()
                        self.services[_key76] = _val77
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        self.validate()
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin("HealthCheckResponse")
        if self.status is not None:
            oprot.writeFieldBegin("status", TType.I32, 1)
            oprot.writeI32(self.status)
            oprot.writeFieldEnd()
        if self.services is not None:
            oprot.writeFieldBegin("services", TType.MAP, 2)
            oprot.writeMapBegin(TType.STRING, TType.I32, len(self.services))
            for kiter78, viter79 in self.services.items():
                oprot.writeString(kiter78.encode("utf-8") if sys.version_info[0] == 2 else kiter78)
                oprot.writeI32(viter79)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()]
        return "%s(%s)" % (self.__class__.__name__, ", ".join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


all_structs.append(TraceContext)
TraceContext.thrift_spec = (
    None,  # 0
    (
        1,
        TType.STRING,
        "trace_id",
        "UTF8",
        None,
    ),  # 1
    (
        2,
        TType.STRING,
        "span_id",
        "UTF8",
        None,
    ),  # 2
    (
        3,
        TType.STRING,
        "parent_span_id",
        "UTF8",
        None,
    ),  # 3
    (
        4,
        TType.BOOL,
        "sampled",
        None,
        None,
    ),  # 4
    (
        5,
        TType.MAP,
        "baggage",
        (TType.STRING, "UTF8", TType.STRING, "UTF8", False),
        None,
    ),  # 5
)
all_structs.append(ErrorDetail)
ErrorDetail.thrift_spec = (
    None,  # 0
    (
        1,
        TType.STRING,
        "type",
        "UTF8",
        None,
    ),  # 1
    (
        2,
        TType.STRING,
        "field",
        "UTF8",
        None,
    ),  # 2
    (
        3,
        TType.STRING,
        "reason",
        "UTF8",
        None,
    ),  # 3
    (
        4,
        TType.MAP,
        "metadata",
        (TType.STRING, "UTF8", TType.STRING, "UTF8", False),
        None,
    ),  # 4
)
all_structs.append(DebugInfo)
DebugInfo.thrift_spec = (
    None,  # 0
    (
        1,
        TType.STRING,
        "stack_trace",
        "UTF8",
        None,
    ),  # 1
    (
        2,
        TType.STRING,
        "internal_message",
        "UTF8",
        None,
    ),  # 2
    (
        3,
        TType.I64,
        "timestamp_ms",
        None,
        None,
    ),  # 3
)
all_structs.append(RpcError)
RpcError.thrift_spec = (
    None,  # 0
    (
        1,
        TType.I32,
        "code",
        None,
        None,
    ),  # 1
    (
        2,
        TType.STRING,
        "name",
        "UTF8",
        None,
    ),  # 2
    (
        3,
        TType.STRING,
        "message",
        "UTF8",
        None,
    ),  # 3
    (
        4,
        TType.LIST,
        "details",
        (TType.STRUCT, [ErrorDetail, None], False),
        None,
    ),  # 4
    (
        5,
        TType.STRUCT,
        "debug",
        [DebugInfo, None],
        None,
    ),  # 5
)
all_structs.append(AuthContext)
AuthContext.thrift_spec = (
    None,  # 0
    (
        1,
        TType.I32,
        "scheme",
        None,
        None,
    ),  # 1
    (
        2,
        TType.STRING,
        "credentials",
        "UTF8",
        None,
    ),  # 2
    (
        3,
        TType.STRING,
        "principal",
        "UTF8",
        None,
    ),  # 3
    (
        4,
        TType.LIST,
        "roles",
        (TType.STRING, "UTF8", False),
        None,
    ),  # 4
)
all_structs.append(RequestMetadata)
RequestMetadata.thrift_spec = (
    None,  # 0
    (
        1,
        TType.I64,
        "timestamp_ms",
        None,
        None,
    ),  # 1
    (
        2,
        TType.STRING,
        "client_id",
        "UTF8",
        None,
    ),  # 2
    (
        3,
        TType.STRING,
        "client_version",
        "UTF8",
        None,
    ),  # 3
    (
        4,
        TType.STRUCT,
        "auth",
        [AuthContext, None],
        None,
    ),  # 4
    (
        5,
        TType.STRING,
        "tenant_id",
        "UTF8",
        None,
    ),  # 5
    None,  # 6
    None,  # 7
    None,  # 8
    (
        9,
        TType.MAP,
        "headers",
        (TType.STRING, "UTF8", TType.STRING, "UTF8", False),
        None,
    ),  # 9
    (
        10,
        TType.BOOL,
        "long_task",
        None,
        None,
    ),  # 10
    (
        11,
        TType.STRING,
        "long_task_method",
        "UTF8",
        None,
    ),  # 11
    (
        12,
        TType.I32,
        "long_task_timeout",
        None,
        None,
    ),  # 12
)
all_structs.append(ResponseMetadata)
ResponseMetadata.thrift_spec = (
    None,  # 0
    (
        1,
        TType.I64,
        "timestamp_ms",
        None,
        None,
    ),  # 1
    (
        2,
        TType.I64,
        "duration_ms",
        None,
        None,
    ),  # 2
    (
        3,
        TType.STRING,
        "server_id",
        "UTF8",
        None,
    ),  # 3
    (
        4,
        TType.STRING,
        "server_version",
        "UTF8",
        None,
    ),  # 4
)
all_structs.append(RetryConfig)
RetryConfig.thrift_spec = (
    None,  # 0
    (
        1,
        TType.I32,
        "max_attempts",
        None,
        None,
    ),  # 1
    (
        2,
        TType.I64,
        "initial_delay_ms",
        None,
        None,
    ),  # 2
    (
        3,
        TType.I64,
        "max_delay_ms",
        None,
        None,
    ),  # 3
    (
        4,
        TType.DOUBLE,
        "backoff_multiplier",
        None,
        None,
    ),  # 4
    (
        5,
        TType.LIST,
        "retryable_codes",
        (TType.I32, None, False),
        None,
    ),  # 5
)
all_structs.append(QosConfig)
QosConfig.thrift_spec = (
    None,  # 0
    (
        1,
        TType.I32,
        "priority",
        None,
        None,
    ),  # 1
    (
        2,
        TType.I64,
        "timeout_ms",
        None,
        None,
    ),  # 2
    (
        3,
        TType.STRUCT,
        "retry_config",
        [RetryConfig, None],
        None,
    ),  # 3
    (
        4,
        TType.STRING,
        "idempotency_key",
        "UTF8",
        None,
    ),  # 4
)
all_structs.append(Request)
Request.thrift_spec = (
    None,  # 0
    (
        1,
        TType.STRING,
        "aduib_rpc",
        "UTF8",
        None,
    ),  # 1
    (
        2,
        TType.STRING,
        "id",
        "UTF8",
        None,
    ),  # 2
    (
        3,
        TType.STRING,
        "method",
        "UTF8",
        None,
    ),  # 3
    (
        4,
        TType.STRING,
        "name",
        "UTF8",
        None,
    ),  # 4
    (
        5,
        TType.STRING,
        "data_json",
        "UTF8",
        None,
    ),  # 5
    (
        6,
        TType.STRUCT,
        "trace_context",
        [TraceContext, None],
        None,
    ),  # 6
    (
        7,
        TType.STRUCT,
        "metadata",
        [RequestMetadata, None],
        None,
    ),  # 7
    (
        8,
        TType.STRUCT,
        "qos",
        [QosConfig, None],
        None,
    ),  # 8
)
all_structs.append(ResponsePayload)
ResponsePayload.thrift_spec = (
    None,  # 0
    (
        1,
        TType.STRING,
        "result_json",
        "UTF8",
        None,
    ),  # 1
    (
        2,
        TType.STRUCT,
        "error",
        [RpcError, None],
        None,
    ),  # 2
)
all_structs.append(Response)
Response.thrift_spec = (
    None,  # 0
    (
        1,
        TType.STRING,
        "aduib_rpc",
        "UTF8",
        None,
    ),  # 1
    (
        2,
        TType.STRING,
        "id",
        "UTF8",
        None,
    ),  # 2
    (
        3,
        TType.I32,
        "status",
        None,
        None,
    ),  # 3
    (
        4,
        TType.STRUCT,
        "payload",
        [ResponsePayload, None],
        None,
    ),  # 4
    (
        5,
        TType.STRUCT,
        "trace_context",
        [TraceContext, None],
        None,
    ),  # 5
    (
        6,
        TType.STRUCT,
        "metadata",
        [ResponseMetadata, None],
        None,
    ),  # 6
)
all_structs.append(TaskRecord)
TaskRecord.thrift_spec = (
    None,  # 0
    (
        1,
        TType.STRING,
        "task_id",
        "UTF8",
        None,
    ),  # 1
    (
        2,
        TType.STRING,
        "parent_task_id",
        "UTF8",
        None,
    ),  # 2
    (
        3,
        TType.I32,
        "status",
        None,
        None,
    ),  # 3
    (
        4,
        TType.I32,
        "priority",
        None,
        None,
    ),  # 4
    (
        5,
        TType.I64,
        "created_at_ms",
        None,
        None,
    ),  # 5
    (
        6,
        TType.I64,
        "scheduled_at_ms",
        None,
        None,
    ),  # 6
    (
        7,
        TType.I64,
        "started_at_ms",
        None,
        None,
    ),  # 7
    (
        8,
        TType.I64,
        "completed_at_ms",
        None,
        None,
    ),  # 8
    (
        9,
        TType.I32,
        "attempt",
        None,
        None,
    ),  # 9
    (
        10,
        TType.I32,
        "max_attempts",
        None,
        None,
    ),  # 10
    (
        11,
        TType.I64,
        "next_retry_at_ms",
        None,
        None,
    ),  # 11
    (
        12,
        TType.STRING,
        "result",
        "UTF8",
        None,
    ),  # 12
    (
        13,
        TType.STRUCT,
        "error",
        [RpcError, None],
        None,
    ),  # 13
    (
        14,
        TType.STRUCT,
        "progress",
        [TaskProgress, None],
        None,
    ),  # 14
    (
        15,
        TType.MAP,
        "metadata",
        (TType.STRING, "UTF8", TType.STRING, "UTF8", False),
        None,
    ),  # 15
    (
        16,
        TType.LIST,
        "tags",
        (TType.STRING, "UTF8", False),
        None,
    ),  # 16
)
all_structs.append(TaskProgress)
TaskProgress.thrift_spec = (
    None,  # 0
    (
        1,
        TType.I64,
        "current",
        None,
        None,
    ),  # 1
    (
        2,
        TType.I64,
        "total",
        None,
        None,
    ),  # 2
    (
        3,
        TType.STRING,
        "message",
        "UTF8",
        None,
    ),  # 3
    (
        4,
        TType.DOUBLE,
        "percentage",
        None,
        None,
    ),  # 4
)
all_structs.append(TaskSubmitRequest)
TaskSubmitRequest.thrift_spec = (
    None,  # 0
    (
        1,
        TType.STRING,
        "target_method",
        "UTF8",
        None,
    ),  # 1
    (
        2,
        TType.STRING,
        "params_json",
        "UTF8",
        None,
    ),  # 2
    (
        3,
        TType.I32,
        "priority",
        None,
        None,
    ),  # 3
)
all_structs.append(TaskSubmitResponse)
TaskSubmitResponse.thrift_spec = (
    None,  # 0
    (
        1,
        TType.STRING,
        "task_id",
        "UTF8",
        None,
    ),  # 1
    (
        2,
        TType.I32,
        "status",
        None,
        None,
    ),  # 2
    (
        3,
        TType.I64,
        "created_at_ms",
        None,
        None,
    ),  # 3
)
all_structs.append(TaskQueryRequest)
TaskQueryRequest.thrift_spec = (
    None,  # 0
    (
        1,
        TType.STRING,
        "task_id",
        "UTF8",
        None,
    ),  # 1
)
all_structs.append(TaskQueryResponse)
TaskQueryResponse.thrift_spec = (
    None,  # 0
    (
        1,
        TType.STRUCT,
        "task",
        [TaskRecord, None],
        None,
    ),  # 1
)
all_structs.append(TaskCancelRequest)
TaskCancelRequest.thrift_spec = (
    None,  # 0
    (
        1,
        TType.STRING,
        "task_id",
        "UTF8",
        None,
    ),  # 1
    (
        2,
        TType.STRING,
        "reason",
        "UTF8",
        None,
    ),  # 2
)
all_structs.append(TaskCancelResponse)
TaskCancelResponse.thrift_spec = (
    None,  # 0
    (
        1,
        TType.STRING,
        "task_id",
        "UTF8",
        None,
    ),  # 1
    (
        2,
        TType.I32,
        "status",
        None,
        None,
    ),  # 2
    (
        3,
        TType.BOOL,
        "canceled",
        None,
        None,
    ),  # 3
)
all_structs.append(TaskSubscribeRequest)
TaskSubscribeRequest.thrift_spec = (
    None,  # 0
    (
        1,
        TType.STRING,
        "task_id",
        "UTF8",
        None,
    ),  # 1
    (
        2,
        TType.LIST,
        "events",
        (TType.STRING, "UTF8", False),
        None,
    ),  # 2
)
all_structs.append(TaskEvent)
TaskEvent.thrift_spec = (
    None,  # 0
    (
        1,
        TType.STRING,
        "event",
        "UTF8",
        None,
    ),  # 1
    (
        2,
        TType.STRUCT,
        "task",
        [TaskRecord, None],
        None,
    ),  # 2
    (
        3,
        TType.I64,
        "timestamp_ms",
        None,
        None,
    ),  # 3
)
all_structs.append(HealthCheckRequest)
HealthCheckRequest.thrift_spec = (
    None,  # 0
    (
        1,
        TType.STRING,
        "service_name",
        "UTF8",
        None,
    ),  # 1
)
all_structs.append(HealthCheckResponse)
HealthCheckResponse.thrift_spec = (
    None,  # 0
    (
        1,
        TType.I32,
        "status",
        None,
        None,
    ),  # 1
    (
        2,
        TType.MAP,
        "services",
        (TType.STRING, "UTF8", TType.I32, None, False),
        None,
    ),  # 2
)
fix_spec(all_structs)
del all_structs
