#
# 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 logging
from .ttypes import *
from thrift.Thrift import TProcessor
from thrift.transport import TTransport
all_structs = []


class Iface(object):
    def getPackageVersion(self):
        pass

    def isAdministratorOfAnyProduct(self):
        pass

    def getProducts(self, productEndpointFilter, productNameFilter):
        """
        Parameters:
         - productEndpointFilter
         - productNameFilter
        """
        pass

    def getCurrentProduct(self):
        pass

    def getProductConfiguration(self, productId):
        """
        Parameters:
         - productId
        """
        pass

    def addProduct(self, product):
        """
        Parameters:
         - product
        """
        pass

    def editProduct(self, productId, newConfiguration):
        """
        Parameters:
         - productId
         - newConfiguration
        """
        pass

    def removeProduct(self, productId):
        """
        Parameters:
         - productId
        """
        pass


class Client(Iface):
    def __init__(self, iprot, oprot=None):
        self._iprot = self._oprot = iprot
        if oprot is not None:
            self._oprot = oprot
        self._seqid = 0

    def getPackageVersion(self):
        self.send_getPackageVersion()
        return self.recv_getPackageVersion()

    def send_getPackageVersion(self):
        self._oprot.writeMessageBegin('getPackageVersion', TMessageType.CALL, self._seqid)
        args = getPackageVersion_args()
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_getPackageVersion(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = getPackageVersion_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "getPackageVersion failed: unknown result")

    def isAdministratorOfAnyProduct(self):
        self.send_isAdministratorOfAnyProduct()
        return self.recv_isAdministratorOfAnyProduct()

    def send_isAdministratorOfAnyProduct(self):
        self._oprot.writeMessageBegin('isAdministratorOfAnyProduct', TMessageType.CALL, self._seqid)
        args = isAdministratorOfAnyProduct_args()
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_isAdministratorOfAnyProduct(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = isAdministratorOfAnyProduct_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        if result.requestError is not None:
            raise result.requestError
        raise TApplicationException(TApplicationException.MISSING_RESULT, "isAdministratorOfAnyProduct failed: unknown result")

    def getProducts(self, productEndpointFilter, productNameFilter):
        """
        Parameters:
         - productEndpointFilter
         - productNameFilter
        """
        self.send_getProducts(productEndpointFilter, productNameFilter)
        return self.recv_getProducts()

    def send_getProducts(self, productEndpointFilter, productNameFilter):
        self._oprot.writeMessageBegin('getProducts', TMessageType.CALL, self._seqid)
        args = getProducts_args()
        args.productEndpointFilter = productEndpointFilter
        args.productNameFilter = productNameFilter
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_getProducts(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = getProducts_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        if result.requestError is not None:
            raise result.requestError
        raise TApplicationException(TApplicationException.MISSING_RESULT, "getProducts failed: unknown result")

    def getCurrentProduct(self):
        self.send_getCurrentProduct()
        return self.recv_getCurrentProduct()

    def send_getCurrentProduct(self):
        self._oprot.writeMessageBegin('getCurrentProduct', TMessageType.CALL, self._seqid)
        args = getCurrentProduct_args()
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_getCurrentProduct(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = getCurrentProduct_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        if result.requestError is not None:
            raise result.requestError
        raise TApplicationException(TApplicationException.MISSING_RESULT, "getCurrentProduct failed: unknown result")

    def getProductConfiguration(self, productId):
        """
        Parameters:
         - productId
        """
        self.send_getProductConfiguration(productId)
        return self.recv_getProductConfiguration()

    def send_getProductConfiguration(self, productId):
        self._oprot.writeMessageBegin('getProductConfiguration', TMessageType.CALL, self._seqid)
        args = getProductConfiguration_args()
        args.productId = productId
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_getProductConfiguration(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = getProductConfiguration_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        if result.requestError is not None:
            raise result.requestError
        raise TApplicationException(TApplicationException.MISSING_RESULT, "getProductConfiguration failed: unknown result")

    def addProduct(self, product):
        """
        Parameters:
         - product
        """
        self.send_addProduct(product)
        return self.recv_addProduct()

    def send_addProduct(self, product):
        self._oprot.writeMessageBegin('addProduct', TMessageType.CALL, self._seqid)
        args = addProduct_args()
        args.product = product
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_addProduct(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = addProduct_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        if result.requestError is not None:
            raise result.requestError
        raise TApplicationException(TApplicationException.MISSING_RESULT, "addProduct failed: unknown result")

    def editProduct(self, productId, newConfiguration):
        """
        Parameters:
         - productId
         - newConfiguration
        """
        self.send_editProduct(productId, newConfiguration)
        return self.recv_editProduct()

    def send_editProduct(self, productId, newConfiguration):
        self._oprot.writeMessageBegin('editProduct', TMessageType.CALL, self._seqid)
        args = editProduct_args()
        args.productId = productId
        args.newConfiguration = newConfiguration
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_editProduct(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = editProduct_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        if result.requestError is not None:
            raise result.requestError
        raise TApplicationException(TApplicationException.MISSING_RESULT, "editProduct failed: unknown result")

    def removeProduct(self, productId):
        """
        Parameters:
         - productId
        """
        self.send_removeProduct(productId)
        return self.recv_removeProduct()

    def send_removeProduct(self, productId):
        self._oprot.writeMessageBegin('removeProduct', TMessageType.CALL, self._seqid)
        args = removeProduct_args()
        args.productId = productId
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_removeProduct(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = removeProduct_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        if result.requestError is not None:
            raise result.requestError
        raise TApplicationException(TApplicationException.MISSING_RESULT, "removeProduct failed: unknown result")


class Processor(Iface, TProcessor):
    def __init__(self, handler):
        self._handler = handler
        self._processMap = {}
        self._processMap["getPackageVersion"] = Processor.process_getPackageVersion
        self._processMap["isAdministratorOfAnyProduct"] = Processor.process_isAdministratorOfAnyProduct
        self._processMap["getProducts"] = Processor.process_getProducts
        self._processMap["getCurrentProduct"] = Processor.process_getCurrentProduct
        self._processMap["getProductConfiguration"] = Processor.process_getProductConfiguration
        self._processMap["addProduct"] = Processor.process_addProduct
        self._processMap["editProduct"] = Processor.process_editProduct
        self._processMap["removeProduct"] = Processor.process_removeProduct

    def process(self, iprot, oprot):
        (name, type, seqid) = iprot.readMessageBegin()
        if name not in self._processMap:
            iprot.skip(TType.STRUCT)
            iprot.readMessageEnd()
            x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))
            oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)
            x.write(oprot)
            oprot.writeMessageEnd()
            oprot.trans.flush()
            return
        else:
            self._processMap[name](self, seqid, iprot, oprot)
        return True

    def process_getPackageVersion(self, seqid, iprot, oprot):
        args = getPackageVersion_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getPackageVersion_result()
        try:
            result.success = self._handler.getPackageVersion()
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("getPackageVersion", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_isAdministratorOfAnyProduct(self, seqid, iprot, oprot):
        args = isAdministratorOfAnyProduct_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = isAdministratorOfAnyProduct_result()
        try:
            result.success = self._handler.isAdministratorOfAnyProduct()
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except codechecker_api_shared.ttypes.RequestFailed as requestError:
            msg_type = TMessageType.REPLY
            result.requestError = requestError
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("isAdministratorOfAnyProduct", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getProducts(self, seqid, iprot, oprot):
        args = getProducts_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getProducts_result()
        try:
            result.success = self._handler.getProducts(args.productEndpointFilter, args.productNameFilter)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except codechecker_api_shared.ttypes.RequestFailed as requestError:
            msg_type = TMessageType.REPLY
            result.requestError = requestError
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("getProducts", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getCurrentProduct(self, seqid, iprot, oprot):
        args = getCurrentProduct_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getCurrentProduct_result()
        try:
            result.success = self._handler.getCurrentProduct()
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except codechecker_api_shared.ttypes.RequestFailed as requestError:
            msg_type = TMessageType.REPLY
            result.requestError = requestError
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("getCurrentProduct", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getProductConfiguration(self, seqid, iprot, oprot):
        args = getProductConfiguration_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getProductConfiguration_result()
        try:
            result.success = self._handler.getProductConfiguration(args.productId)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except codechecker_api_shared.ttypes.RequestFailed as requestError:
            msg_type = TMessageType.REPLY
            result.requestError = requestError
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("getProductConfiguration", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_addProduct(self, seqid, iprot, oprot):
        args = addProduct_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = addProduct_result()
        try:
            result.success = self._handler.addProduct(args.product)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except codechecker_api_shared.ttypes.RequestFailed as requestError:
            msg_type = TMessageType.REPLY
            result.requestError = requestError
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("addProduct", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_editProduct(self, seqid, iprot, oprot):
        args = editProduct_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = editProduct_result()
        try:
            result.success = self._handler.editProduct(args.productId, args.newConfiguration)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except codechecker_api_shared.ttypes.RequestFailed as requestError:
            msg_type = TMessageType.REPLY
            result.requestError = requestError
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("editProduct", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_removeProduct(self, seqid, iprot, oprot):
        args = removeProduct_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = removeProduct_result()
        try:
            result.success = self._handler.removeProduct(args.productId)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except codechecker_api_shared.ttypes.RequestFailed as requestError:
            msg_type = TMessageType.REPLY
            result.requestError = requestError
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("removeProduct", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

# HELPER FUNCTIONS AND STRUCTURES


class getPackageVersion_args(object):


    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
            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('getPackageVersion_args')
        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(getPackageVersion_args)
getPackageVersion_args.thrift_spec = (
)


class getPackageVersion_result(object):
    """
    Attributes:
     - success
    """


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

    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 == 0:
                if ftype == TType.STRING:
                    self.success = 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('getPackageVersion_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRING, 0)
            oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success)
            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(getPackageVersion_result)
getPackageVersion_result.thrift_spec = (
    (0, TType.STRING, 'success', 'UTF8', None, ),  # 0
)


class isAdministratorOfAnyProduct_args(object):


    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
            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('isAdministratorOfAnyProduct_args')
        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(isAdministratorOfAnyProduct_args)
isAdministratorOfAnyProduct_args.thrift_spec = (
)


class isAdministratorOfAnyProduct_result(object):
    """
    Attributes:
     - success
     - requestError
    """


    def __init__(self, success=None, requestError=None,):
        self.success = success
        self.requestError = requestError

    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 == 0:
                if ftype == TType.BOOL:
                    self.success = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.requestError = codechecker_api_shared.ttypes.RequestFailed()
                    self.requestError.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('isAdministratorOfAnyProduct_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.BOOL, 0)
            oprot.writeBool(self.success)
            oprot.writeFieldEnd()
        if self.requestError is not None:
            oprot.writeFieldBegin('requestError', TType.STRUCT, 1)
            self.requestError.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)
all_structs.append(isAdministratorOfAnyProduct_result)
isAdministratorOfAnyProduct_result.thrift_spec = (
    (0, TType.BOOL, 'success', None, None, ),  # 0
    (1, TType.STRUCT, 'requestError', [codechecker_api_shared.ttypes.RequestFailed, None], None, ),  # 1
)


class getProducts_args(object):
    """
    Attributes:
     - productEndpointFilter
     - productNameFilter
    """


    def __init__(self, productEndpointFilter=None, productNameFilter=None,):
        self.productEndpointFilter = productEndpointFilter
        self.productNameFilter = productNameFilter

    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.productEndpointFilter = 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.productNameFilter = 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('getProducts_args')
        if self.productEndpointFilter is not None:
            oprot.writeFieldBegin('productEndpointFilter', TType.STRING, 1)
            oprot.writeString(self.productEndpointFilter.encode('utf-8') if sys.version_info[0] == 2 else self.productEndpointFilter)
            oprot.writeFieldEnd()
        if self.productNameFilter is not None:
            oprot.writeFieldBegin('productNameFilter', TType.STRING, 2)
            oprot.writeString(self.productNameFilter.encode('utf-8') if sys.version_info[0] == 2 else self.productNameFilter)
            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(getProducts_args)
getProducts_args.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'productEndpointFilter', 'UTF8', None, ),  # 1
    (2, TType.STRING, 'productNameFilter', 'UTF8', None, ),  # 2
)


class getProducts_result(object):
    """
    Attributes:
     - success
     - requestError
    """


    def __init__(self, success=None, requestError=None,):
        self.success = success
        self.requestError = requestError

    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 == 0:
                if ftype == TType.LIST:
                    self.success = []
                    (_etype17, _size14) = iprot.readListBegin()
                    for _i18 in range(_size14):
                        _elem19 = Product()
                        _elem19.read(iprot)
                        self.success.append(_elem19)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.requestError = codechecker_api_shared.ttypes.RequestFailed()
                    self.requestError.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('getProducts_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.LIST, 0)
            oprot.writeListBegin(TType.STRUCT, len(self.success))
            for iter20 in self.success:
                iter20.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.requestError is not None:
            oprot.writeFieldBegin('requestError', TType.STRUCT, 1)
            self.requestError.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)
all_structs.append(getProducts_result)
getProducts_result.thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT, [Product, None], False), None, ),  # 0
    (1, TType.STRUCT, 'requestError', [codechecker_api_shared.ttypes.RequestFailed, None], None, ),  # 1
)


class getCurrentProduct_args(object):


    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
            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('getCurrentProduct_args')
        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(getCurrentProduct_args)
getCurrentProduct_args.thrift_spec = (
)


class getCurrentProduct_result(object):
    """
    Attributes:
     - success
     - requestError
    """


    def __init__(self, success=None, requestError=None,):
        self.success = success
        self.requestError = requestError

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = Product()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.requestError = codechecker_api_shared.ttypes.RequestFailed()
                    self.requestError.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('getCurrentProduct_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.requestError is not None:
            oprot.writeFieldBegin('requestError', TType.STRUCT, 1)
            self.requestError.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)
all_structs.append(getCurrentProduct_result)
getCurrentProduct_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [Product, None], None, ),  # 0
    (1, TType.STRUCT, 'requestError', [codechecker_api_shared.ttypes.RequestFailed, None], None, ),  # 1
)


class getProductConfiguration_args(object):
    """
    Attributes:
     - productId
    """


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

    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.productId = 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('getProductConfiguration_args')
        if self.productId is not None:
            oprot.writeFieldBegin('productId', TType.I64, 1)
            oprot.writeI64(self.productId)
            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(getProductConfiguration_args)
getProductConfiguration_args.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'productId', None, None, ),  # 1
)


class getProductConfiguration_result(object):
    """
    Attributes:
     - success
     - requestError
    """


    def __init__(self, success=None, requestError=None,):
        self.success = success
        self.requestError = requestError

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = ProductConfiguration()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.requestError = codechecker_api_shared.ttypes.RequestFailed()
                    self.requestError.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('getProductConfiguration_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.requestError is not None:
            oprot.writeFieldBegin('requestError', TType.STRUCT, 1)
            self.requestError.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)
all_structs.append(getProductConfiguration_result)
getProductConfiguration_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [ProductConfiguration, None], None, ),  # 0
    (1, TType.STRUCT, 'requestError', [codechecker_api_shared.ttypes.RequestFailed, None], None, ),  # 1
)


class addProduct_args(object):
    """
    Attributes:
     - product
    """


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

    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.product = ProductConfiguration()
                    self.product.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('addProduct_args')
        if self.product is not None:
            oprot.writeFieldBegin('product', TType.STRUCT, 1)
            self.product.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)
