#
# Autogenerated by Thrift Compiler (0.11.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

import sys
import koverse.thriftgen.ttypes
import koverse.thriftgen.security.ttypes
import koverse.thriftgen.aggregate.ttypes
import koverse.thriftgen.usergroup.ttypes
import koverse.thriftgen.queryservice.ttypes

from thrift.transport import TTransport
all_structs = []


class TCollectionState(object):
    Ready = 1
    Deleting = 2
    Initializing = 3

    _VALUES_TO_NAMES = {
        1: "Ready",
        2: "Deleting",
        3: "Initializing",
    }

    _NAMES_TO_VALUES = {
        "Ready": 1,
        "Deleting": 2,
        "Initializing": 3,
    }


class TIndexingPolicyFieldMode(object):
    Inclusive = 1
    Exclusive = 2

    _VALUES_TO_NAMES = {
        1: "Inclusive",
        2: "Exclusive",
    }

    _NAMES_TO_VALUES = {
        "Inclusive": 1,
        "Exclusive": 2,
    }


class TCollectionSchemaFieldValueType(object):
    UNKNOWN = 0
    NULL = 1
    BOOLEAN = 2
    STRING = 3
    DATE = 4
    NUMBER = 5
    IPADDRESS = 6
    URL = 7
    GEO = 8
    BYTES = 9

    _VALUES_TO_NAMES = {
        0: "UNKNOWN",
        1: "NULL",
        2: "BOOLEAN",
        3: "STRING",
        4: "DATE",
        5: "NUMBER",
        6: "IPADDRESS",
        7: "URL",
        8: "GEO",
        9: "BYTES",
    }

    _NAMES_TO_VALUES = {
        "UNKNOWN": 0,
        "NULL": 1,
        "BOOLEAN": 2,
        "STRING": 3,
        "DATE": 4,
        "NUMBER": 5,
        "IPADDRESS": 6,
        "URL": 7,
        "GEO": 8,
        "BYTES": 9,
    }


