#
# 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.dataflow.ttypes
import koverse.thriftgen.collection.ttypes

from thrift.transport import TTransport
all_structs = []


class TTransformJobConfig(object):
    """
    Attributes:
     - sparkMaster
     - jobName
     - paramsIdsRddConfs
     - params
     - outputDatasetName
     - outputVersionedDatasetId
     - dataSetNamesToIds
     - transformClassName
     - outputConf
     - outputPath
     - schemas
     - timeout
     - koverseRecordTableName
     - accumuloConfig
     - usingKerberos
     - accumuloPrinciple
     - token
     - keytabPath
     - usingDelegationToken
     - securityClassName
     - securityAddonFileName
     - removeEmpty
    """


    def __init__(self, sparkMaster=None, jobName=None, paramsIdsRddConfs=None, params=None, outputDatasetName=None, outputVersionedDatasetId=None, dataSetNamesToIds=None, transformClassName=None, outputConf=None, outputPath=None, schemas=None, timeout=None, koverseRecordTableName=None, accumuloConfig=None, usingKerberos=None, accumuloPrinciple=None, token=None, keytabPath=None, usingDelegationToken=None, securityClassName=None, securityAddonFileName=None, removeEmpty=None,):
        self.sparkMaster = sparkMaster
        self.jobName = jobName
        self.paramsIdsRddConfs = paramsIdsRddConfs
        self.params = params
        self.outputDatasetName = outputDatasetName
        self.outputVersionedDatasetId = outputVersionedDatasetId
        self.dataSetNamesToIds = dataSetNamesToIds
        self.transformClassName = transformClassName
        self.outputConf = outputConf
        self.outputPath = outputPath
        self.schemas = schemas
        self.timeout = timeout
        self.koverseRecordTableName = koverseRecordTableName
        self.accumuloConfig = accumuloConfig
        self.usingKerberos = usingKerberos
        self.accumuloPrinciple = accumuloPrinciple
        self.token = token
        self.keytabPath = keytabPath
        self.usingDelegationToken = usingDelegationToken
        self.securityClassName = securityClassName
        self.securityAddonFileName = securityAddonFileName
        self.removeEmpty = removeEmpty

    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.sparkMaster = 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.jobName = 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.paramsIdsRddConfs = {}
                    (_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 = {}
                        (_ktype8, _vtype9, _size7) = iprot.readMapBegin()
                        for _i11 in range(_size7):
                            _key12 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                            _val13 = {}
                            (_ktype15, _vtype16, _size14) = iprot.readMapBegin()
                            for _i18 in range(_size14):
                                _key19 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                                _val20 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                                _val13[_key19] = _val20
                            iprot.readMapEnd()
                            _val6[_key12] = _val13
                        iprot.readMapEnd()
                        self.paramsIdsRddConfs[_key5] = _val6
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.MAP:
                    self.params = {}
                    (_ktype22, _vtype23, _size21) = iprot.readMapBegin()
                    for _i25 in range(_size21):
                        _key26 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        _val27 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        self.params[_key26] = _val27
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRING:
                    self.outputDatasetName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.STRING:
                    self.outputVersionedDatasetId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 7:
                if ftype == TType.MAP:
                    self.dataSetNamesToIds = {}
                    (_ktype29, _vtype30, _size28) = iprot.readMapBegin()
                    for _i32 in range(_size28):
                        _key33 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        _val34 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        self.dataSetNamesToIds[_key33] = _val34
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 8:
                if ftype == TType.STRING:
                    self.transformClassName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 9:
                if ftype == TType.MAP:
                    self.outputConf = {}
                    (_ktype36, _vtype37, _size35) = iprot.readMapBegin()
                    for _i39 in range(_size35):
                        _key40 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        _val41 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        self.outputConf[_key40] = _val41
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 10:
                if ftype == TType.STRING:
                    self.outputPath = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 11:
                if ftype == TType.MAP:
                    self.schemas = {}
                    (_ktype43, _vtype44, _size42) = iprot.readMapBegin()
                    for _i46 in range(_size42):
                        _key47 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        _val48 = koverse.thriftgen.collection.ttypes.TFlatCollectionSchema()
                        _val48.read(iprot)
                        self.schemas[_key47] = _val48
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 12:
                if ftype == TType.I32:
                    self.timeout = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 13:
                if ftype == TType.STRING:
                    self.koverseRecordTableName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 14:
                if ftype == TType.STRING:
                    self.accumuloConfig = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 15:
                if ftype == TType.BOOL:
                    self.usingKerberos = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 16:
                if ftype == TType.STRING:
                    self.accumuloPrinciple = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 17:
                if ftype == TType.STRING:
                    self.token = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 18:
                if ftype == TType.STRING:
                    self.keytabPath = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 19:
                if ftype == TType.BOOL:
                    self.usingDelegationToken = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 20:
                if ftype == TType.STRING:
                    self.securityClassName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 21:
                if ftype == TType.STRING:
                    self.securityAddonFileName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 22:
                if ftype == TType.BOOL:
                    self.removeEmpty = 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('TTransformJobConfig')
        if self.sparkMaster is not None:
            oprot.writeFieldBegin('sparkMaster', TType.STRING, 1)
            oprot.writeString(self.sparkMaster.encode('utf-8') if sys.version_info[0] == 2 else self.sparkMaster)
            oprot.writeFieldEnd()
        if self.jobName is not None:
            oprot.writeFieldBegin('jobName', TType.STRING, 2)
            oprot.writeString(self.jobName.encode('utf-8') if sys.version_info[0] == 2 else self.jobName)
            oprot.writeFieldEnd()
        if self.paramsIdsRddConfs is not None:
            oprot.writeFieldBegin('paramsIdsRddConfs', TType.MAP, 3)
            oprot.writeMapBegin(TType.STRING, TType.MAP, len(self.paramsIdsRddConfs))
            for kiter49, viter50 in self.paramsIdsRddConfs.items():
                oprot.writeString(kiter49.encode('utf-8') if sys.version_info[0] == 2 else kiter49)
                oprot.writeMapBegin(TType.STRING, TType.MAP, len(viter50))
                for kiter51, viter52 in viter50.items():
                    oprot.writeString(kiter51.encode('utf-8') if sys.version_info[0] == 2 else kiter51)
                    oprot.writeMapBegin(TType.STRING, TType.STRING, len(viter52))
                    for kiter53, viter54 in viter52.items():
                        oprot.writeString(kiter53.encode('utf-8') if sys.version_info[0] == 2 else kiter53)
                        oprot.writeString(viter54.encode('utf-8') if sys.version_info[0] == 2 else viter54)
                    oprot.writeMapEnd()
                oprot.writeMapEnd()
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        if self.params is not None:
            oprot.writeFieldBegin('params', TType.MAP, 4)
            oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.params))
            for kiter55, viter56 in self.params.items():
                oprot.writeString(kiter55.encode('utf-8') if sys.version_info[0] == 2 else kiter55)
                oprot.writeString(viter56.encode('utf-8') if sys.version_info[0] == 2 else viter56)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        if self.outputDatasetName is not None:
            oprot.writeFieldBegin('outputDatasetName', TType.STRING, 5)
            oprot.writeString(self.outputDatasetName.encode('utf-8') if sys.version_info[0] == 2 else self.outputDatasetName)
            oprot.writeFieldEnd()
        if self.outputVersionedDatasetId is not None:
            oprot.writeFieldBegin('outputVersionedDatasetId', TType.STRING, 6)
            oprot.writeString(self.outputVersionedDatasetId.encode('utf-8') if sys.version_info[0] == 2 else self.outputVersionedDatasetId)
            oprot.writeFieldEnd()
        if self.dataSetNamesToIds is not None:
            oprot.writeFieldBegin('dataSetNamesToIds', TType.MAP, 7)
            oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.dataSetNamesToIds))
            for kiter57, viter58 in self.dataSetNamesToIds.items():
                oprot.writeString(kiter57.encode('utf-8') if sys.version_info[0] == 2 else kiter57)
                oprot.writeString(viter58.encode('utf-8') if sys.version_info[0] == 2 else viter58)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        if self.transformClassName is not None:
            oprot.writeFieldBegin('transformClassName', TType.STRING, 8)
            oprot.writeString(self.transformClassName.encode('utf-8') if sys.version_info[0] == 2 else self.transformClassName)
            oprot.writeFieldEnd()
        if self.outputConf is not None:
            oprot.writeFieldBegin('outputConf', TType.MAP, 9)
            oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.outputConf))
            for kiter59, viter60 in self.outputConf.items():
                oprot.writeString(kiter59.encode('utf-8') if sys.version_info[0] == 2 else kiter59)
                oprot.writeString(viter60.encode('utf-8') if sys.version_info[0] == 2 else viter60)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        if self.outputPath is not None:
            oprot.writeFieldBegin('outputPath', TType.STRING, 10)
            oprot.writeString(self.outputPath.encode('utf-8') if sys.version_info[0] == 2 else self.outputPath)
            oprot.writeFieldEnd()
        if self.schemas is not None:
            oprot.writeFieldBegin('schemas', TType.MAP, 11)
            oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.schemas))
            for kiter61, viter62 in self.schemas.items():
                oprot.writeString(kiter61.encode('utf-8') if sys.version_info[0] == 2 else kiter61)
                viter62.write(oprot)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        if self.timeout is not None:
            oprot.writeFieldBegin('timeout', TType.I32, 12)
            oprot.writeI32(self.timeout)
            oprot.writeFieldEnd()
        if self.koverseRecordTableName is not None:
            oprot.writeFieldBegin('koverseRecordTableName', TType.STRING, 13)
            oprot.writeString(self.koverseRecordTableName.encode('utf-8') if sys.version_info[0] == 2 else self.koverseRecordTableName)
            oprot.writeFieldEnd()
        if self.accumuloConfig is not None:
            oprot.writeFieldBegin('accumuloConfig', TType.STRING, 14)
            oprot.writeString(self.accumuloConfig.encode('utf-8') if sys.version_info[0] == 2 else self.accumuloConfig)
            oprot.writeFieldEnd()
        if self.usingKerberos is not None:
            oprot.writeFieldBegin('usingKerberos', TType.BOOL, 15)
            oprot.writeBool(self.usingKerberos)
            oprot.writeFieldEnd()
        if self.accumuloPrinciple is not None:
            oprot.writeFieldBegin('accumuloPrinciple', TType.STRING, 16)
            oprot.writeString(self.accumuloPrinciple.encode('utf-8') if sys.version_info[0] == 2 else self.accumuloPrinciple)
            oprot.writeFieldEnd()
        if self.token is not None:
            oprot.writeFieldBegin('token', TType.STRING, 17)
            oprot.writeString(self.token.encode('utf-8') if sys.version_info[0] == 2 else self.token)
            oprot.writeFieldEnd()
        if self.keytabPath is not None:
            oprot.writeFieldBegin('keytabPath', TType.STRING, 18)
            oprot.writeString(self.keytabPath.encode('utf-8') if sys.version_info[0] == 2 else self.keytabPath)
            oprot.writeFieldEnd()
        if self.usingDelegationToken is not None:
            oprot.writeFieldBegin('usingDelegationToken', TType.BOOL, 19)
            oprot.writeBool(self.usingDelegationToken)
            oprot.writeFieldEnd()
        if self.securityClassName is not None:
            oprot.writeFieldBegin('securityClassName', TType.STRING, 20)
            oprot.writeString(self.securityClassName.encode('utf-8') if sys.version_info[0] == 2 else self.securityClassName)
            oprot.writeFieldEnd()
        if self.securityAddonFileName is not None:
            oprot.writeFieldBegin('securityAddonFileName', TType.STRING, 21)
            oprot.writeString(self.securityAddonFileName.encode('utf-8') if sys.version_info[0] == 2 else self.securityAddonFileName)
            oprot.writeFieldEnd()
        if self.removeEmpty is not None:
            oprot.writeFieldBegin('removeEmpty', TType.BOOL, 22)
            oprot.writeBool(self.removeEmpty)
            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(TTransformJobConfig)