all_structs.append(addProduct_args)
addProduct_args.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'product', [ProductConfiguration, None], None, ),  # 1
)


class addProduct_result(object):
    """
    Attributes:
     - success
     - requestError
    """


    def __init__(self, success=None, requestError=None,):
        self.success = success
        self.requestError = requestError

    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 == 0:
                if ftype == TType.BOOL:
                    self.success = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.requestError = codechecker_api_shared.ttypes.RequestFailed()
                    self.requestError.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('addProduct_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.BOOL, 0)
            oprot.writeBool(self.success)
            oprot.writeFieldEnd()
        if self.requestError is not None:
            oprot.writeFieldBegin('requestError', TType.STRUCT, 1)
            self.requestError.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)
all_structs.append(addProduct_result)
addProduct_result.thrift_spec = (
    (0, TType.BOOL, 'success', None, None, ),  # 0
    (1, TType.STRUCT, 'requestError', [codechecker_api_shared.ttypes.RequestFailed, None], None, ),  # 1
)


class editProduct_args(object):
    """
    Attributes:
     - productId
     - newConfiguration
    """


    def __init__(self, productId=None, newConfiguration=None,):
        self.productId = productId
        self.newConfiguration = newConfiguration

    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.productId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRUCT:
                    self.newConfiguration = ProductConfiguration()
                    self.newConfiguration.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('editProduct_args')
        if self.productId is not None:
            oprot.writeFieldBegin('productId', TType.I64, 1)
            oprot.writeI64(self.productId)
            oprot.writeFieldEnd()
        if self.newConfiguration is not None:
            oprot.writeFieldBegin('newConfiguration', TType.STRUCT, 2)
            self.newConfiguration.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)