class TFieldTypePair(object):
    """
    Attributes:
     - fieldName
     - fieldType
    """


    def __init__(self, fieldName=None, fieldType=None,):
        self.fieldName = fieldName
        self.fieldType = fieldType

    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.fieldName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.fieldType = iprot.readString().decode('utf-8') 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):
        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('TFieldTypePair')
        if self.fieldName is not None:
            oprot.writeFieldBegin('fieldName', TType.STRING, 1)
            oprot.writeString(self.fieldName.encode('utf-8') if sys.version_info[0] == 2 else self.fieldName)
            oprot.writeFieldEnd()
        if self.fieldType is not None:
            oprot.writeFieldBegin('fieldType', TType.STRING, 2)
            oprot.writeString(self.fieldType.encode('utf-8') if sys.version_info[0] == 2 else self.fieldType)
            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 TFieldDetails(object):
    """
    Attributes:
     - fieldName
     - typeHistogram
     - lengthsHistogram
     - recordCount
    """


    def __init__(self, fieldName=None, typeHistogram=None, lengthsHistogram=None, recordCount=None,):
        self.fieldName = fieldName
        self.typeHistogram = typeHistogram
        self.lengthsHistogram = lengthsHistogram
        self.recordCount = recordCount

    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.fieldName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.MAP:
                    self.typeHistogram = {}
                    (_ktype1, _vtype2, _size0) = iprot.readMapBegin()
                    for _i4 in range(_size0):
                        _key5 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        _val6 = iprot.readI64()
                        self.typeHistogram[_key5] = _val6
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.MAP:
                    self.lengthsHistogram = {}
                    (_ktype8, _vtype9, _size7) = iprot.readMapBegin()
                    for _i11 in range(_size7):
                        _key12 = iprot.readI32()
                        _val13 = iprot.readI64()
                        self.lengthsHistogram[_key12] = _val13
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I64:
                    self.recordCount = iprot.readI64()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        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('TFieldDetails')
        if self.fieldName is not None:
            oprot.writeFieldBegin('fieldName', TType.STRING, 1)
            oprot.writeString(self.fieldName.encode('utf-8') if sys.version_info[0] == 2 else self.fieldName)
            oprot.writeFieldEnd()
        if self.typeHistogram is not None:
            oprot.writeFieldBegin('typeHistogram', TType.MAP, 2)
            oprot.writeMapBegin(TType.STRING, TType.I64, len(self.typeHistogram))
            for kiter14, viter15 in self.typeHistogram.items():
                oprot.writeString(kiter14.encode('utf-8') if sys.version_info[0] == 2 else kiter14)
                oprot.writeI64(viter15)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        if self.lengthsHistogram is not None:
            oprot.writeFieldBegin('lengthsHistogram', TType.MAP, 3)
            oprot.writeMapBegin(TType.I32, TType.I64, len(self.lengthsHistogram))
            for kiter16, viter17 in self.lengthsHistogram.items():
                oprot.writeI32(kiter16)
                oprot.writeI64(viter17)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        if self.recordCount is not None:
            oprot.writeFieldBegin('recordCount', TType.I64, 4)
            oprot.writeI64(self.recordCount)
            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 TIndexTermConfiguration(object):
    """
    Attributes:
     - indexTermTransformerClassName
     - parameters
    """


    def __init__(self, indexTermTransformerClassName=None, parameters=None,):
        self.indexTermTransformerClassName = indexTermTransformerClassName
        self.parameters = parameters

    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.indexTermTransformerClassName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.MAP:
                    self.parameters = {}
                    (_ktype19, _vtype20, _size18) = iprot.readMapBegin()
                    for _i22 in range(_size18):
                        _key23 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        _val24 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        self.parameters[_key23] = _val24
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        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('TIndexTermConfiguration')
        if self.indexTermTransformerClassName is not None:
            oprot.writeFieldBegin('indexTermTransformerClassName', TType.STRING, 1)
            oprot.writeString(self.indexTermTransformerClassName.encode('utf-8') if sys.version_info[0] == 2 else self.indexTermTransformerClassName)
            oprot.writeFieldEnd()
        if self.parameters is not None:
            oprot.writeFieldBegin('parameters', TType.MAP, 2)
            oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.parameters))
            for kiter25, viter26 in self.parameters.items():
                oprot.writeString(kiter25.encode('utf-8') if sys.version_info[0] == 2 else kiter25)
                oprot.writeString(viter26.encode('utf-8') if sys.version_info[0] == 2 else viter26)
            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 TFieldTypeIndexTermConfigurationPair(object):
    """
    Attributes:
     - fieldTypePair
     - indexTermConfiguration
    """


    def __init__(self, fieldTypePair=None, indexTermConfiguration=None,):
        self.fieldTypePair = fieldTypePair
        self.indexTermConfiguration = indexTermConfiguration

    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.fieldTypePair = TFieldTypePair()
                    self.fieldTypePair.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRUCT:
                    self.indexTermConfiguration = TIndexTermConfiguration()
                    self.indexTermConfiguration.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        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('TFieldTypeIndexTermConfigurationPair')
        if self.fieldTypePair is not None:
            oprot.writeFieldBegin('fieldTypePair', TType.STRUCT, 1)
            self.fieldTypePair.write(oprot)
            oprot.writeFieldEnd()
        if self.indexTermConfiguration is not None:
            oprot.writeFieldBegin('indexTermConfiguration', TType.STRUCT, 2)
            self.indexTermConfiguration.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 TIndexingPolicy(object):
    """
    Attributes:
     - fieldMode
     - fields
     - fieldTermConfigurations
     - compositeIndexes
     - createValueOnlyIndices
     - id
     - dataSetId
     - foreignLanguageIndexing
    """


    def __init__(self, fieldMode=None, fields=None, fieldTermConfigurations=None, compositeIndexes=None, createValueOnlyIndices=None, id=None, dataSetId=None, foreignLanguageIndexing=None,):
        self.fieldMode = fieldMode
        self.fields = fields
        self.fieldTermConfigurations = fieldTermConfigurations
        self.compositeIndexes = compositeIndexes
        self.createValueOnlyIndices = createValueOnlyIndices
        self.id = id
        self.dataSetId = dataSetId
        self.foreignLanguageIndexing = foreignLanguageIndexing

    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.fieldMode = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.SET:
                    self.fields = set()
                    (_etype30, _size27) = iprot.readSetBegin()
                    for _i31 in range(_size27):
                        _elem32 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        self.fields.add(_elem32)
                    iprot.readSetEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.LIST:
                    self.fieldTermConfigurations = []
                    (_etype36, _size33) = iprot.readListBegin()
                    for _i37 in range(_size33):
                        _elem38 = TFieldTypeIndexTermConfigurationPair()
                        _elem38.read(iprot)
                        self.fieldTermConfigurations.append(_elem38)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.LIST:
                    self.compositeIndexes = []
                    (_etype42, _size39) = iprot.readListBegin()
                    for _i43 in range(_size39):
                        _elem44 = []
                        (_etype48, _size45) = iprot.readListBegin()
                        for _i49 in range(_size45):
                            _elem50 = TFieldTypePair()
                            _elem50.read(iprot)
                            _elem44.append(_elem50)
                        iprot.readListEnd()
                        self.compositeIndexes.append(_elem44)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.BOOL:
                    self.createValueOnlyIndices = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.I64:
                    self.id = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 7:
                if ftype == TType.STRING:
                    self.dataSetId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 8:
                if ftype == TType.BOOL:
                    self.foreignLanguageIndexing = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        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('TIndexingPolicy')
        if self.fieldMode is not None:
            oprot.writeFieldBegin('fieldMode', TType.I32, 1)
            oprot.writeI32(self.fieldMode)
            oprot.writeFieldEnd()
        if self.fields is not None:
            oprot.writeFieldBegin('fields', TType.SET, 2)
            oprot.writeSetBegin(TType.STRING, len(self.fields))
            for iter51 in self.fields:
                oprot.writeString(iter51.encode('utf-8') if sys.version_info[0] == 2 else iter51)
            oprot.writeSetEnd()
            oprot.writeFieldEnd()
        if self.fieldTermConfigurations is not None:
            oprot.writeFieldBegin('fieldTermConfigurations', TType.LIST, 3)
            oprot.writeListBegin(TType.STRUCT, len(self.fieldTermConfigurations))
            for iter52 in self.fieldTermConfigurations:
                iter52.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.compositeIndexes is not None:
            oprot.writeFieldBegin('compositeIndexes', TType.LIST, 4)
            oprot.writeListBegin(TType.LIST, len(self.compositeIndexes))
            for iter53 in self.compositeIndexes:
                oprot.writeListBegin(TType.STRUCT, len(iter53))
                for iter54 in iter53:
                    iter54.write(oprot)
                oprot.writeListEnd()
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.createValueOnlyIndices is not None:
            oprot.writeFieldBegin('createValueOnlyIndices', TType.BOOL, 5)
            oprot.writeBool(self.createValueOnlyIndices)
            oprot.writeFieldEnd()
        if self.id is not None:
            oprot.writeFieldBegin('id', TType.I64, 6)
            oprot.writeI64(self.id)
            oprot.writeFieldEnd()
        if self.dataSetId is not None:
            oprot.writeFieldBegin('dataSetId', TType.STRING, 7)
            oprot.writeString(self.dataSetId.encode('utf-8') if sys.version_info[0] == 2 else self.dataSetId)
            oprot.writeFieldEnd()
        if self.foreignLanguageIndexing is not None:
            oprot.writeFieldBegin('foreignLanguageIndexing', TType.BOOL, 8)
            oprot.writeBool(self.foreignLanguageIndexing)
            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 TIndexTermTransformerDescriptor(object):
    """
    Attributes:
     - inputParameters
     - name
     - fieldTypes
     - implementingClassName
    """


    def __init__(self, inputParameters=None, name=None, fieldTypes=None, implementingClassName=None,):
        self.inputParameters = inputParameters
        self.name = name
        self.fieldTypes = fieldTypes
        self.implementingClassName = implementingClassName

    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.LIST:
                    self.inputParameters = []
                    (_etype58, _size55) = iprot.readListBegin()
                    for _i59 in range(_size55):
                        _elem60 = koverse.thriftgen.ttypes.TParameter()
                        _elem60.read(iprot)
                        self.inputParameters.append(_elem60)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.SET:
                    self.fieldTypes = set()
                    (_etype64, _size61) = iprot.readSetBegin()
                    for _i65 in range(_size61):
                        _elem66 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        self.fieldTypes.add(_elem66)
                    iprot.readSetEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRING:
                    self.implementingClassName = iprot.readString().decode('utf-8') 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):
        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('TIndexTermTransformerDescriptor')
        if self.inputParameters is not None:
            oprot.writeFieldBegin('inputParameters', TType.LIST, 1)
            oprot.writeListBegin(TType.STRUCT, len(self.inputParameters))
            for iter67 in self.inputParameters:
                iter67.write(oprot)
            oprot.writeListEnd()
            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.fieldTypes is not None:
            oprot.writeFieldBegin('fieldTypes', TType.SET, 3)
            oprot.writeSetBegin(TType.STRING, len(self.fieldTypes))
            for iter68 in self.fieldTypes:
                oprot.writeString(iter68.encode('utf-8') if sys.version_info[0] == 2 else iter68)
            oprot.writeSetEnd()
            oprot.writeFieldEnd()
        if self.implementingClassName is not None:
            oprot.writeFieldBegin('implementingClassName', TType.STRING, 4)
            oprot.writeString(self.implementingClassName.encode('utf-8') if sys.version_info[0] == 2 else self.implementingClassName)
            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 TCollectionStatus(object):
    """
    Attributes:
     - id
     - creationTimestamp
     - recordCount
     - interval
     - collectionId
    """


    def __init__(self, id=None, creationTimestamp=None, recordCount=None, interval=None, collectionId=None,):
        self.id = id
        self.creationTimestamp = creationTimestamp
        self.recordCount = recordCount
        self.interval = interval
        self.collectionId = collectionId

    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.id = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I64:
                    self.creationTimestamp = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I64:
                    self.recordCount = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I64:
                    self.interval = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRING:
                    self.collectionId = iprot.readString().decode('utf-8') 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):
        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('TCollectionStatus')
        if self.id is not None:
            oprot.writeFieldBegin('id', TType.I64, 1)
            oprot.writeI64(self.id)
            oprot.writeFieldEnd()
        if self.creationTimestamp is not None:
            oprot.writeFieldBegin('creationTimestamp', TType.I64, 2)
            oprot.writeI64(self.creationTimestamp)
            oprot.writeFieldEnd()
        if self.recordCount is not None:
            oprot.writeFieldBegin('recordCount', TType.I64, 3)
            oprot.writeI64(self.recordCount)
            oprot.writeFieldEnd()
        if self.interval is not None:
            oprot.writeFieldBegin('interval', TType.I64, 4)
            oprot.writeI64(self.interval)
            oprot.writeFieldEnd()
        if self.collectionId is not None:
            oprot.writeFieldBegin('collectionId', TType.STRING, 5)
            oprot.writeString(self.collectionId.encode('utf-8') if sys.version_info[0] == 2 else self.collectionId)
            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 TFieldStatistics(object):
    """
    Attributes:
     - collectionId
     - fieldName
     - typeHistogram
     - lengthsHistogram
     - recordCount
     - cardinalityEstimate
     - top40
     - heatmap
    """


    def __init__(self, collectionId=None, fieldName=None, typeHistogram=None, lengthsHistogram=None, recordCount=None, cardinalityEstimate=None, top40=None, heatmap=None,):
        self.collectionId = collectionId
        self.fieldName = fieldName
        self.typeHistogram = typeHistogram
        self.lengthsHistogram = lengthsHistogram
        self.recordCount = recordCount
        self.cardinalityEstimate = cardinalityEstimate
        self.top40 = top40
        self.heatmap = heatmap

    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.collectionId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.fieldName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.MAP:
                    self.typeHistogram = {}
                    (_ktype70, _vtype71, _size69) = iprot.readMapBegin()
                    for _i73 in range(_size69):
                        _key74 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        _val75 = iprot.readI64()
                        self.typeHistogram[_key74] = _val75
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.MAP:
                    self.lengthsHistogram = {}
                    (_ktype77, _vtype78, _size76) = iprot.readMapBegin()
                    for _i80 in range(_size76):
                        _key81 = iprot.readI32()
                        _val82 = iprot.readI64()
                        self.lengthsHistogram[_key81] = _val82
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.I64:
                    self.recordCount = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.DOUBLE:
                    self.cardinalityEstimate = iprot.readDouble()
                else:
                    iprot.skip(ftype)
            elif fid == 7:
                if ftype == TType.MAP:
                    self.top40 = {}
                    (_ktype84, _vtype85, _size83) = iprot.readMapBegin()
                    for _i87 in range(_size83):
                        _key88 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        _val89 = iprot.readI32()
                        self.top40[_key88] = _val89
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 8:
                if ftype == TType.LIST:
                    self.heatmap = []
                    (_etype93, _size90) = iprot.readListBegin()
                    for _i94 in range(_size90):
                        _elem95 = iprot.readI32()
                        self.heatmap.append(_elem95)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        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('TFieldStatistics')
        if self.collectionId is not None:
            oprot.writeFieldBegin('collectionId', TType.STRING, 1)
            oprot.writeString(self.collectionId.encode('utf-8') if sys.version_info[0] == 2 else self.collectionId)
            oprot.writeFieldEnd()
        if self.fieldName is not None:
            oprot.writeFieldBegin('fieldName', TType.STRING, 2)
            oprot.writeString(self.fieldName.encode('utf-8') if sys.version_info[0] == 2 else self.fieldName)
            oprot.writeFieldEnd()
        if self.typeHistogram is not None:
            oprot.writeFieldBegin('typeHistogram', TType.MAP, 3)
            oprot.writeMapBegin(TType.STRING, TType.I64, len(self.typeHistogram))
            for kiter96, viter97 in self.typeHistogram.items():
                oprot.writeString(kiter96.encode('utf-8') if sys.version_info[0] == 2 else kiter96)
                oprot.writeI64(viter97)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        if self.lengthsHistogram is not None:
            oprot.writeFieldBegin('lengthsHistogram', TType.MAP, 4)
            oprot.writeMapBegin(TType.I32, TType.I64, len(self.lengthsHistogram))
            for kiter98, viter99 in self.lengthsHistogram.items():
                oprot.writeI32(kiter98)
                oprot.writeI64(viter99)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        if self.recordCount is not None:
            oprot.writeFieldBegin('recordCount', TType.I64, 5)
            oprot.writeI64(self.recordCount)
            oprot.writeFieldEnd()
        if self.cardinalityEstimate is not None:
            oprot.writeFieldBegin('cardinalityEstimate', TType.DOUBLE, 6)
            oprot.writeDouble(self.cardinalityEstimate)
            oprot.writeFieldEnd()
        if self.top40 is not None:
            oprot.writeFieldBegin('top40', TType.MAP, 7)
            oprot.writeMapBegin(TType.STRING, TType.I32, len(self.top40))
            for kiter100, viter101 in self.top40.items():
                oprot.writeString(kiter100.encode('utf-8') if sys.version_info[0] == 2 else kiter100)
                oprot.writeI32(viter101)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        if self.heatmap is not None:
            oprot.writeFieldBegin('heatmap', TType.LIST, 8)
            oprot.writeListBegin(TType.I32, len(self.heatmap))
            for iter102 in self.heatmap:
                oprot.writeI32(iter102)
            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 TCollectionStatistics(object):
    """
    Attributes:
     - fieldStatistics
    """


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

    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.LIST:
                    self.fieldStatistics = []
                    (_etype106, _size103) = iprot.readListBegin()
                    for _i107 in range(_size103):
                        _elem108 = TFieldStatistics()
                        _elem108.read(iprot)
                        self.fieldStatistics.append(_elem108)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        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('TCollectionStatistics')
        if self.fieldStatistics is not None:
            oprot.writeFieldBegin('fieldStatistics', TType.LIST, 1)
            oprot.writeListBegin(TType.STRUCT, len(self.fieldStatistics))
            for iter109 in self.fieldStatistics:
                iter109.write(oprot)
            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 TCollectionGroupPermission(object):
    """
    Attributes:
     - id
     - groupId
     - permissions
     - collectionId
    """


    def __init__(self, id=None, groupId=None, permissions=None, collectionId=None,):
        self.id = id
        self.groupId = groupId
        self.permissions = permissions
        self.collectionId = collectionId

    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.id = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I64:
                    self.groupId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.LIST:
                    self.permissions = []
                    (_etype113, _size110) = iprot.readListBegin()
                    for _i114 in range(_size110):
                        _elem115 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        self.permissions.append(_elem115)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRING:
                    self.collectionId = iprot.readString().decode('utf-8') 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):
        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('TCollectionGroupPermission')
        if self.id is not None:
            oprot.writeFieldBegin('id', TType.I64, 1)
            oprot.writeI64(self.id)
            oprot.writeFieldEnd()
        if self.groupId is not None:
            oprot.writeFieldBegin('groupId', TType.I64, 2)
            oprot.writeI64(self.groupId)
            oprot.writeFieldEnd()
        if self.permissions is not None:
            oprot.writeFieldBegin('permissions', TType.LIST, 3)
            oprot.writeListBegin(TType.STRING, len(self.permissions))
            for iter116 in self.permissions:
                oprot.writeString(iter116.encode('utf-8') if sys.version_info[0] == 2 else iter116)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.collectionId is not None:
            oprot.writeFieldBegin('collectionId', TType.STRING, 4)
            oprot.writeString(self.collectionId.encode('utf-8') if sys.version_info[0] == 2 else self.collectionId)
            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 TCollection(object):
    """
    Attributes:
     - id
     - name
     - description
     - indexingPolicyId
     - tags
     - userId
     - createdTimestamp
     - updatedTimestamp
     - recordCountUpdatedTimestamp
     - recordCount
     - sizeInBytes
     - state
     - groupPermissionIds
     - hadoopDeleteJobIds
     - version
     - deleted
     - disableFieldStats
     - disableSampling
     - fieldStatsMinimumExecutionPeriod
     - samplingMinimumExecutionPeriod
     - aggregationMinimumExecutionPeriod
     - versionedCollectionId
     - importFlowId
     - importFlowIds
     - indexingPolicy
     - ageOffEnabled
     - ageOffDays
     - ageOffIndexDays
    """


    def __init__(self, id=None, name=None, description=None, indexingPolicyId=None, tags=None, userId=None, createdTimestamp=None, updatedTimestamp=None, recordCountUpdatedTimestamp=None, recordCount=None, sizeInBytes=None, state=None, groupPermissionIds=None, hadoopDeleteJobIds=None, version=None, deleted=None, disableFieldStats=None, disableSampling=None, fieldStatsMinimumExecutionPeriod=None, samplingMinimumExecutionPeriod=None, aggregationMinimumExecutionPeriod=None, versionedCollectionId=None, importFlowId=None, importFlowIds=None, indexingPolicy=None, ageOffEnabled=None, ageOffDays=None, ageOffIndexDays=None,):
        self.id = id
        self.name = name
        self.description = description
        self.indexingPolicyId = indexingPolicyId
        self.tags = tags
        self.userId = userId
        self.createdTimestamp = createdTimestamp
        self.updatedTimestamp = updatedTimestamp
        self.recordCountUpdatedTimestamp = recordCountUpdatedTimestamp
        self.recordCount = recordCount
        self.sizeInBytes = sizeInBytes
        self.state = state
        self.groupPermissionIds = groupPermissionIds
        self.hadoopDeleteJobIds = hadoopDeleteJobIds
        self.version = version
        self.deleted = deleted
        self.disableFieldStats = disableFieldStats
        self.disableSampling = disableSampling
        self.fieldStatsMinimumExecutionPeriod = fieldStatsMinimumExecutionPeriod
        self.samplingMinimumExecutionPeriod = samplingMinimumExecutionPeriod
        self.aggregationMinimumExecutionPeriod = aggregationMinimumExecutionPeriod
        self.versionedCollectionId = versionedCollectionId
        self.importFlowId = importFlowId
        self.importFlowIds = importFlowIds
        self.indexingPolicy = indexingPolicy
        self.ageOffEnabled = ageOffEnabled
        self.ageOffDays = ageOffDays
        self.ageOffIndexDays = ageOffIndexDays

    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.id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.description = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I64:
                    self.indexingPolicyId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.SET:
                    self.tags = set()
                    (_etype120, _size117) = iprot.readSetBegin()
                    for _i121 in range(_size117):
                        _elem122 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        self.tags.add(_elem122)
                    iprot.readSetEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.I64:
                    self.userId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 7:
                if ftype == TType.I64:
                    self.createdTimestamp = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 8:
                if ftype == TType.I64:
                    self.updatedTimestamp = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 9:
                if ftype == TType.I64:
                    self.recordCountUpdatedTimestamp = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 10:
                if ftype == TType.I64:
                    self.recordCount = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 11:
                if ftype == TType.I64:
                    self.sizeInBytes = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 12:
                if ftype == TType.I32:
                    self.state = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 13:
                if ftype == TType.LIST:
                    self.groupPermissionIds = []
                    (_etype126, _size123) = iprot.readListBegin()
                    for _i127 in range(_size123):
                        _elem128 = iprot.readI64()
                        self.groupPermissionIds.append(_elem128)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 14:
                if ftype == TType.LIST:
                    self.hadoopDeleteJobIds = []
                    (_etype132, _size129) = iprot.readListBegin()
                    for _i133 in range(_size129):
                        _elem134 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        self.hadoopDeleteJobIds.append(_elem134)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 15:
                if ftype == TType.I64:
                    self.version = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 16:
                if ftype == TType.BOOL:
                    self.deleted = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 17:
                if ftype == TType.BOOL:
                    self.disableFieldStats = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 18:
                if ftype == TType.BOOL:
                    self.disableSampling = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 19:
                if ftype == TType.I64:
                    self.fieldStatsMinimumExecutionPeriod = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 20:
                if ftype == TType.I64:
                    self.samplingMinimumExecutionPeriod = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 21:
                if ftype == TType.I64:
                    self.aggregationMinimumExecutionPeriod = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 22:
                if ftype == TType.STRING:
                    self.versionedCollectionId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 23:
                if ftype == TType.I64:
                    self.importFlowId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 24:
                if ftype == TType.LIST:
                    self.importFlowIds = []
                    (_etype138, _size135) = iprot.readListBegin()
                    for _i139 in range(_size135):
                        _elem140 = iprot.readI64()
                        self.importFlowIds.append(_elem140)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 25:
                if ftype == TType.STRUCT:
                    self.indexingPolicy = TIndexingPolicy()
                    self.indexingPolicy.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 26:
                if ftype == TType.BOOL:
                    self.ageOffEnabled = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 27:
                if ftype == TType.I64:
                    self.ageOffDays = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 28:
                if ftype == TType.I64:
                    self.ageOffIndexDays = iprot.readI64()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        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('TCollection')
        if self.id is not None:
            oprot.writeFieldBegin('id', TType.STRING, 1)
            oprot.writeString(self.id.encode('utf-8') if sys.version_info[0] == 2 else self.id)
            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.description is not None:
            oprot.writeFieldBegin('description', TType.STRING, 3)
            oprot.writeString(self.description.encode('utf-8') if sys.version_info[0] == 2 else self.description)
            oprot.writeFieldEnd()
        if self.indexingPolicyId is not None:
            oprot.writeFieldBegin('indexingPolicyId', TType.I64, 4)
            oprot.writeI64(self.indexingPolicyId)
            oprot.writeFieldEnd()
        if self.tags is not None:
            oprot.writeFieldBegin('tags', TType.SET, 5)
            oprot.writeSetBegin(TType.STRING, len(self.tags))
            for iter141 in self.tags:
                oprot.writeString(iter141.encode('utf-8') if sys.version_info[0] == 2 else iter141)
            oprot.writeSetEnd()
            oprot.writeFieldEnd()
        if self.userId is not None:
            oprot.writeFieldBegin('userId', TType.I64, 6)
            oprot.writeI64(self.userId)
            oprot.writeFieldEnd()
        if self.createdTimestamp is not None:
            oprot.writeFieldBegin('createdTimestamp', TType.I64, 7)
            oprot.writeI64(self.createdTimestamp)
            oprot.writeFieldEnd()
        if self.updatedTimestamp is not None:
            oprot.writeFieldBegin('updatedTimestamp', TType.I64, 8)
            oprot.writeI64(self.updatedTimestamp)
            oprot.writeFieldEnd()
        if self.recordCountUpdatedTimestamp is not None:
            oprot.writeFieldBegin('recordCountUpdatedTimestamp', TType.I64, 9)
            oprot.writeI64(self.recordCountUpdatedTimestamp)
            oprot.writeFieldEnd()
        if self.recordCount is not None:
            oprot.writeFieldBegin('recordCount', TType.I64, 10)
            oprot.writeI64(self.recordCount)
            oprot.writeFieldEnd()
        if self.sizeInBytes is not None:
            oprot.writeFieldBegin('sizeInBytes', TType.I64, 11)
            oprot.writeI64(self.sizeInBytes)
            oprot.writeFieldEnd()
        if self.state is not None:
            oprot.writeFieldBegin('state', TType.I32, 12)
            oprot.writeI32(self.state)
            oprot.writeFieldEnd()
        if self.groupPermissionIds is not None:
            oprot.writeFieldBegin('groupPermissionIds', TType.LIST, 13)
            oprot.writeListBegin(TType.I64, len(self.groupPermissionIds))
            for iter142 in self.groupPermissionIds:
                oprot.writeI64(iter142)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.hadoopDeleteJobIds is not None:
            oprot.writeFieldBegin('hadoopDeleteJobIds', TType.LIST, 14)
            oprot.writeListBegin(TType.STRING, len(self.hadoopDeleteJobIds))
            for iter143 in self.hadoopDeleteJobIds:
                oprot.writeString(iter143.encode('utf-8') if sys.version_info[0] == 2 else iter143)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.version is not None:
            oprot.writeFieldBegin('version', TType.I64, 15)
            oprot.writeI64(self.version)
            oprot.writeFieldEnd()
        if self.deleted is not None:
            oprot.writeFieldBegin('deleted', TType.BOOL, 16)
            oprot.writeBool(self.deleted)
            oprot.writeFieldEnd()
        if self.disableFieldStats is not None:
            oprot.writeFieldBegin('disableFieldStats', TType.BOOL, 17)
            oprot.writeBool(self.disableFieldStats)
            oprot.writeFieldEnd()
        if self.disableSampling is not None:
            oprot.writeFieldBegin('disableSampling', TType.BOOL, 18)
            oprot.writeBool(self.disableSampling)
            oprot.writeFieldEnd()
        if self.fieldStatsMinimumExecutionPeriod is not None:
            oprot.writeFieldBegin('fieldStatsMinimumExecutionPeriod', TType.I64, 19)
            oprot.writeI64(self.fieldStatsMinimumExecutionPeriod)
            oprot.writeFieldEnd()
        if self.samplingMinimumExecutionPeriod is not None:
            oprot.writeFieldBegin('samplingMinimumExecutionPeriod', TType.I64, 20)
            oprot.writeI64(self.samplingMinimumExecutionPeriod)
            oprot.writeFieldEnd()
        if self.aggregationMinimumExecutionPeriod is not None:
            oprot.writeFieldBegin('aggregationMinimumExecutionPeriod', TType.I64, 21)
            oprot.writeI64(self.aggregationMinimumExecutionPeriod)
            oprot.writeFieldEnd()
        if self.versionedCollectionId is not None:
            oprot.writeFieldBegin('versionedCollectionId', TType.STRING, 22)
            oprot.writeString(self.versionedCollectionId.encode('utf-8') if sys.version_info[0] == 2 else self.versionedCollectionId)
            oprot.writeFieldEnd()
        if self.importFlowId is not None:
            oprot.writeFieldBegin('importFlowId', TType.I64, 23)
            oprot.writeI64(self.importFlowId)
            oprot.writeFieldEnd()
        if self.importFlowIds is not None:
            oprot.writeFieldBegin('importFlowIds', TType.LIST, 24)
            oprot.writeListBegin(TType.I64, len(self.importFlowIds))
            for iter144 in self.importFlowIds:
                oprot.writeI64(iter144)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.indexingPolicy is not None:
            oprot.writeFieldBegin('indexingPolicy', TType.STRUCT, 25)
            self.indexingPolicy.write(oprot)
            oprot.writeFieldEnd()
        if self.ageOffEnabled is not None:
            oprot.writeFieldBegin('ageOffEnabled', TType.BOOL, 26)
            oprot.writeBool(self.ageOffEnabled)
            oprot.writeFieldEnd()
        if self.ageOffDays is not None:
            oprot.writeFieldBegin('ageOffDays', TType.I64, 27)
            oprot.writeI64(self.ageOffDays)
            oprot.writeFieldEnd()
        if self.ageOffIndexDays is not None:
            oprot.writeFieldBegin('ageOffIndexDays', TType.I64, 28)
            oprot.writeI64(self.ageOffIndexDays)
            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 TCollectionSchema(object):
    """
    Attributes:
     - root
    """


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

    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.root = TCollectionSchemaStructureFieldType()
                    self.root.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        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('TCollectionSchema')
        if self.root is not None:
            oprot.writeFieldBegin('root', TType.STRUCT, 1)
            self.root.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 TCollectionSchemaStructureFieldType(object):
    """
    Attributes:
     - fieldTypes
    """


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

    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.MAP:
                    self.fieldTypes = {}
                    (_ktype146, _vtype147, _size145) = iprot.readMapBegin()
                    for _i149 in range(_size145):
                        _key150 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        _val151 = {}
                        (_ktype153, _vtype154, _size152) = iprot.readMapBegin()
                        for _i156 in range(_size152):
                            _key157 = TCollectionSchemaFieldType()
                            _key157.read(iprot)
                            _val158 = iprot.readI64()
                            _val151[_key157] = _val158
                        iprot.readMapEnd()
                        self.fieldTypes[_key150] = _val151
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        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('TCollectionSchemaStructureFieldType')
        if self.fieldTypes is not None:
            oprot.writeFieldBegin('fieldTypes', TType.MAP, 1)
            oprot.writeMapBegin(TType.STRING, TType.MAP, len(self.fieldTypes))
            for kiter159, viter160 in self.fieldTypes.items():
                oprot.writeString(kiter159.encode('utf-8') if sys.version_info[0] == 2 else kiter159)
                oprot.writeMapBegin(TType.STRUCT, TType.I64, len(viter160))
                for kiter161, viter162 in viter160.items():
                    kiter161.write(oprot)
                    oprot.writeI64(viter162)
                oprot.writeMapEnd()
            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 TCollectionSchemaArrayFieldType(object):
    """
    Attributes:
     - fieldTypes
    """


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

    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.MAP:
                    self.fieldTypes = {}
                    (_ktype164, _vtype165, _size163) = iprot.readMapBegin()
                    for _i167 in range(_size163):
                        _key168 = TCollectionSchemaFieldType()
                        _key168.read(iprot)
                        _val169 = iprot.readI64()
                        self.fieldTypes[_key168] = _val169
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        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('TCollectionSchemaArrayFieldType')
        if self.fieldTypes is not None:
            oprot.writeFieldBegin('fieldTypes', TType.MAP, 1)
            oprot.writeMapBegin(TType.STRUCT, TType.I64, len(self.fieldTypes))
            for kiter170, viter171 in self.fieldTypes.items():
                kiter170.write(oprot)
                oprot.writeI64(viter171)
            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 TCollectionSchemaScalarFieldType(object):
    """
    Attributes:
     - valueTypes
    """


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

    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.MAP:
                    self.valueTypes = {}
                    (_ktype173, _vtype174, _size172) = iprot.readMapBegin()
                    for _i176 in range(_size172):
                        _key177 = iprot.readI32()
                        _val178 = iprot.readI64()
                        self.valueTypes[_key177] = _val178
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        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('TCollectionSchemaScalarFieldType')
        if self.valueTypes is not None:
            oprot.writeFieldBegin('valueTypes', TType.MAP, 1)
            oprot.writeMapBegin(TType.I32, TType.I64, len(self.valueTypes))
            for kiter179, viter180 in self.valueTypes.items():
                oprot.writeI32(kiter179)
                oprot.writeI64(viter180)
            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 TCollectionSchemaFieldType(object):
    """
    Attributes:
     - structure
     - array
     - scalar
    """


    def __init__(self, structure=None, array=None, scalar=None,):
        self.structure = structure
        self.array = array
        self.scalar = scalar

    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.structure = TCollectionSchemaStructureFieldType()
                    self.structure.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRUCT:
                    self.array = TCollectionSchemaArrayFieldType()
                    self.array.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRUCT:
                    self.scalar = TCollectionSchemaScalarFieldType()
                    self.scalar.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        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('TCollectionSchemaFieldType')
        if self.structure is not None:
            oprot.writeFieldBegin('structure', TType.STRUCT, 1)
            self.structure.write(oprot)
            oprot.writeFieldEnd()
        if self.array is not None:
            oprot.writeFieldBegin('array', TType.STRUCT, 2)
            self.array.write(oprot)
            oprot.writeFieldEnd()
        if self.scalar is not None:
            oprot.writeFieldBegin('scalar', TType.STRUCT, 3)
            self.scalar.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 TDataSetAttributeType(object):
    """
    Attributes:
     - name
     - displayName
     - prevalence
    """


    def __init__(self, name=None, displayName=None, prevalence=None,):
        self.name = name
        self.displayName = displayName
        self.prevalence = prevalence

    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.name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.displayName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.DOUBLE:
                    self.prevalence = iprot.readDouble()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        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('TDataSetAttributeType')
        if self.name is not None:
            oprot.writeFieldBegin('name', TType.STRING, 1)
            oprot.writeString(self.name.encode('utf-8') if sys.version_info[0] == 2 else self.name)
            oprot.writeFieldEnd()
        if self.displayName is not None:
            oprot.writeFieldBegin('displayName', TType.STRING, 2)
            oprot.writeString(self.displayName.encode('utf-8') if sys.version_info[0] == 2 else self.displayName)
            oprot.writeFieldEnd()
        if self.prevalence is not None:
            oprot.writeFieldBegin('prevalence', TType.DOUBLE, 3)
            oprot.writeDouble(self.prevalence)
            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 TCoordinateValues(object):
    """
    Attributes:
     - lat
     - lon
    """


    def __init__(self, lat=None, lon=None,):
        self.lat = lat
        self.lon = lon

    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.DOUBLE:
                    self.lat = iprot.readDouble()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.DOUBLE:
                    self.lon = iprot.readDouble()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        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('TCoordinateValues')
        if self.lat is not None:
            oprot.writeFieldBegin('lat', TType.DOUBLE, 1)
            oprot.writeDouble(self.lat)
            oprot.writeFieldEnd()
        if self.lon is not None:
            oprot.writeFieldBegin('lon', TType.DOUBLE, 2)
            oprot.writeDouble(self.lon)
            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 TDataSetAttributeValueCount(object):
    """
    Attributes:
     - value
     - occurances
     - coordinates
     - countryId
     - opacity
    """


    def __init__(self, value=None, occurances=None, coordinates=None, countryId=None, opacity=None,):
        self.value = value
        self.occurances = occurances
        self.coordinates = coordinates
        self.countryId = countryId
        self.opacity = opacity

    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.value = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I64:
                    self.occurances = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRUCT:
                    self.coordinates = TCoordinateValues()
                    self.coordinates.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRING:
                    self.countryId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.DOUBLE:
                    self.opacity = iprot.readDouble()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        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('TDataSetAttributeValueCount')
        if self.value is not None:
            oprot.writeFieldBegin('value', TType.STRING, 1)
            oprot.writeString(self.value.encode('utf-8') if sys.version_info[0] == 2 else self.value)
            oprot.writeFieldEnd()
        if self.occurances is not None:
            oprot.writeFieldBegin('occurances', TType.I64, 2)
            oprot.writeI64(self.occurances)
            oprot.writeFieldEnd()
        if self.coordinates is not None:
            oprot.writeFieldBegin('coordinates', TType.STRUCT, 3)
            self.coordinates.write(oprot)
            oprot.writeFieldEnd()
        if self.countryId is not None:
            oprot.writeFieldBegin('countryId', TType.STRING, 4)
            oprot.writeString(self.countryId.encode('utf-8') if sys.version_info[0] == 2 else self.countryId)
            oprot.writeFieldEnd()
        if self.opacity is not None:
            oprot.writeFieldBegin('opacity', TType.DOUBLE, 5)
            oprot.writeDouble(self.opacity)
            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 TDataSetAttribute(object):
    """
    Attributes:
     - id
     - dataSetId
     - name
     - presenceCount
     - uniqueValueCount
     - valueCount
     - visualizationType
     - types
     - values
     - indexed
     - masked
     - exceptedGroupIds
    """


    def __init__(self, id=None, dataSetId=None, name=None, presenceCount=None, uniqueValueCount=None, valueCount=None, visualizationType=None, types=None, values=None, indexed=None, masked=None, exceptedGroupIds=None,):
        self.id = id
        self.dataSetId = dataSetId
        self.name = name
        self.presenceCount = presenceCount
        self.uniqueValueCount = uniqueValueCount
        self.valueCount = valueCount
        self.visualizationType = visualizationType
        self.types = types
        self.values = values
        self.indexed = indexed
        self.masked = masked
        self.exceptedGroupIds = exceptedGroupIds

    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.id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.dataSetId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I64:
                    self.presenceCount = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.I64:
                    self.uniqueValueCount = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.I64:
                    self.valueCount = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 7:
                if ftype == TType.STRING:
                    self.visualizationType = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 8:
                if ftype == TType.LIST:
                    self.types = []
                    (_etype184, _size181) = iprot.readListBegin()
                    for _i185 in range(_size181):
                        _elem186 = TDataSetAttributeType()
                        _elem186.read(iprot)
                        self.types.append(_elem186)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 9:
                if ftype == TType.LIST:
                    self.values = []
                    (_etype190, _size187) = iprot.readListBegin()
                    for _i191 in range(_size187):
                        _elem192 = TDataSetAttributeValueCount()
                        _elem192.read(iprot)
                        self.values.append(_elem192)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 10:
                if ftype == TType.BOOL:
                    self.indexed = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 11:
                if ftype == TType.BOOL:
                    self.masked = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 12:
                if ftype == TType.LIST:
                    self.exceptedGroupIds = []
                    (_etype196, _size193) = iprot.readListBegin()
                    for _i197 in range(_size193):
                        _elem198 = iprot.readI64()
                        self.exceptedGroupIds.append(_elem198)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        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('TDataSetAttribute')
        if self.id is not None:
            oprot.writeFieldBegin('id', TType.STRING, 1)
            oprot.writeString(self.id.encode('utf-8') if sys.version_info[0] == 2 else self.id)
            oprot.writeFieldEnd()
        if self.dataSetId is not None:
            oprot.writeFieldBegin('dataSetId', TType.STRING, 2)
            oprot.writeString(self.dataSetId.encode('utf-8') if sys.version_info[0] == 2 else self.dataSetId)
            oprot.writeFieldEnd()
        if self.name is not None:
            oprot.writeFieldBegin('name', TType.STRING, 3)
            oprot.writeString(self.name.encode('utf-8') if sys.version_info[0] == 2 else self.name)
            oprot.writeFieldEnd()
        if self.presenceCount is not None:
            oprot.writeFieldBegin('presenceCount', TType.I64, 4)
            oprot.writeI64(self.presenceCount)
            oprot.writeFieldEnd()
        if self.uniqueValueCount is not None:
            oprot.writeFieldBegin('uniqueValueCount', TType.I64, 5)
            oprot.writeI64(self.uniqueValueCount)
            oprot.writeFieldEnd()
        if self.valueCount is not None:
            oprot.writeFieldBegin('valueCount', TType.I64, 6)
            oprot.writeI64(self.valueCount)
            oprot.writeFieldEnd()
        if self.visualizationType is not None:
            oprot.writeFieldBegin('visualizationType', TType.STRING, 7)
            oprot.writeString(self.visualizationType.encode('utf-8') if sys.version_info[0] == 2 else self.visualizationType)
            oprot.writeFieldEnd()
        if self.types is not None:
            oprot.writeFieldBegin('types', TType.LIST, 8)
            oprot.writeListBegin(TType.STRUCT, len(self.types))
            for iter199 in self.types:
                iter199.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.values is not None:
            oprot.writeFieldBegin('values', TType.LIST, 9)
            oprot.writeListBegin(TType.STRUCT, len(self.values))
            for iter200 in self.values:
                iter200.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.indexed is not None:
            oprot.writeFieldBegin('indexed', TType.BOOL, 10)
            oprot.writeBool(self.indexed)
            oprot.writeFieldEnd()
        if self.masked is not None:
            oprot.writeFieldBegin('masked', TType.BOOL, 11)
            oprot.writeBool(self.masked)
            oprot.writeFieldEnd()
        if self.exceptedGroupIds is not None:
            oprot.writeFieldBegin('exceptedGroupIds', TType.LIST, 12)
            oprot.writeListBegin(TType.I64, len(self.exceptedGroupIds))
            for iter201 in self.exceptedGroupIds:
                oprot.writeI64(iter201)
            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 TLabelAssignment(object):
    """
    Attributes:
     - id
     - labelId
     - dataSetId
    """


    def __init__(self, id=None, labelId=None, dataSetId=None,):
        self.id = id
        self.labelId = labelId
        self.dataSetId = dataSetId

    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.id = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I64:
                    self.labelId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.dataSetId = iprot.readString().decode('utf-8') 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):
        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('TLabelAssignment')
        if self.id is not None:
            oprot.writeFieldBegin('id', TType.I64, 1)
            oprot.writeI64(self.id)
            oprot.writeFieldEnd()
        if self.labelId is not None:
            oprot.writeFieldBegin('labelId', TType.I64, 2)
            oprot.writeI64(self.labelId)
            oprot.writeFieldEnd()
        if self.dataSetId is not None:
            oprot.writeFieldBegin('dataSetId', TType.STRING, 3)
            oprot.writeString(self.dataSetId.encode('utf-8') if sys.version_info[0] == 2 else self.dataSetId)
            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 TFlatCollectionSchema(object):
    """
    Attributes:
     - root
    """


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

    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.root = TFlatSchemaStructureFieldType()
                    self.root.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        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('TFlatCollectionSchema')
        if self.root is not None:
            oprot.writeFieldBegin('root', TType.STRUCT, 1)
            self.root.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 TFlatSchemaStructureFieldType(object):
    """
    Attributes:
     - fieldTypes
    """


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

    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.MAP:
                    self.fieldTypes = {}
                    (_ktype203, _vtype204, _size202) = iprot.readMapBegin()
                    for _i206 in range(_size202):
                        _key207 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        _val208 = TFlatSchemaFieldType()
                        _val208.read(iprot)
                        self.fieldTypes[_key207] = _val208
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        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('TFlatSchemaStructureFieldType')
        if self.fieldTypes is not None:
            oprot.writeFieldBegin('fieldTypes', TType.MAP, 1)
            oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.fieldTypes))
            for kiter209, viter210 in self.fieldTypes.items():
                oprot.writeString(kiter209.encode('utf-8') if sys.version_info[0] == 2 else kiter209)
                viter210.write(oprot)
            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 TFlatSchemaArrayFieldType(object):
    """
    Attributes:
     - fieldType
    """


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

    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.fieldType = TFlatSchemaFieldType()
                    self.fieldType.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        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('TFlatSchemaArrayFieldType')
        if self.fieldType is not None:
            oprot.writeFieldBegin('fieldType', TType.STRUCT, 1)
            self.fieldType.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 TFlatSchemaScalarFieldType(object):
    """
    Attributes:
     - fieldValueType
    """


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

    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.fieldValueType = iprot.readI32()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        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('TFlatSchemaScalarFieldType')
        if self.fieldValueType is not None:
            oprot.writeFieldBegin('fieldValueType', TType.I32, 1)
            oprot.writeI32(self.fieldValueType)
            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 TFlatSchemaFieldType(object):
    """
    Attributes:
     - structure
     - array
     - scalar
    """


    def __init__(self, structure=None, array=None, scalar=None,):
        self.structure = structure
        self.array = array
        self.scalar = scalar

    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.structure = TFlatSchemaStructureFieldType()
                    self.structure.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRUCT:
                    self.array = TFlatSchemaArrayFieldType()
                    self.array.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRUCT:
                    self.scalar = TFlatSchemaScalarFieldType()
                    self.scalar.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        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('TFlatSchemaFieldType')
        if self.structure is not None:
            oprot.writeFieldBegin('structure', TType.STRUCT, 1)
            self.structure.write(oprot)
            oprot.writeFieldEnd()
        if self.array is not None:
            oprot.writeFieldBegin('array', TType.STRUCT, 2)
            self.array.write(oprot)
            oprot.writeFieldEnd()
        if self.scalar is not None:
            oprot.writeFieldBegin('scalar', TType.STRUCT, 3)
            self.scalar.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 TMaskedAttribute(object):
    """
    Attributes:
     - id
     - name
     - exceptedGroupIds
    """


    def __init__(self, id=None, name=None, exceptedGroupIds=None,):
        self.id = id
        self.name = name
        self.exceptedGroupIds = exceptedGroupIds

    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.id = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.LIST:
                    self.exceptedGroupIds = []
                    (_etype214, _size211) = iprot.readListBegin()
                    for _i215 in range(_size211):
                        _elem216 = iprot.readI64()
                        self.exceptedGroupIds.append(_elem216)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        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('TMaskedAttribute')
        if self.id is not None:
            oprot.writeFieldBegin('id', TType.I64, 1)
            oprot.writeI64(self.id)
            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.exceptedGroupIds is not None:
            oprot.writeFieldBegin('exceptedGroupIds', TType.LIST, 3)
            oprot.writeListBegin(TType.I64, len(self.exceptedGroupIds))
            for iter217 in self.exceptedGroupIds:
                oprot.writeI64(iter217)
            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 TMaskedAttributes(object):
    """
    Attributes:
     - dataSetId
     - attributes
    """


    def __init__(self, dataSetId=None, attributes=None,):
        self.dataSetId = dataSetId
        self.attributes = attributes

    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.dataSetId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.LIST:
                    self.attributes = []
                    (_etype221, _size218) = iprot.readListBegin()
                    for _i222 in range(_size218):
                        _elem223 = TMaskedAttribute()
                        _elem223.read(iprot)
                        self.attributes.append(_elem223)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        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('TMaskedAttributes')
        if self.dataSetId is not None:
            oprot.writeFieldBegin('dataSetId', TType.STRING, 1)
            oprot.writeString(self.dataSetId.encode('utf-8') if sys.version_info[0] == 2 else self.dataSetId)
            oprot.writeFieldEnd()
        if self.attributes is not None:
            oprot.writeFieldBegin('attributes', TType.LIST, 2)
            oprot.writeListBegin(TType.STRUCT, len(self.attributes))
            for iter224 in self.attributes:
                iter224.write(oprot)
            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)
