#
# 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

from thrift.transport import TTransport
all_structs = []


class QueryExecuteResponse(object):
    """
    Attributes:
     - numStatementsParsed
     - numStatementsSucceeded
     - numStatementsFailed
     - executionTime
    """


    def __init__(self, numStatementsParsed=None, numStatementsSucceeded=None, numStatementsFailed=None, executionTime=None,):
        self.numStatementsParsed = numStatementsParsed
        self.numStatementsSucceeded = numStatementsSucceeded
        self.numStatementsFailed = numStatementsFailed
        self.executionTime = executionTime

    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.numStatementsParsed = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I64:
                    self.numStatementsSucceeded = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I64:
                    self.numStatementsFailed = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.DOUBLE:
                    self.executionTime = 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('QueryExecuteResponse')
        if self.numStatementsParsed is not None:
            oprot.writeFieldBegin('numStatementsParsed', TType.I64, 1)
            oprot.writeI64(self.numStatementsParsed)
            oprot.writeFieldEnd()
        if self.numStatementsSucceeded is not None:
            oprot.writeFieldBegin('numStatementsSucceeded', TType.I64, 2)
            oprot.writeI64(self.numStatementsSucceeded)
            oprot.writeFieldEnd()
        if self.numStatementsFailed is not None:
            oprot.writeFieldBegin('numStatementsFailed', TType.I64, 3)
            oprot.writeI64(self.numStatementsFailed)
            oprot.writeFieldEnd()
        if self.executionTime is not None:
            oprot.writeFieldBegin('executionTime', TType.DOUBLE, 4)
            oprot.writeDouble(self.executionTime)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        if self.numStatementsParsed is None:
            raise TProtocolException(message='Required field numStatementsParsed is unset!')
        if self.numStatementsSucceeded is None:
            raise TProtocolException(message='Required field numStatementsSucceeded is unset!')
        if self.numStatementsFailed is None:
            raise TProtocolException(message='Required field numStatementsFailed is unset!')
        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(QueryExecuteResponse)
QueryExecuteResponse.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'numStatementsParsed', None, None, ),  # 1
    (2, TType.I64, 'numStatementsSucceeded', None, None, ),  # 2
    (3, TType.I64, 'numStatementsFailed', None, None, ),  # 3
    (4, TType.DOUBLE, 'executionTime', None, None, ),  # 4
)
fix_spec(all_structs)
del all_structs