TTransformJobConfig.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'sparkMaster', 'UTF8', None, ),  # 1
    (2, TType.STRING, 'jobName', 'UTF8', None, ),  # 2
    (3, TType.MAP, 'paramsIdsRddConfs', (TType.STRING, 'UTF8', TType.MAP, (TType.STRING, 'UTF8', TType.MAP, (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), False), False), None, ),  # 3
    (4, TType.MAP, 'params', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ),  # 4
    (5, TType.STRING, 'outputDatasetName', 'UTF8', None, ),  # 5
    (6, TType.STRING, 'outputVersionedDatasetId', 'UTF8', None, ),  # 6
    (7, TType.MAP, 'dataSetNamesToIds', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ),  # 7
    (8, TType.STRING, 'transformClassName', 'UTF8', None, ),  # 8
    (9, TType.MAP, 'outputConf', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ),  # 9
    (10, TType.STRING, 'outputPath', 'UTF8', None, ),  # 10
    (11, TType.MAP, 'schemas', (TType.STRING, 'UTF8', TType.STRUCT, [koverse.thriftgen.collection.ttypes.TFlatCollectionSchema, None], False), None, ),  # 11
    (12, TType.I32, 'timeout', None, None, ),  # 12
    (13, TType.STRING, 'koverseRecordTableName', 'UTF8', None, ),  # 13
    (14, TType.STRING, 'accumuloConfig', 'UTF8', None, ),  # 14
    (15, TType.BOOL, 'usingKerberos', None, None, ),  # 15
    (16, TType.STRING, 'accumuloPrinciple', 'UTF8', None, ),  # 16
    (17, TType.STRING, 'token', 'UTF8', None, ),  # 17
    (18, TType.STRING, 'keytabPath', 'UTF8', None, ),  # 18
    (19, TType.BOOL, 'usingDelegationToken', None, None, ),  # 19
    (20, TType.STRING, 'securityClassName', 'UTF8', None, ),  # 20
    (21, TType.STRING, 'securityAddonFileName', 'UTF8', None, ),  # 21
    (22, TType.BOOL, 'removeEmpty', None, None, ),  # 22
)
fix_spec(all_structs)
del all_structs