all_structs.append(editProduct_args)
editProduct_args.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'productId', None, None, ),  # 1
    (2, TType.STRUCT, 'newConfiguration', [ProductConfiguration, None], None, ),  # 2
)


class editProduct_result(object):
    """
    Attributes:
     - success
     - requestError
    """


    def __init__(self, success=None, requestError=None,):
        self.success = success
        self.requestError = requestError

    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 == 0:
                if ftype == TType.BOOL:
                    self.success = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.requestError = codechecker_api_shared.ttypes.RequestFailed()
                    self.requestError.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('editProduct_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.BOOL, 0)
            oprot.writeBool(self.success)
            oprot.writeFieldEnd()
        if self.requestError is not None:
            oprot.writeFieldBegin('requestError', TType.STRUCT, 1)
            self.requestError.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)
all_structs.append(editProduct_result)
editProduct_result.thrift_spec = (
    (0, TType.BOOL, 'success', None, None, ),  # 0
    (1, TType.STRUCT, 'requestError', [codechecker_api_shared.ttypes.RequestFailed, None], None, ),  # 1
)


class removeProduct_args(object):
    """
    Attributes:
     - productId
    """


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

    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.productId = 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('removeProduct_args')
        if self.productId is not None:
            oprot.writeFieldBegin('productId', TType.I64, 1)
            oprot.writeI64(self.productId)
            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(removeProduct_args)
removeProduct_args.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'productId', None, None, ),  # 1
)


class removeProduct_result(object):
    """
    Attributes:
     - success
     - requestError
    """


    def __init__(self, success=None, requestError=None,):
        self.success = success
        self.requestError = requestError

    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 == 0:
                if ftype == TType.BOOL:
                    self.success = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.requestError = codechecker_api_shared.ttypes.RequestFailed()
                    self.requestError.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('removeProduct_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.BOOL, 0)
            oprot.writeBool(self.success)
            oprot.writeFieldEnd()
        if self.requestError is not None:
            oprot.writeFieldBegin('requestError', TType.STRUCT, 1)
            self.requestError.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)
all_structs.append(removeProduct_result)
removeProduct_result.thrift_spec = (
    (0, TType.BOOL, 'success', None, None, ),  # 0
    (1, TType.STRUCT, 'requestError', [codechecker_api_shared.ttypes.RequestFailed, None], None, ),  # 1
)
fix_spec(all_structs)
del all_structs