all_structs.append(TFieldTypePair)
TFieldTypePair.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'fieldName', 'UTF8', None, ),  # 1
    (2, TType.STRING, 'fieldType', 'UTF8', None, ),  # 2
)
all_structs.append(TFieldDetails)
TFieldDetails.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'fieldName', 'UTF8', None, ),  # 1
    (2, TType.MAP, 'typeHistogram', (TType.STRING, 'UTF8', TType.I64, None, False), None, ),  # 2
    (3, TType.MAP, 'lengthsHistogram', (TType.I32, None, TType.I64, None, False), None, ),  # 3
    (4, TType.I64, 'recordCount', None, None, ),  # 4
)
all_structs.append(TIndexTermConfiguration)
TIndexTermConfiguration.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'indexTermTransformerClassName', 'UTF8', None, ),  # 1
    (2, TType.MAP, 'parameters', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ),  # 2
)
all_structs.append(TFieldTypeIndexTermConfigurationPair)
TFieldTypeIndexTermConfigurationPair.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'fieldTypePair', [TFieldTypePair, None], None, ),  # 1
    (2, TType.STRUCT, 'indexTermConfiguration', [TIndexTermConfiguration, None], None, ),  # 2
)
all_structs.append(TIndexingPolicy)
TIndexingPolicy.thrift_spec = (
    None,  # 0
    (1, TType.I32, 'fieldMode', None, None, ),  # 1
    (2, TType.SET, 'fields', (TType.STRING, 'UTF8', False), None, ),  # 2
    (3, TType.LIST, 'fieldTermConfigurations', (TType.STRUCT, [TFieldTypeIndexTermConfigurationPair, None], False), None, ),  # 3
    (4, TType.LIST, 'compositeIndexes', (TType.LIST, (TType.STRUCT, [TFieldTypePair, None], False), False), None, ),  # 4
    (5, TType.BOOL, 'createValueOnlyIndices', None, None, ),  # 5
    (6, TType.I64, 'id', None, None, ),  # 6
    (7, TType.STRING, 'dataSetId', 'UTF8', None, ),  # 7
    (8, TType.BOOL, 'foreignLanguageIndexing', None, None, ),  # 8
)
all_structs.append(TIndexTermTransformerDescriptor)
TIndexTermTransformerDescriptor.thrift_spec = (
    None,  # 0
    (1, TType.LIST, 'inputParameters', (TType.STRUCT, [koverse.thriftgen.ttypes.TParameter, None], False), None, ),  # 1
    (2, TType.STRING, 'name', 'UTF8', None, ),  # 2
    (3, TType.SET, 'fieldTypes', (TType.STRING, 'UTF8', False), None, ),  # 3
    (4, TType.STRING, 'implementingClassName', 'UTF8', None, ),  # 4
)
all_structs.append(TCollectionStatus)
TCollectionStatus.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'id', None, None, ),  # 1
    (2, TType.I64, 'creationTimestamp', None, None, ),  # 2
    (3, TType.I64, 'recordCount', None, None, ),  # 3
    (4, TType.I64, 'interval', None, None, ),  # 4
    (5, TType.STRING, 'collectionId', 'UTF8', None, ),  # 5
)
all_structs.append(TFieldStatistics)
TFieldStatistics.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'collectionId', 'UTF8', None, ),  # 1
    (2, TType.STRING, 'fieldName', 'UTF8', None, ),  # 2
    (3, TType.MAP, 'typeHistogram', (TType.STRING, 'UTF8', TType.I64, None, False), None, ),  # 3
    (4, TType.MAP, 'lengthsHistogram', (TType.I32, None, TType.I64, None, False), None, ),  # 4
    (5, TType.I64, 'recordCount', None, None, ),  # 5
    (6, TType.DOUBLE, 'cardinalityEstimate', None, None, ),  # 6
    (7, TType.MAP, 'top40', (TType.STRING, 'UTF8', TType.I32, None, False), None, ),  # 7
    (8, TType.LIST, 'heatmap', (TType.I32, None, False), None, ),  # 8
)
all_structs.append(TCollectionStatistics)
TCollectionStatistics.thrift_spec = (
    None,  # 0
    (1, TType.LIST, 'fieldStatistics', (TType.STRUCT, [TFieldStatistics, None], False), None, ),  # 1
)
all_structs.append(TCollectionGroupPermission)
TCollectionGroupPermission.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'id', None, None, ),  # 1
    (2, TType.I64, 'groupId', None, None, ),  # 2
    (3, TType.LIST, 'permissions', (TType.STRING, 'UTF8', False), None, ),  # 3
    (4, TType.STRING, 'collectionId', 'UTF8', None, ),  # 4
)
all_structs.append(TCollection)
TCollection.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'id', 'UTF8', None, ),  # 1
    (2, TType.STRING, 'name', 'UTF8', None, ),  # 2
    (3, TType.STRING, 'description', 'UTF8', None, ),  # 3
    (4, TType.I64, 'indexingPolicyId', None, None, ),  # 4
    (5, TType.SET, 'tags', (TType.STRING, 'UTF8', False), None, ),  # 5
    (6, TType.I64, 'userId', None, None, ),  # 6
    (7, TType.I64, 'createdTimestamp', None, None, ),  # 7
    (8, TType.I64, 'updatedTimestamp', None, None, ),  # 8
    (9, TType.I64, 'recordCountUpdatedTimestamp', None, None, ),  # 9
    (10, TType.I64, 'recordCount', None, None, ),  # 10
    (11, TType.I64, 'sizeInBytes', None, None, ),  # 11
    (12, TType.I32, 'state', None, None, ),  # 12
    (13, TType.LIST, 'groupPermissionIds', (TType.I64, None, False), None, ),  # 13
    (14, TType.LIST, 'hadoopDeleteJobIds', (TType.STRING, 'UTF8', False), None, ),  # 14
    (15, TType.I64, 'version', None, None, ),  # 15
    (16, TType.BOOL, 'deleted', None, None, ),  # 16
    (17, TType.BOOL, 'disableFieldStats', None, None, ),  # 17
    (18, TType.BOOL, 'disableSampling', None, None, ),  # 18
    (19, TType.I64, 'fieldStatsMinimumExecutionPeriod', None, None, ),  # 19
    (20, TType.I64, 'samplingMinimumExecutionPeriod', None, None, ),  # 20
    (21, TType.I64, 'aggregationMinimumExecutionPeriod', None, None, ),  # 21
    (22, TType.STRING, 'versionedCollectionId', 'UTF8', None, ),  # 22
    (23, TType.I64, 'importFlowId', None, None, ),  # 23
    (24, TType.LIST, 'importFlowIds', (TType.I64, None, False), None, ),  # 24
    (25, TType.STRUCT, 'indexingPolicy', [TIndexingPolicy, None], None, ),  # 25
    (26, TType.BOOL, 'ageOffEnabled', None, None, ),  # 26
    (27, TType.I64, 'ageOffDays', None, None, ),  # 27
    (28, TType.I64, 'ageOffIndexDays', None, None, ),  # 28
)
all_structs.append(TCollectionSchema)
TCollectionSchema.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'root', [TCollectionSchemaStructureFieldType, None], None, ),  # 1
)
all_structs.append(TCollectionSchemaStructureFieldType)
TCollectionSchemaStructureFieldType.thrift_spec = (
    None,  # 0
    (1, TType.MAP, 'fieldTypes', (TType.STRING, 'UTF8', TType.MAP, (TType.STRUCT, [TCollectionSchemaFieldType, None], TType.I64, None, False), False), None, ),  # 1
)
all_structs.append(TCollectionSchemaArrayFieldType)
TCollectionSchemaArrayFieldType.thrift_spec = (
    None,  # 0
    (1, TType.MAP, 'fieldTypes', (TType.STRUCT, [TCollectionSchemaFieldType, None], TType.I64, None, False), None, ),  # 1
)
all_structs.append(TCollectionSchemaScalarFieldType)
TCollectionSchemaScalarFieldType.thrift_spec = (
    None,  # 0
    (1, TType.MAP, 'valueTypes', (TType.I32, None, TType.I64, None, False), None, ),  # 1
)
all_structs.append(TCollectionSchemaFieldType)
TCollectionSchemaFieldType.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'structure', [TCollectionSchemaStructureFieldType, None], None, ),  # 1
    (2, TType.STRUCT, 'array', [TCollectionSchemaArrayFieldType, None], None, ),  # 2
    (3, TType.STRUCT, 'scalar', [TCollectionSchemaScalarFieldType, None], None, ),  # 3
)
all_structs.append(TDataSetAttributeType)
TDataSetAttributeType.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'name', 'UTF8', None, ),  # 1
    (2, TType.STRING, 'displayName', 'UTF8', None, ),  # 2
    (3, TType.DOUBLE, 'prevalence', None, None, ),  # 3
)
all_structs.append(TCoordinateValues)
TCoordinateValues.thrift_spec = (
    None,  # 0
    (1, TType.DOUBLE, 'lat', None, None, ),  # 1
    (2, TType.DOUBLE, 'lon', None, None, ),  # 2
)
all_structs.append(TDataSetAttributeValueCount)
TDataSetAttributeValueCount.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'value', 'UTF8', None, ),  # 1
    (2, TType.I64, 'occurances', None, None, ),  # 2
    (3, TType.STRUCT, 'coordinates', [TCoordinateValues, None], None, ),  # 3
    (4, TType.STRING, 'countryId', 'UTF8', None, ),  # 4
    (5, TType.DOUBLE, 'opacity', None, None, ),  # 5
)
all_structs.append(TDataSetAttribute)
TDataSetAttribute.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'id', 'UTF8', None, ),  # 1
    (2, TType.STRING, 'dataSetId', 'UTF8', None, ),  # 2
    (3, TType.STRING, 'name', 'UTF8', None, ),  # 3
    (4, TType.I64, 'presenceCount', None, None, ),  # 4
    (5, TType.I64, 'uniqueValueCount', None, None, ),  # 5
    (6, TType.I64, 'valueCount', None, None, ),  # 6
    (7, TType.STRING, 'visualizationType', 'UTF8', None, ),  # 7
    (8, TType.LIST, 'types', (TType.STRUCT, [TDataSetAttributeType, None], False), None, ),  # 8
    (9, TType.LIST, 'values', (TType.STRUCT, [TDataSetAttributeValueCount, None], False), None, ),  # 9
    (10, TType.BOOL, 'indexed', None, None, ),  # 10
    (11, TType.BOOL, 'masked', None, None, ),  # 11
    (12, TType.LIST, 'exceptedGroupIds', (TType.I64, None, False), None, ),  # 12
)
all_structs.append(TLabelAssignment)
TLabelAssignment.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'id', None, None, ),  # 1
    (2, TType.I64, 'labelId', None, None, ),  # 2
    (3, TType.STRING, 'dataSetId', 'UTF8', None, ),  # 3
)
all_structs.append(TFlatCollectionSchema)
TFlatCollectionSchema.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'root', [TFlatSchemaStructureFieldType, None], None, ),  # 1
)
all_structs.append(TFlatSchemaStructureFieldType)
TFlatSchemaStructureFieldType.thrift_spec = (
    None,  # 0
    (1, TType.MAP, 'fieldTypes', (TType.STRING, 'UTF8', TType.STRUCT, [TFlatSchemaFieldType, None], False), None, ),  # 1
)
all_structs.append(TFlatSchemaArrayFieldType)
TFlatSchemaArrayFieldType.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'fieldType', [TFlatSchemaFieldType, None], None, ),  # 1
)
all_structs.append(TFlatSchemaScalarFieldType)
TFlatSchemaScalarFieldType.thrift_spec = (
    None,  # 0
    (1, TType.I32, 'fieldValueType', None, None, ),  # 1
)
all_structs.append(TFlatSchemaFieldType)
TFlatSchemaFieldType.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'structure', [TFlatSchemaStructureFieldType, None], None, ),  # 1
    (2, TType.STRUCT, 'array', [TFlatSchemaArrayFieldType, None], None, ),  # 2
    (3, TType.STRUCT, 'scalar', [TFlatSchemaScalarFieldType, None], None, ),  # 3
)
all_structs.append(TMaskedAttribute)
TMaskedAttribute.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'id', None, None, ),  # 1
    (2, TType.STRING, 'name', 'UTF8', None, ),  # 2
    (3, TType.LIST, 'exceptedGroupIds', (TType.I64, None, False), None, ),  # 3
)
all_structs.append(TMaskedAttributes)
TMaskedAttributes.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'dataSetId', 'UTF8', None, ),  # 1
    (2, TType.LIST, 'attributes', (TType.STRUCT, [TMaskedAttribute, None], False), None, ),  # 2
)
fix_spec(all_structs)
del all_structs
