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

import logging
import sys

from thrift.protocol.TProtocol import TProtocolException
from thrift.Thrift import TApplicationException
from thrift.Thrift import TException
from thrift.Thrift import TFrozenDict
from thrift.Thrift import TMessageType
from thrift.Thrift import TProcessor
from thrift.Thrift import TType
from thrift.transport import TTransport
from thrift.TRecursive import fix_spec

from .ttypes import *


all_structs = []


class Iface(object):
    def buyCoinProduct(self, paymentReservation):
        """
        Parameters:
         - paymentReservation

        """
        pass

    def buyFreeProduct(
        self, receiverMid, productId, messageTemplate, language, country, packageId
    ):
        """
        Parameters:
         - receiverMid
         - productId
         - messageTemplate
         - language
         - country
         - packageId

        """
        pass

    def buyMustbuyProduct(
        self,
        receiverMid,
        productId,
        messageTemplate,
        language,
        country,
        packageId,
        serialNumber,
    ):
        """
        Parameters:
         - receiverMid
         - productId
         - messageTemplate
         - language
         - country
         - packageId
         - serialNumber

        """
        pass

    def checkCanReceivePresent(self, recipientMid, packageId, language, country):
        """
        Parameters:
         - recipientMid
         - packageId
         - language
         - country

        """
        pass

    def getActivePurchases(self, start, size, language, country):
        """
        Parameters:
         - start
         - size
         - language
         - country

        """
        pass

    def getActivePurchaseVersions(self, start, size, language, country):
        """
        Parameters:
         - start
         - size
         - language
         - country

        """
        pass

    def getCoinProducts(self, appStoreCode, country, language):
        """
        Parameters:
         - appStoreCode
         - country
         - language

        """
        pass

    def getCoinProductsByPgCode(self, appStoreCode, pgCode, country, language):
        """
        Parameters:
         - appStoreCode
         - pgCode
         - country
         - language

        """
        pass

    def getCoinPurchaseHistory(self, request):
        """
        Parameters:
         - request

        """
        pass

    def getCoinUseAndRefundHistory(self, request):
        """
        Parameters:
         - request

        """
        pass

    def getDownloads(self, start, size, language, country):
        """
        Parameters:
         - start
         - size
         - language
         - country

        """
        pass

    def getEventPackages(self, start, size, language, country):
        """
        Parameters:
         - start
         - size
         - language
         - country

        """
        pass

    def getNewlyReleasedPackages(self, start, size, language, country):
        """
        Parameters:
         - start
         - size
         - language
         - country

        """
        pass

    def getPopularPackages(self, start, size, language, country):
        """
        Parameters:
         - start
         - size
         - language
         - country

        """
        pass

    def getPresentsReceived(self, start, size, language, country):
        """
        Parameters:
         - start
         - size
         - language
         - country

        """
        pass

    def getPresentsSent(self, start, size, language, country):
        """
        Parameters:
         - start
         - size
         - language
         - country

        """
        pass

    def getProductList(self, productIdList, language, country):
        """
        Parameters:
         - productIdList
         - language
         - country

        """
        pass

    def getProductListWithCarrier(self, productIdList, language, country, carrierCode):
        """
        Parameters:
         - productIdList
         - language
         - country
         - carrierCode

        """
        pass

    def getProductWithCarrier(self, packageID, language, country, carrierCode):
        """
        Parameters:
         - packageID
         - language
         - country
         - carrierCode

        """
        pass

    def getPurchaseHistory(self, start, size, language, country):
        """
        Parameters:
         - start
         - size
         - language
         - country

        """
        pass

    def getTotalBalance(self, appStoreCode):
        """
        Parameters:
         - appStoreCode

        """
        pass

    def notifyDownloaded(self, packageId, language):
        """
        Parameters:
         - packageId
         - language

        """
        pass

    def reserveCoinPurchase(self, request):
        """
        Parameters:
         - request

        """
        pass

    def reservePayment(self, paymentReservation):
        """
        Parameters:
         - paymentReservation

        """
        pass

    def canReceivePresent(self, shopId, productId, locale, recipientMid):
        """
        Parameters:
         - shopId
         - productId
         - locale
         - recipientMid

        """
        pass

    def getAutoSuggestionShowcase(self, autoSuggestionShowcaseRequest):
        """
        Parameters:
         - autoSuggestionShowcaseRequest

        """
        pass

    def getOldSticonMapping(self, req):
        """
        Parameters:
         - req

        """
        pass

    def getOwnedProductSummaries(self, shopId, offset, limit, locale):
        """
        Parameters:
         - shopId
         - offset
         - limit
         - locale

        """
        pass

    def getOwnedProducts(self, shopId, offset, limit, locale):
        """
        Parameters:
         - shopId
         - offset
         - limit
         - locale

        """
        pass

    def getProductByVersion(self, shopId, productId, productVersion, locale):
        """
        Parameters:
         - shopId
         - productId
         - productVersion
         - locale

        """
        pass

    def getProductV2(self, request):
        """
        Parameters:
         - request

        """
        pass

    def getProductValidationScheme(self, shopId, productId, productVersion):
        """
        Parameters:
         - shopId
         - productId
         - productVersion

        """
        pass

    def getProduct(self, shopId, productId, locale):
        """
        Parameters:
         - shopId
         - productId
         - locale

        """
        pass

    def getProductsByAuthor(self, productListByAuthorRequest):
        """
        Parameters:
         - productListByAuthorRequest

        """
        pass

    def getPurchasedProducts(self, shopId, offset, limit, locale):
        """
        Parameters:
         - shopId
         - offset
         - limit
         - locale

        """
        pass

    def getReceivedPresents(self, shopId, offset, limit, locale):
        """
        Parameters:
         - shopId
         - offset
         - limit
         - locale

        """
        pass

    def getRecommendOa(self, req):
        """
        Parameters:
         - req

        """
        pass

    def getRecommendationForUser(self, shopId, offset, limit, locale):
        """
        Parameters:
         - shopId
         - offset
         - limit
         - locale

        """
        pass

    def getRecommendationList(self, getRecommendationRequest):
        """
        Parameters:
         - getRecommendationRequest

        """
        pass

    def getSentPresents(self, shopId, offset, limit, locale):
        """
        Parameters:
         - shopId
         - offset
         - limit
         - locale

        """
        pass

    def getShowcaseV3(self, showcaseRequest):
        """
        Parameters:
         - showcaseRequest

        """
        pass

    def getSuggestDictionarySetting(self, req):
        """
        Parameters:
         - req

        """
        pass

    def getSuggestResourcesV2(self, req):
        """
        Parameters:
         - req

        """
        pass

    def getUpdates(self, shopId, locale):
        """
        Parameters:
         - shopId
         - locale

        """
        pass

    def notifyProductEvent(self, shopId, productId, productVersion, productEvent):
        """
        Parameters:
         - shopId
         - productId
         - productVersion
         - productEvent

        """
        pass

    def placePurchaseOrderForFreeProduct(self, purchaseOrder):
        """
        Parameters:
         - purchaseOrder

        """
        pass

    def placePurchaseOrderWithLineCoin(self, purchaseOrder):
        """
        Parameters:
         - purchaseOrder

        """
        pass

    def validateProduct(self, shopId, productId, productVersion, validationReq):
        """
        Parameters:
         - shopId
         - productId
         - productVersion
         - validationReq

        """
        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 buyCoinProduct(self, paymentReservation):
        """
        Parameters:
         - paymentReservation

        """
        self.send_buyCoinProduct(paymentReservation)
        self.recv_buyCoinProduct()

    def send_buyCoinProduct(self, paymentReservation):
        self._oprot.writeMessageBegin('buyCoinProduct', TMessageType.CALL, self._seqid)
        args = buyCoinProduct_args()
        args.paymentReservation = paymentReservation
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_buyCoinProduct(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = buyCoinProduct_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.e is not None:
            raise result.e
        return

    def buyFreeProduct(
        self, receiverMid, productId, messageTemplate, language, country, packageId
    ):
        """
        Parameters:
         - receiverMid
         - productId
         - messageTemplate
         - language
         - country
         - packageId

        """
        self.send_buyFreeProduct(
            receiverMid, productId, messageTemplate, language, country, packageId
        )
        self.recv_buyFreeProduct()

    def send_buyFreeProduct(
        self, receiverMid, productId, messageTemplate, language, country, packageId
    ):
        self._oprot.writeMessageBegin('buyFreeProduct', TMessageType.CALL, self._seqid)
        args = buyFreeProduct_args()
        args.receiverMid = receiverMid
        args.productId = productId
        args.messageTemplate = messageTemplate
        args.language = language
        args.country = country
        args.packageId = packageId
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_buyFreeProduct(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = buyFreeProduct_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.e is not None:
            raise result.e
        return

    def buyMustbuyProduct(
        self,
        receiverMid,
        productId,
        messageTemplate,
        language,
        country,
        packageId,
        serialNumber,
    ):
        """
        Parameters:
         - receiverMid
         - productId
         - messageTemplate
         - language
         - country
         - packageId
         - serialNumber

        """
        self.send_buyMustbuyProduct(
            receiverMid,
            productId,
            messageTemplate,
            language,
            country,
            packageId,
            serialNumber,
        )
        self.recv_buyMustbuyProduct()

    def send_buyMustbuyProduct(
        self,
        receiverMid,
        productId,
        messageTemplate,
        language,
        country,
        packageId,
        serialNumber,
    ):
        self._oprot.writeMessageBegin(
            'buyMustbuyProduct', TMessageType.CALL, self._seqid
        )
        args = buyMustbuyProduct_args()
        args.receiverMid = receiverMid
        args.productId = productId
        args.messageTemplate = messageTemplate
        args.language = language
        args.country = country
        args.packageId = packageId
        args.serialNumber = serialNumber
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_buyMustbuyProduct(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = buyMustbuyProduct_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.e is not None:
            raise result.e
        return

    def checkCanReceivePresent(self, recipientMid, packageId, language, country):
        """
        Parameters:
         - recipientMid
         - packageId
         - language
         - country

        """
        self.send_checkCanReceivePresent(recipientMid, packageId, language, country)
        self.recv_checkCanReceivePresent()

    def send_checkCanReceivePresent(self, recipientMid, packageId, language, country):
        self._oprot.writeMessageBegin(
            'checkCanReceivePresent', TMessageType.CALL, self._seqid
        )
        args = checkCanReceivePresent_args()
        args.recipientMid = recipientMid
        args.packageId = packageId
        args.language = language
        args.country = country
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_checkCanReceivePresent(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = checkCanReceivePresent_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.e is not None:
            raise result.e
        return

    def getActivePurchases(self, start, size, language, country):
        """
        Parameters:
         - start
         - size
         - language
         - country

        """
        self.send_getActivePurchases(start, size, language, country)
        return self.recv_getActivePurchases()

    def send_getActivePurchases(self, start, size, language, country):
        self._oprot.writeMessageBegin(
            'getActivePurchases', TMessageType.CALL, self._seqid
        )
        args = getActivePurchases_args()
        args.start = start
        args.size = size
        args.language = language
        args.country = country
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def getActivePurchaseVersions(self, start, size, language, country):
        """
        Parameters:
         - start
         - size
         - language
         - country

        """
        self.send_getActivePurchaseVersions(start, size, language, country)
        return self.recv_getActivePurchaseVersions()

    def send_getActivePurchaseVersions(self, start, size, language, country):
        self._oprot.writeMessageBegin(
            'getActivePurchaseVersions', TMessageType.CALL, self._seqid
        )
        args = getActivePurchaseVersions_args()
        args.start = start
        args.size = size
        args.language = language
        args.country = country
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def getCoinProducts(self, appStoreCode, country, language):
        """
        Parameters:
         - appStoreCode
         - country
         - language

        """
        self.send_getCoinProducts(appStoreCode, country, language)
        return self.recv_getCoinProducts()

    def send_getCoinProducts(self, appStoreCode, country, language):
        self._oprot.writeMessageBegin('getCoinProducts', TMessageType.CALL, self._seqid)
        args = getCoinProducts_args()
        args.appStoreCode = appStoreCode
        args.country = country
        args.language = language
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def getCoinProductsByPgCode(self, appStoreCode, pgCode, country, language):
        """
        Parameters:
         - appStoreCode
         - pgCode
         - country
         - language

        """
        self.send_getCoinProductsByPgCode(appStoreCode, pgCode, country, language)
        return self.recv_getCoinProductsByPgCode()

    def send_getCoinProductsByPgCode(self, appStoreCode, pgCode, country, language):
        self._oprot.writeMessageBegin(
            'getCoinProductsByPgCode', TMessageType.CALL, self._seqid
        )
        args = getCoinProductsByPgCode_args()
        args.appStoreCode = appStoreCode
        args.pgCode = pgCode
        args.country = country
        args.language = language
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def getCoinPurchaseHistory(self, request):
        """
        Parameters:
         - request

        """
        self.send_getCoinPurchaseHistory(request)
        return self.recv_getCoinPurchaseHistory()

    def send_getCoinPurchaseHistory(self, request):
        self._oprot.writeMessageBegin(
            'getCoinPurchaseHistory', TMessageType.CALL, self._seqid
        )
        args = getCoinPurchaseHistory_args()
        args.request = request
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def getCoinUseAndRefundHistory(self, request):
        """
        Parameters:
         - request

        """
        self.send_getCoinUseAndRefundHistory(request)
        return self.recv_getCoinUseAndRefundHistory()

    def send_getCoinUseAndRefundHistory(self, request):
        self._oprot.writeMessageBegin(
            'getCoinUseAndRefundHistory', TMessageType.CALL, self._seqid
        )
        args = getCoinUseAndRefundHistory_args()
        args.request = request
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def getDownloads(self, start, size, language, country):
        """
        Parameters:
         - start
         - size
         - language
         - country

        """
        self.send_getDownloads(start, size, language, country)
        return self.recv_getDownloads()

    def send_getDownloads(self, start, size, language, country):
        self._oprot.writeMessageBegin('getDownloads', TMessageType.CALL, self._seqid)
        args = getDownloads_args()
        args.start = start
        args.size = size
        args.language = language
        args.country = country
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def getEventPackages(self, start, size, language, country):
        """
        Parameters:
         - start
         - size
         - language
         - country

        """
        self.send_getEventPackages(start, size, language, country)
        return self.recv_getEventPackages()

    def send_getEventPackages(self, start, size, language, country):
        self._oprot.writeMessageBegin(
            'getEventPackages', TMessageType.CALL, self._seqid
        )
        args = getEventPackages_args()
        args.start = start
        args.size = size
        args.language = language
        args.country = country
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def getNewlyReleasedPackages(self, start, size, language, country):
        """
        Parameters:
         - start
         - size
         - language
         - country

        """
        self.send_getNewlyReleasedPackages(start, size, language, country)
        return self.recv_getNewlyReleasedPackages()

    def send_getNewlyReleasedPackages(self, start, size, language, country):
        self._oprot.writeMessageBegin(
            'getNewlyReleasedPackages', TMessageType.CALL, self._seqid
        )
        args = getNewlyReleasedPackages_args()
        args.start = start
        args.size = size
        args.language = language
        args.country = country
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def getPopularPackages(self, start, size, language, country):
        """
        Parameters:
         - start
         - size
         - language
         - country

        """
        self.send_getPopularPackages(start, size, language, country)
        return self.recv_getPopularPackages()

    def send_getPopularPackages(self, start, size, language, country):
        self._oprot.writeMessageBegin(
            'getPopularPackages', TMessageType.CALL, self._seqid
        )
        args = getPopularPackages_args()
        args.start = start
        args.size = size
        args.language = language
        args.country = country
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def getPresentsReceived(self, start, size, language, country):
        """
        Parameters:
         - start
         - size
         - language
         - country

        """
        self.send_getPresentsReceived(start, size, language, country)
        return self.recv_getPresentsReceived()

    def send_getPresentsReceived(self, start, size, language, country):
        self._oprot.writeMessageBegin(
            'getPresentsReceived', TMessageType.CALL, self._seqid
        )
        args = getPresentsReceived_args()
        args.start = start
        args.size = size
        args.language = language
        args.country = country
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def getPresentsSent(self, start, size, language, country):
        """
        Parameters:
         - start
         - size
         - language
         - country

        """
        self.send_getPresentsSent(start, size, language, country)
        return self.recv_getPresentsSent()

    def send_getPresentsSent(self, start, size, language, country):
        self._oprot.writeMessageBegin('getPresentsSent', TMessageType.CALL, self._seqid)
        args = getPresentsSent_args()
        args.start = start
        args.size = size
        args.language = language
        args.country = country
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def getProductList(self, productIdList, language, country):
        """
        Parameters:
         - productIdList
         - language
         - country

        """
        self.send_getProductList(productIdList, language, country)
        return self.recv_getProductList()

    def send_getProductList(self, productIdList, language, country):
        self._oprot.writeMessageBegin('getProductList', TMessageType.CALL, self._seqid)
        args = getProductList_args()
        args.productIdList = productIdList
        args.language = language
        args.country = country
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def getProductListWithCarrier(self, productIdList, language, country, carrierCode):
        """
        Parameters:
         - productIdList
         - language
         - country
         - carrierCode

        """
        self.send_getProductListWithCarrier(
            productIdList, language, country, carrierCode
        )
        return self.recv_getProductListWithCarrier()

    def send_getProductListWithCarrier(
        self, productIdList, language, country, carrierCode
    ):
        self._oprot.writeMessageBegin(
            'getProductListWithCarrier', TMessageType.CALL, self._seqid
        )
        args = getProductListWithCarrier_args()
        args.productIdList = productIdList
        args.language = language
        args.country = country
        args.carrierCode = carrierCode
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def getProductWithCarrier(self, packageID, language, country, carrierCode):
        """
        Parameters:
         - packageID
         - language
         - country
         - carrierCode

        """
        self.send_getProductWithCarrier(packageID, language, country, carrierCode)
        return self.recv_getProductWithCarrier()

    def send_getProductWithCarrier(self, packageID, language, country, carrierCode):
        self._oprot.writeMessageBegin(
            'getProductWithCarrier', TMessageType.CALL, self._seqid
        )
        args = getProductWithCarrier_args()
        args.packageID = packageID
        args.language = language
        args.country = country
        args.carrierCode = carrierCode
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def getPurchaseHistory(self, start, size, language, country):
        """
        Parameters:
         - start
         - size
         - language
         - country

        """
        self.send_getPurchaseHistory(start, size, language, country)
        return self.recv_getPurchaseHistory()

    def send_getPurchaseHistory(self, start, size, language, country):
        self._oprot.writeMessageBegin(
            'getPurchaseHistory', TMessageType.CALL, self._seqid
        )
        args = getPurchaseHistory_args()
        args.start = start
        args.size = size
        args.language = language
        args.country = country
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def getTotalBalance(self, appStoreCode):
        """
        Parameters:
         - appStoreCode

        """
        self.send_getTotalBalance(appStoreCode)
        return self.recv_getTotalBalance()

    def send_getTotalBalance(self, appStoreCode):
        self._oprot.writeMessageBegin('getTotalBalance', TMessageType.CALL, self._seqid)
        args = getTotalBalance_args()
        args.appStoreCode = appStoreCode
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def notifyDownloaded(self, packageId, language):
        """
        Parameters:
         - packageId
         - language

        """
        self.send_notifyDownloaded(packageId, language)
        return self.recv_notifyDownloaded()

    def send_notifyDownloaded(self, packageId, language):
        self._oprot.writeMessageBegin(
            'notifyDownloaded', TMessageType.CALL, self._seqid
        )
        args = notifyDownloaded_args()
        args.packageId = packageId
        args.language = language
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def reserveCoinPurchase(self, request):
        """
        Parameters:
         - request

        """
        self.send_reserveCoinPurchase(request)
        return self.recv_reserveCoinPurchase()

    def send_reserveCoinPurchase(self, request):
        self._oprot.writeMessageBegin(
            'reserveCoinPurchase', TMessageType.CALL, self._seqid
        )
        args = reserveCoinPurchase_args()
        args.request = request
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def reservePayment(self, paymentReservation):
        """
        Parameters:
         - paymentReservation

        """
        self.send_reservePayment(paymentReservation)
        return self.recv_reservePayment()

    def send_reservePayment(self, paymentReservation):
        self._oprot.writeMessageBegin('reservePayment', TMessageType.CALL, self._seqid)
        args = reservePayment_args()
        args.paymentReservation = paymentReservation
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def canReceivePresent(self, shopId, productId, locale, recipientMid):
        """
        Parameters:
         - shopId
         - productId
         - locale
         - recipientMid

        """
        self.send_canReceivePresent(shopId, productId, locale, recipientMid)
        self.recv_canReceivePresent()

    def send_canReceivePresent(self, shopId, productId, locale, recipientMid):
        self._oprot.writeMessageBegin(
            'canReceivePresent', TMessageType.CALL, self._seqid
        )
        args = canReceivePresent_args()
        args.shopId = shopId
        args.productId = productId
        args.locale = locale
        args.recipientMid = recipientMid
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_canReceivePresent(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = canReceivePresent_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.e is not None:
            raise result.e
        return

    def getAutoSuggestionShowcase(self, autoSuggestionShowcaseRequest):
        """
        Parameters:
         - autoSuggestionShowcaseRequest

        """
        self.send_getAutoSuggestionShowcase(autoSuggestionShowcaseRequest)
        return self.recv_getAutoSuggestionShowcase()

    def send_getAutoSuggestionShowcase(self, autoSuggestionShowcaseRequest):
        self._oprot.writeMessageBegin(
            'getAutoSuggestionShowcase', TMessageType.CALL, self._seqid
        )
        args = getAutoSuggestionShowcase_args()
        args.autoSuggestionShowcaseRequest = autoSuggestionShowcaseRequest
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def getOldSticonMapping(self, req):
        """
        Parameters:
         - req

        """
        self.send_getOldSticonMapping(req)
        return self.recv_getOldSticonMapping()

    def send_getOldSticonMapping(self, req):
        self._oprot.writeMessageBegin(
            'getOldSticonMapping', TMessageType.CALL, self._seqid
        )
        args = getOldSticonMapping_args()
        args.req = req
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def getOwnedProductSummaries(self, shopId, offset, limit, locale):
        """
        Parameters:
         - shopId
         - offset
         - limit
         - locale

        """
        self.send_getOwnedProductSummaries(shopId, offset, limit, locale)
        return self.recv_getOwnedProductSummaries()

    def send_getOwnedProductSummaries(self, shopId, offset, limit, locale):
        self._oprot.writeMessageBegin(
            'getOwnedProductSummaries', TMessageType.CALL, self._seqid
        )
        args = getOwnedProductSummaries_args()
        args.shopId = shopId
        args.offset = offset
        args.limit = limit
        args.locale = locale
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def getOwnedProducts(self, shopId, offset, limit, locale):
        """
        Parameters:
         - shopId
         - offset
         - limit
         - locale

        """
        self.send_getOwnedProducts(shopId, offset, limit, locale)
        return self.recv_getOwnedProducts()

    def send_getOwnedProducts(self, shopId, offset, limit, locale):
        self._oprot.writeMessageBegin(
            'getOwnedProducts', TMessageType.CALL, self._seqid
        )
        args = getOwnedProducts_args()
        args.shopId = shopId
        args.offset = offset
        args.limit = limit
        args.locale = locale
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def getProductByVersion(self, shopId, productId, productVersion, locale):
        """
        Parameters:
         - shopId
         - productId
         - productVersion
         - locale

        """
        self.send_getProductByVersion(shopId, productId, productVersion, locale)
        return self.recv_getProductByVersion()

    def send_getProductByVersion(self, shopId, productId, productVersion, locale):
        self._oprot.writeMessageBegin(
            'getProductByVersion', TMessageType.CALL, self._seqid
        )
        args = getProductByVersion_args()
        args.shopId = shopId
        args.productId = productId
        args.productVersion = productVersion
        args.locale = locale
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def getProductV2(self, request):
        """
        Parameters:
         - request

        """
        self.send_getProductV2(request)
        return self.recv_getProductV2()

    def send_getProductV2(self, request):
        self._oprot.writeMessageBegin('getProductV2', TMessageType.CALL, self._seqid)
        args = getProductV2_args()
        args.request = request
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def getProductValidationScheme(self, shopId, productId, productVersion):
        """
        Parameters:
         - shopId
         - productId
         - productVersion

        """
        self.send_getProductValidationScheme(shopId, productId, productVersion)
        return self.recv_getProductValidationScheme()

    def send_getProductValidationScheme(self, shopId, productId, productVersion):
        self._oprot.writeMessageBegin(
            'getProductValidationScheme', TMessageType.CALL, self._seqid
        )
        args = getProductValidationScheme_args()
        args.shopId = shopId
        args.productId = productId
        args.productVersion = productVersion
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def getProduct(self, shopId, productId, locale):
        """
        Parameters:
         - shopId
         - productId
         - locale

        """
        self.send_getProduct(shopId, productId, locale)
        return self.recv_getProduct()

    def send_getProduct(self, shopId, productId, locale):
        self._oprot.writeMessageBegin('getProduct', TMessageType.CALL, self._seqid)
        args = getProduct_args()
        args.shopId = shopId
        args.productId = productId
        args.locale = locale
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def getProductsByAuthor(self, productListByAuthorRequest):
        """
        Parameters:
         - productListByAuthorRequest

        """
        self.send_getProductsByAuthor(productListByAuthorRequest)
        return self.recv_getProductsByAuthor()

    def send_getProductsByAuthor(self, productListByAuthorRequest):
        self._oprot.writeMessageBegin(
            'getProductsByAuthor', TMessageType.CALL, self._seqid
        )
        args = getProductsByAuthor_args()
        args.productListByAuthorRequest = productListByAuthorRequest
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def getPurchasedProducts(self, shopId, offset, limit, locale):
        """
        Parameters:
         - shopId
         - offset
         - limit
         - locale

        """
        self.send_getPurchasedProducts(shopId, offset, limit, locale)
        return self.recv_getPurchasedProducts()

    def send_getPurchasedProducts(self, shopId, offset, limit, locale):
        self._oprot.writeMessageBegin(
            'getPurchasedProducts', TMessageType.CALL, self._seqid
        )
        args = getPurchasedProducts_args()
        args.shopId = shopId
        args.offset = offset
        args.limit = limit
        args.locale = locale
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def getReceivedPresents(self, shopId, offset, limit, locale):
        """
        Parameters:
         - shopId
         - offset
         - limit
         - locale

        """
        self.send_getReceivedPresents(shopId, offset, limit, locale)
        return self.recv_getReceivedPresents()

    def send_getReceivedPresents(self, shopId, offset, limit, locale):
        self._oprot.writeMessageBegin(
            'getReceivedPresents', TMessageType.CALL, self._seqid
        )
        args = getReceivedPresents_args()
        args.shopId = shopId
        args.offset = offset
        args.limit = limit
        args.locale = locale
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def getRecommendOa(self, req):
        """
        Parameters:
         - req

        """
        self.send_getRecommendOa(req)
        return self.recv_getRecommendOa()

    def send_getRecommendOa(self, req):
        self._oprot.writeMessageBegin('getRecommendOa', TMessageType.CALL, self._seqid)
        args = getRecommendOa_args()
        args.req = req
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def getRecommendationForUser(self, shopId, offset, limit, locale):
        """
        Parameters:
         - shopId
         - offset
         - limit
         - locale

        """
        self.send_getRecommendationForUser(shopId, offset, limit, locale)
        return self.recv_getRecommendationForUser()

    def send_getRecommendationForUser(self, shopId, offset, limit, locale):
        self._oprot.writeMessageBegin(
            'getRecommendationForUser', TMessageType.CALL, self._seqid
        )
        args = getRecommendationForUser_args()
        args.shopId = shopId
        args.offset = offset
        args.limit = limit
        args.locale = locale
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def getRecommendationList(self, getRecommendationRequest):
        """
        Parameters:
         - getRecommendationRequest

        """
        self.send_getRecommendationList(getRecommendationRequest)
        return self.recv_getRecommendationList()

    def send_getRecommendationList(self, getRecommendationRequest):
        self._oprot.writeMessageBegin(
            'getRecommendationList', TMessageType.CALL, self._seqid
        )
        args = getRecommendationList_args()
        args.getRecommendationRequest = getRecommendationRequest
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def getSentPresents(self, shopId, offset, limit, locale):
        """
        Parameters:
         - shopId
         - offset
         - limit
         - locale

        """
        self.send_getSentPresents(shopId, offset, limit, locale)
        return self.recv_getSentPresents()

    def send_getSentPresents(self, shopId, offset, limit, locale):
        self._oprot.writeMessageBegin('getSentPresents', TMessageType.CALL, self._seqid)
        args = getSentPresents_args()
        args.shopId = shopId
        args.offset = offset
        args.limit = limit
        args.locale = locale
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def getShowcaseV3(self, showcaseRequest):
        """
        Parameters:
         - showcaseRequest

        """
        self.send_getShowcaseV3(showcaseRequest)
        return self.recv_getShowcaseV3()

    def send_getShowcaseV3(self, showcaseRequest):
        self._oprot.writeMessageBegin('getShowcaseV3', TMessageType.CALL, self._seqid)
        args = getShowcaseV3_args()
        args.showcaseRequest = showcaseRequest
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def getSuggestDictionarySetting(self, req):
        """
        Parameters:
         - req

        """
        self.send_getSuggestDictionarySetting(req)
        return self.recv_getSuggestDictionarySetting()

    def send_getSuggestDictionarySetting(self, req):
        self._oprot.writeMessageBegin(
            'getSuggestDictionarySetting', TMessageType.CALL, self._seqid
        )
        args = getSuggestDictionarySetting_args()
        args.req = req
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def getSuggestResourcesV2(self, req):
        """
        Parameters:
         - req

        """
        self.send_getSuggestResourcesV2(req)
        return self.recv_getSuggestResourcesV2()

    def send_getSuggestResourcesV2(self, req):
        self._oprot.writeMessageBegin(
            'getSuggestResourcesV2', TMessageType.CALL, self._seqid
        )
        args = getSuggestResourcesV2_args()
        args.req = req
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def getUpdates(self, shopId, locale):
        """
        Parameters:
         - shopId
         - locale

        """
        self.send_getUpdates(shopId, locale)
        return self.recv_getUpdates()

    def send_getUpdates(self, shopId, locale):
        self._oprot.writeMessageBegin('getUpdates', TMessageType.CALL, self._seqid)
        args = getUpdates_args()
        args.shopId = shopId
        args.locale = locale
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def notifyProductEvent(self, shopId, productId, productVersion, productEvent):
        """
        Parameters:
         - shopId
         - productId
         - productVersion
         - productEvent

        """
        self.send_notifyProductEvent(shopId, productId, productVersion, productEvent)
        self.recv_notifyProductEvent()

    def send_notifyProductEvent(self, shopId, productId, productVersion, productEvent):
        self._oprot.writeMessageBegin(
            'notifyProductEvent', TMessageType.CALL, self._seqid
        )
        args = notifyProductEvent_args()
        args.shopId = shopId
        args.productId = productId
        args.productVersion = productVersion
        args.productEvent = productEvent
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_notifyProductEvent(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = notifyProductEvent_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.e is not None:
            raise result.e
        return

    def placePurchaseOrderForFreeProduct(self, purchaseOrder):
        """
        Parameters:
         - purchaseOrder

        """
        self.send_placePurchaseOrderForFreeProduct(purchaseOrder)
        return self.recv_placePurchaseOrderForFreeProduct()

    def send_placePurchaseOrderForFreeProduct(self, purchaseOrder):
        self._oprot.writeMessageBegin(
            'placePurchaseOrderForFreeProduct', TMessageType.CALL, self._seqid
        )
        args = placePurchaseOrderForFreeProduct_args()
        args.purchaseOrder = purchaseOrder
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def placePurchaseOrderWithLineCoin(self, purchaseOrder):
        """
        Parameters:
         - purchaseOrder

        """
        self.send_placePurchaseOrderWithLineCoin(purchaseOrder)
        return self.recv_placePurchaseOrderWithLineCoin()

    def send_placePurchaseOrderWithLineCoin(self, purchaseOrder):
        self._oprot.writeMessageBegin(
            'placePurchaseOrderWithLineCoin', TMessageType.CALL, self._seqid
        )
        args = placePurchaseOrderWithLineCoin_args()
        args.purchaseOrder = purchaseOrder
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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

    def validateProduct(self, shopId, productId, productVersion, validationReq):
        """
        Parameters:
         - shopId
         - productId
         - productVersion
         - validationReq

        """
        self.send_validateProduct(shopId, productId, productVersion, validationReq)
        return self.recv_validateProduct()

    def send_validateProduct(self, shopId, productId, productVersion, validationReq):
        self._oprot.writeMessageBegin('validateProduct', TMessageType.CALL, self._seqid)
        args = validateProduct_args()
        args.shopId = shopId
        args.productId = productId
        args.productVersion = productVersion
        args.validationReq = validationReq
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

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


class Processor(Iface, TProcessor):
    def __init__(self, handler):
        self._handler = handler
        self._processMap = {}
        self._processMap["buyCoinProduct"] = Processor.process_buyCoinProduct
        self._processMap["buyFreeProduct"] = Processor.process_buyFreeProduct
        self._processMap["buyMustbuyProduct"] = Processor.process_buyMustbuyProduct
        self._processMap[
            "checkCanReceivePresent"
        ] = Processor.process_checkCanReceivePresent
        self._processMap["getActivePurchases"] = Processor.process_getActivePurchases
        self._processMap[
            "getActivePurchaseVersions"
        ] = Processor.process_getActivePurchaseVersions
        self._processMap["getCoinProducts"] = Processor.process_getCoinProducts
        self._processMap[
            "getCoinProductsByPgCode"
        ] = Processor.process_getCoinProductsByPgCode
        self._processMap[
            "getCoinPurchaseHistory"
        ] = Processor.process_getCoinPurchaseHistory
        self._processMap[
            "getCoinUseAndRefundHistory"
        ] = Processor.process_getCoinUseAndRefundHistory
        self._processMap["getDownloads"] = Processor.process_getDownloads
        self._processMap["getEventPackages"] = Processor.process_getEventPackages
        self._processMap[
            "getNewlyReleasedPackages"
        ] = Processor.process_getNewlyReleasedPackages
        self._processMap["getPopularPackages"] = Processor.process_getPopularPackages
        self._processMap["getPresentsReceived"] = Processor.process_getPresentsReceived
        self._processMap["getPresentsSent"] = Processor.process_getPresentsSent
        self._processMap["getProductList"] = Processor.process_getProductList
        self._processMap[
            "getProductListWithCarrier"
        ] = Processor.process_getProductListWithCarrier
        self._processMap[
            "getProductWithCarrier"
        ] = Processor.process_getProductWithCarrier
        self._processMap["getPurchaseHistory"] = Processor.process_getPurchaseHistory
        self._processMap["getTotalBalance"] = Processor.process_getTotalBalance
        self._processMap["notifyDownloaded"] = Processor.process_notifyDownloaded
        self._processMap["reserveCoinPurchase"] = Processor.process_reserveCoinPurchase
        self._processMap["reservePayment"] = Processor.process_reservePayment
        self._processMap["canReceivePresent"] = Processor.process_canReceivePresent
        self._processMap[
            "getAutoSuggestionShowcase"
        ] = Processor.process_getAutoSuggestionShowcase
        self._processMap["getOldSticonMapping"] = Processor.process_getOldSticonMapping
        self._processMap[
            "getOwnedProductSummaries"
        ] = Processor.process_getOwnedProductSummaries
        self._processMap["getOwnedProducts"] = Processor.process_getOwnedProducts
        self._processMap["getProductByVersion"] = Processor.process_getProductByVersion
        self._processMap["getProductV2"] = Processor.process_getProductV2
        self._processMap[
            "getProductValidationScheme"
        ] = Processor.process_getProductValidationScheme
        self._processMap["getProduct"] = Processor.process_getProduct
        self._processMap["getProductsByAuthor"] = Processor.process_getProductsByAuthor
        self._processMap[
            "getPurchasedProducts"
        ] = Processor.process_getPurchasedProducts
        self._processMap["getReceivedPresents"] = Processor.process_getReceivedPresents
        self._processMap["getRecommendOa"] = Processor.process_getRecommendOa
        self._processMap[
            "getRecommendationForUser"
        ] = Processor.process_getRecommendationForUser
        self._processMap[
            "getRecommendationList"
        ] = Processor.process_getRecommendationList
        self._processMap["getSentPresents"] = Processor.process_getSentPresents
        self._processMap["getShowcaseV3"] = Processor.process_getShowcaseV3
        self._processMap[
            "getSuggestDictionarySetting"
        ] = Processor.process_getSuggestDictionarySetting
        self._processMap[
            "getSuggestResourcesV2"
        ] = Processor.process_getSuggestResourcesV2
        self._processMap["getUpdates"] = Processor.process_getUpdates
        self._processMap["notifyProductEvent"] = Processor.process_notifyProductEvent
        self._processMap[
            "placePurchaseOrderForFreeProduct"
        ] = Processor.process_placePurchaseOrderForFreeProduct
        self._processMap[
            "placePurchaseOrderWithLineCoin"
        ] = Processor.process_placePurchaseOrderWithLineCoin
        self._processMap["validateProduct"] = Processor.process_validateProduct

    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_buyCoinProduct(self, seqid, iprot, oprot):
        args = buyCoinProduct_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = buyCoinProduct_result()
        try:
            self._handler.buyCoinProduct(args.paymentReservation)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TalkException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("buyCoinProduct", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_buyFreeProduct(self, seqid, iprot, oprot):
        args = buyFreeProduct_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = buyFreeProduct_result()
        try:
            self._handler.buyFreeProduct(
                args.receiverMid,
                args.productId,
                args.messageTemplate,
                args.language,
                args.country,
                args.packageId,
            )
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TalkException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("buyFreeProduct", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_buyMustbuyProduct(self, seqid, iprot, oprot):
        args = buyMustbuyProduct_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = buyMustbuyProduct_result()
        try:
            self._handler.buyMustbuyProduct(
                args.receiverMid,
                args.productId,
                args.messageTemplate,
                args.language,
                args.country,
                args.packageId,
                args.serialNumber,
            )
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TalkException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("buyMustbuyProduct", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_checkCanReceivePresent(self, seqid, iprot, oprot):
        args = checkCanReceivePresent_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = checkCanReceivePresent_result()
        try:
            self._handler.checkCanReceivePresent(
                args.recipientMid, args.packageId, args.language, args.country
            )
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TalkException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("checkCanReceivePresent", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getActivePurchases(self, seqid, iprot, oprot):
        args = getActivePurchases_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getActivePurchases_result()
        try:
            result.success = self._handler.getActivePurchases(
                args.start, args.size, args.language, args.country
            )
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TalkException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("getActivePurchases", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getActivePurchaseVersions(self, seqid, iprot, oprot):
        args = getActivePurchaseVersions_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getActivePurchaseVersions_result()
        try:
            result.success = self._handler.getActivePurchaseVersions(
                args.start, args.size, args.language, args.country
            )
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TalkException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("getActivePurchaseVersions", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getCoinProducts(self, seqid, iprot, oprot):
        args = getCoinProducts_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getCoinProducts_result()
        try:
            result.success = self._handler.getCoinProducts(
                args.appStoreCode, args.country, args.language
            )
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TalkException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("getCoinProducts", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getCoinProductsByPgCode(self, seqid, iprot, oprot):
        args = getCoinProductsByPgCode_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getCoinProductsByPgCode_result()
        try:
            result.success = self._handler.getCoinProductsByPgCode(
                args.appStoreCode, args.pgCode, args.country, args.language
            )
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TalkException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("getCoinProductsByPgCode", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getCoinPurchaseHistory(self, seqid, iprot, oprot):
        args = getCoinPurchaseHistory_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getCoinPurchaseHistory_result()
        try:
            result.success = self._handler.getCoinPurchaseHistory(args.request)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TalkException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("getCoinPurchaseHistory", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getCoinUseAndRefundHistory(self, seqid, iprot, oprot):
        args = getCoinUseAndRefundHistory_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getCoinUseAndRefundHistory_result()
        try:
            result.success = self._handler.getCoinUseAndRefundHistory(args.request)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TalkException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("getCoinUseAndRefundHistory", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getDownloads(self, seqid, iprot, oprot):
        args = getDownloads_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getDownloads_result()
        try:
            result.success = self._handler.getDownloads(
                args.start, args.size, args.language, args.country
            )
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TalkException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("getDownloads", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getEventPackages(self, seqid, iprot, oprot):
        args = getEventPackages_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getEventPackages_result()
        try:
            result.success = self._handler.getEventPackages(
                args.start, args.size, args.language, args.country
            )
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TalkException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("getEventPackages", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getNewlyReleasedPackages(self, seqid, iprot, oprot):
        args = getNewlyReleasedPackages_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getNewlyReleasedPackages_result()
        try:
            result.success = self._handler.getNewlyReleasedPackages(
                args.start, args.size, args.language, args.country
            )
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TalkException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("getNewlyReleasedPackages", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getPopularPackages(self, seqid, iprot, oprot):
        args = getPopularPackages_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getPopularPackages_result()
        try:
            result.success = self._handler.getPopularPackages(
                args.start, args.size, args.language, args.country
            )
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TalkException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("getPopularPackages", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getPresentsReceived(self, seqid, iprot, oprot):
        args = getPresentsReceived_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getPresentsReceived_result()
        try:
            result.success = self._handler.getPresentsReceived(
                args.start, args.size, args.language, args.country
            )
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TalkException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("getPresentsReceived", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getPresentsSent(self, seqid, iprot, oprot):
        args = getPresentsSent_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getPresentsSent_result()
        try:
            result.success = self._handler.getPresentsSent(
                args.start, args.size, args.language, args.country
            )
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TalkException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("getPresentsSent", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getProductList(self, seqid, iprot, oprot):
        args = getProductList_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getProductList_result()
        try:
            result.success = self._handler.getProductList(
                args.productIdList, args.language, args.country
            )
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TalkException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("getProductList", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getProductListWithCarrier(self, seqid, iprot, oprot):
        args = getProductListWithCarrier_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getProductListWithCarrier_result()
        try:
            result.success = self._handler.getProductListWithCarrier(
                args.productIdList, args.language, args.country, args.carrierCode
            )
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TalkException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("getProductListWithCarrier", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getProductWithCarrier(self, seqid, iprot, oprot):
        args = getProductWithCarrier_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getProductWithCarrier_result()
        try:
            result.success = self._handler.getProductWithCarrier(
                args.packageID, args.language, args.country, args.carrierCode
            )
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TalkException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("getProductWithCarrier", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getPurchaseHistory(self, seqid, iprot, oprot):
        args = getPurchaseHistory_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getPurchaseHistory_result()
        try:
            result.success = self._handler.getPurchaseHistory(
                args.start, args.size, args.language, args.country
            )
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TalkException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("getPurchaseHistory", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getTotalBalance(self, seqid, iprot, oprot):
        args = getTotalBalance_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getTotalBalance_result()
        try:
            result.success = self._handler.getTotalBalance(args.appStoreCode)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TalkException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("getTotalBalance", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_notifyDownloaded(self, seqid, iprot, oprot):
        args = notifyDownloaded_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = notifyDownloaded_result()
        try:
            result.success = self._handler.notifyDownloaded(
                args.packageId, args.language
            )
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TalkException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("notifyDownloaded", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_reserveCoinPurchase(self, seqid, iprot, oprot):
        args = reserveCoinPurchase_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = reserveCoinPurchase_result()
        try:
            result.success = self._handler.reserveCoinPurchase(args.request)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TalkException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("reserveCoinPurchase", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_reservePayment(self, seqid, iprot, oprot):
        args = reservePayment_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = reservePayment_result()
        try:
            result.success = self._handler.reservePayment(args.paymentReservation)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TalkException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("reservePayment", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_canReceivePresent(self, seqid, iprot, oprot):
        args = canReceivePresent_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = canReceivePresent_result()
        try:
            self._handler.canReceivePresent(
                args.shopId, args.productId, args.locale, args.recipientMid
            )
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except ShopException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("canReceivePresent", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getAutoSuggestionShowcase(self, seqid, iprot, oprot):
        args = getAutoSuggestionShowcase_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getAutoSuggestionShowcase_result()
        try:
            result.success = self._handler.getAutoSuggestionShowcase(
                args.autoSuggestionShowcaseRequest
            )
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except ShopException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("getAutoSuggestionShowcase", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getOldSticonMapping(self, seqid, iprot, oprot):
        args = getOldSticonMapping_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getOldSticonMapping_result()
        try:
            result.success = self._handler.getOldSticonMapping(args.req)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except ShopException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("getOldSticonMapping", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getOwnedProductSummaries(self, seqid, iprot, oprot):
        args = getOwnedProductSummaries_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getOwnedProductSummaries_result()
        try:
            result.success = self._handler.getOwnedProductSummaries(
                args.shopId, args.offset, args.limit, args.locale
            )
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except ShopException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("getOwnedProductSummaries", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getOwnedProducts(self, seqid, iprot, oprot):
        args = getOwnedProducts_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getOwnedProducts_result()
        try:
            result.success = self._handler.getOwnedProducts(
                args.shopId, args.offset, args.limit, args.locale
            )
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except ShopException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("getOwnedProducts", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getProductByVersion(self, seqid, iprot, oprot):
        args = getProductByVersion_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getProductByVersion_result()
        try:
            result.success = self._handler.getProductByVersion(
                args.shopId, args.productId, args.productVersion, args.locale
            )
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except ShopException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("getProductByVersion", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getProductV2(self, seqid, iprot, oprot):
        args = getProductV2_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getProductV2_result()
        try:
            result.success = self._handler.getProductV2(args.request)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except ShopException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("getProductV2", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getProductValidationScheme(self, seqid, iprot, oprot):
        args = getProductValidationScheme_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getProductValidationScheme_result()
        try:
            result.success = self._handler.getProductValidationScheme(
                args.shopId, args.productId, args.productVersion
            )
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except ShopException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("getProductValidationScheme", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getProduct(self, seqid, iprot, oprot):
        args = getProduct_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getProduct_result()
        try:
            result.success = self._handler.getProduct(
                args.shopId, args.productId, args.locale
            )
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except ShopException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("getProduct", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getProductsByAuthor(self, seqid, iprot, oprot):
        args = getProductsByAuthor_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getProductsByAuthor_result()
        try:
            result.success = self._handler.getProductsByAuthor(
                args.productListByAuthorRequest
            )
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except ShopException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("getProductsByAuthor", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getPurchasedProducts(self, seqid, iprot, oprot):
        args = getPurchasedProducts_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getPurchasedProducts_result()
        try:
            result.success = self._handler.getPurchasedProducts(
                args.shopId, args.offset, args.limit, args.locale
            )
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except ShopException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("getPurchasedProducts", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getReceivedPresents(self, seqid, iprot, oprot):
        args = getReceivedPresents_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getReceivedPresents_result()
        try:
            result.success = self._handler.getReceivedPresents(
                args.shopId, args.offset, args.limit, args.locale
            )
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except ShopException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("getReceivedPresents", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getRecommendOa(self, seqid, iprot, oprot):
        args = getRecommendOa_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getRecommendOa_result()
        try:
            result.success = self._handler.getRecommendOa(args.req)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except ShopException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("getRecommendOa", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getRecommendationForUser(self, seqid, iprot, oprot):
        args = getRecommendationForUser_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getRecommendationForUser_result()
        try:
            result.success = self._handler.getRecommendationForUser(
                args.shopId, args.offset, args.limit, args.locale
            )
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except ShopException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("getRecommendationForUser", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getRecommendationList(self, seqid, iprot, oprot):
        args = getRecommendationList_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getRecommendationList_result()
        try:
            result.success = self._handler.getRecommendationList(
                args.getRecommendationRequest
            )
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except ShopException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("getRecommendationList", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getSentPresents(self, seqid, iprot, oprot):
        args = getSentPresents_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getSentPresents_result()
        try:
            result.success = self._handler.getSentPresents(
                args.shopId, args.offset, args.limit, args.locale
            )
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except ShopException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("getSentPresents", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getShowcaseV3(self, seqid, iprot, oprot):
        args = getShowcaseV3_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getShowcaseV3_result()
        try:
            result.success = self._handler.getShowcaseV3(args.showcaseRequest)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except ShopException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("getShowcaseV3", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getSuggestDictionarySetting(self, seqid, iprot, oprot):
        args = getSuggestDictionarySetting_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getSuggestDictionarySetting_result()
        try:
            result.success = self._handler.getSuggestDictionarySetting(args.req)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except ShopException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("getSuggestDictionarySetting", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getSuggestResourcesV2(self, seqid, iprot, oprot):
        args = getSuggestResourcesV2_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getSuggestResourcesV2_result()
        try:
            result.success = self._handler.getSuggestResourcesV2(args.req)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except ShopException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("getSuggestResourcesV2", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getUpdates(self, seqid, iprot, oprot):
        args = getUpdates_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getUpdates_result()
        try:
            result.success = self._handler.getUpdates(args.shopId, args.locale)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except ShopException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("getUpdates", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_notifyProductEvent(self, seqid, iprot, oprot):
        args = notifyProductEvent_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = notifyProductEvent_result()
        try:
            self._handler.notifyProductEvent(
                args.shopId, args.productId, args.productVersion, args.productEvent
            )
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except ShopException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("notifyProductEvent", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_placePurchaseOrderForFreeProduct(self, seqid, iprot, oprot):
        args = placePurchaseOrderForFreeProduct_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = placePurchaseOrderForFreeProduct_result()
        try:
            result.success = self._handler.placePurchaseOrderForFreeProduct(
                args.purchaseOrder
            )
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except ShopException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("placePurchaseOrderForFreeProduct", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_placePurchaseOrderWithLineCoin(self, seqid, iprot, oprot):
        args = placePurchaseOrderWithLineCoin_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = placePurchaseOrderWithLineCoin_result()
        try:
            result.success = self._handler.placePurchaseOrderWithLineCoin(
                args.purchaseOrder
            )
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except ShopException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("placePurchaseOrderWithLineCoin", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_validateProduct(self, seqid, iprot, oprot):
        args = validateProduct_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = validateProduct_result()
        try:
            result.success = self._handler.validateProduct(
                args.shopId, args.productId, args.productVersion, args.validationReq
            )
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except ShopException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        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("validateProduct", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()


# HELPER FUNCTIONS AND STRUCTURES


class buyCoinProduct_args(object):
    """
    Attributes:
     - paymentReservation

    """

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

    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 == 2:
                if ftype == TType.STRUCT:
                    self.paymentReservation = PaymentReservation()
                    self.paymentReservation.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('buyCoinProduct_args')
        if self.paymentReservation is not None:
            oprot.writeFieldBegin('paymentReservation', TType.STRUCT, 2)
            self.paymentReservation.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(buyCoinProduct_args)
buyCoinProduct_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.STRUCT,
        'paymentReservation',
        [PaymentReservation, None],
        None,
    ),  # 2
)


class buyCoinProduct_result(object):
    """
    Attributes:
     - e

    """

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

    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.e = TalkException()
                    self.e.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('buyCoinProduct_result')
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(buyCoinProduct_result)
buyCoinProduct_result.thrift_spec = (
    None,  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [TalkException, None],
        None,
    ),  # 1
)


class buyFreeProduct_args(object):
    """
    Attributes:
     - receiverMid
     - productId
     - messageTemplate
     - language
     - country
     - packageId

    """

    def __init__(
        self,
        receiverMid=None,
        productId=None,
        messageTemplate=None,
        language=None,
        country=None,
        packageId=None,
    ):
        self.receiverMid = receiverMid
        self.productId = productId
        self.messageTemplate = messageTemplate
        self.language = language
        self.country = country
        self.packageId = packageId

    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 == 2:
                if ftype == TType.STRING:
                    self.receiverMid = (
                        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.productId = (
                        iprot.readString().decode('utf-8')
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I32:
                    self.messageTemplate = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRING:
                    self.language = (
                        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.country = (
                        iprot.readString().decode('utf-8')
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 7:
                if ftype == TType.I64:
                    self.packageId = 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('buyFreeProduct_args')
        if self.receiverMid is not None:
            oprot.writeFieldBegin('receiverMid', TType.STRING, 2)
            oprot.writeString(
                self.receiverMid.encode('utf-8')
                if sys.version_info[0] == 2
                else self.receiverMid
            )
            oprot.writeFieldEnd()
        if self.productId is not None:
            oprot.writeFieldBegin('productId', TType.STRING, 3)
            oprot.writeString(
                self.productId.encode('utf-8')
                if sys.version_info[0] == 2
                else self.productId
            )
            oprot.writeFieldEnd()
        if self.messageTemplate is not None:
            oprot.writeFieldBegin('messageTemplate', TType.I32, 4)
            oprot.writeI32(self.messageTemplate)
            oprot.writeFieldEnd()
        if self.language is not None:
            oprot.writeFieldBegin('language', TType.STRING, 5)
            oprot.writeString(
                self.language.encode('utf-8')
                if sys.version_info[0] == 2
                else self.language
            )
            oprot.writeFieldEnd()
        if self.country is not None:
            oprot.writeFieldBegin('country', TType.STRING, 6)
            oprot.writeString(
                self.country.encode('utf-8')
                if sys.version_info[0] == 2
                else self.country
            )
            oprot.writeFieldEnd()
        if self.packageId is not None:
            oprot.writeFieldBegin('packageId', TType.I64, 7)
            oprot.writeI64(self.packageId)
            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(buyFreeProduct_args)
buyFreeProduct_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.STRING,
        'receiverMid',
        'UTF8',
        None,
    ),  # 2
    (
        3,
        TType.STRING,
        'productId',
        'UTF8',
        None,
    ),  # 3
    (
        4,
        TType.I32,
        'messageTemplate',
        None,
        None,
    ),  # 4
    (
        5,
        TType.STRING,
        'language',
        'UTF8',
        None,
    ),  # 5
    (
        6,
        TType.STRING,
        'country',
        'UTF8',
        None,
    ),  # 6
    (
        7,
        TType.I64,
        'packageId',
        None,
        None,
    ),  # 7
)


class buyFreeProduct_result(object):
    """
    Attributes:
     - e

    """

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

    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.e = TalkException()
                    self.e.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('buyFreeProduct_result')
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(buyFreeProduct_result)
buyFreeProduct_result.thrift_spec = (
    None,  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [TalkException, None],
        None,
    ),  # 1
)


class buyMustbuyProduct_args(object):
    """
    Attributes:
     - receiverMid
     - productId
     - messageTemplate
     - language
     - country
     - packageId
     - serialNumber

    """

    def __init__(
        self,
        receiverMid=None,
        productId=None,
        messageTemplate=None,
        language=None,
        country=None,
        packageId=None,
        serialNumber=None,
    ):
        self.receiverMid = receiverMid
        self.productId = productId
        self.messageTemplate = messageTemplate
        self.language = language
        self.country = country
        self.packageId = packageId
        self.serialNumber = serialNumber

    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 == 2:
                if ftype == TType.STRING:
                    self.receiverMid = (
                        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.productId = (
                        iprot.readString().decode('utf-8')
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I32:
                    self.messageTemplate = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRING:
                    self.language = (
                        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.country = (
                        iprot.readString().decode('utf-8')
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 7:
                if ftype == TType.I64:
                    self.packageId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 8:
                if ftype == TType.STRING:
                    self.serialNumber = (
                        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('buyMustbuyProduct_args')
        if self.receiverMid is not None:
            oprot.writeFieldBegin('receiverMid', TType.STRING, 2)
            oprot.writeString(
                self.receiverMid.encode('utf-8')
                if sys.version_info[0] == 2
                else self.receiverMid
            )
            oprot.writeFieldEnd()
        if self.productId is not None:
            oprot.writeFieldBegin('productId', TType.STRING, 3)
            oprot.writeString(
                self.productId.encode('utf-8')
                if sys.version_info[0] == 2
                else self.productId
            )
            oprot.writeFieldEnd()
        if self.messageTemplate is not None:
            oprot.writeFieldBegin('messageTemplate', TType.I32, 4)
            oprot.writeI32(self.messageTemplate)
            oprot.writeFieldEnd()
        if self.language is not None:
            oprot.writeFieldBegin('language', TType.STRING, 5)
            oprot.writeString(
                self.language.encode('utf-8')
                if sys.version_info[0] == 2
                else self.language
            )
            oprot.writeFieldEnd()
        if self.country is not None:
            oprot.writeFieldBegin('country', TType.STRING, 6)
            oprot.writeString(
                self.country.encode('utf-8')
                if sys.version_info[0] == 2
                else self.country
            )
            oprot.writeFieldEnd()
        if self.packageId is not None:
            oprot.writeFieldBegin('packageId', TType.I64, 7)
            oprot.writeI64(self.packageId)
            oprot.writeFieldEnd()
        if self.serialNumber is not None:
            oprot.writeFieldBegin('serialNumber', TType.STRING, 8)
            oprot.writeString(
                self.serialNumber.encode('utf-8')
                if sys.version_info[0] == 2
                else self.serialNumber
            )
            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(buyMustbuyProduct_args)
buyMustbuyProduct_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.STRING,
        'receiverMid',
        'UTF8',
        None,
    ),  # 2
    (
        3,
        TType.STRING,
        'productId',
        'UTF8',
        None,
    ),  # 3
    (
        4,
        TType.I32,
        'messageTemplate',
        None,
        None,
    ),  # 4
    (
        5,
        TType.STRING,
        'language',
        'UTF8',
        None,
    ),  # 5
    (
        6,
        TType.STRING,
        'country',
        'UTF8',
        None,
    ),  # 6
    (
        7,
        TType.I64,
        'packageId',
        None,
        None,
    ),  # 7
    (
        8,
        TType.STRING,
        'serialNumber',
        'UTF8',
        None,
    ),  # 8
)


class buyMustbuyProduct_result(object):
    """
    Attributes:
     - e

    """

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

    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.e = TalkException()
                    self.e.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('buyMustbuyProduct_result')
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(buyMustbuyProduct_result)
buyMustbuyProduct_result.thrift_spec = (
    None,  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [TalkException, None],
        None,
    ),  # 1
)


class checkCanReceivePresent_args(object):
    """
    Attributes:
     - recipientMid
     - packageId
     - language
     - country

    """

    def __init__(
        self,
        recipientMid=None,
        packageId=None,
        language=None,
        country=None,
    ):
        self.recipientMid = recipientMid
        self.packageId = packageId
        self.language = language
        self.country = country

    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 == 2:
                if ftype == TType.STRING:
                    self.recipientMid = (
                        iprot.readString().decode('utf-8')
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I64:
                    self.packageId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRING:
                    self.language = (
                        iprot.readString().decode('utf-8')
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRING:
                    self.country = (
                        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('checkCanReceivePresent_args')
        if self.recipientMid is not None:
            oprot.writeFieldBegin('recipientMid', TType.STRING, 2)
            oprot.writeString(
                self.recipientMid.encode('utf-8')
                if sys.version_info[0] == 2
                else self.recipientMid
            )
            oprot.writeFieldEnd()
        if self.packageId is not None:
            oprot.writeFieldBegin('packageId', TType.I64, 3)
            oprot.writeI64(self.packageId)
            oprot.writeFieldEnd()
        if self.language is not None:
            oprot.writeFieldBegin('language', TType.STRING, 4)
            oprot.writeString(
                self.language.encode('utf-8')
                if sys.version_info[0] == 2
                else self.language
            )
            oprot.writeFieldEnd()
        if self.country is not None:
            oprot.writeFieldBegin('country', TType.STRING, 5)
            oprot.writeString(
                self.country.encode('utf-8')
                if sys.version_info[0] == 2
                else self.country
            )
            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(checkCanReceivePresent_args)
checkCanReceivePresent_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.STRING,
        'recipientMid',
        'UTF8',
        None,
    ),  # 2
    (
        3,
        TType.I64,
        'packageId',
        None,
        None,
    ),  # 3
    (
        4,
        TType.STRING,
        'language',
        'UTF8',
        None,
    ),  # 4
    (
        5,
        TType.STRING,
        'country',
        'UTF8',
        None,
    ),  # 5
)


class checkCanReceivePresent_result(object):
    """
    Attributes:
     - e

    """

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

    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.e = TalkException()
                    self.e.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('checkCanReceivePresent_result')
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(checkCanReceivePresent_result)
checkCanReceivePresent_result.thrift_spec = (
    None,  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [TalkException, None],
        None,
    ),  # 1
)


class getActivePurchases_args(object):
    """
    Attributes:
     - start
     - size
     - language
     - country

    """

    def __init__(
        self,
        start=None,
        size=None,
        language=None,
        country=None,
    ):
        self.start = start
        self.size = size
        self.language = language
        self.country = country

    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 == 2:
                if ftype == TType.I64:
                    self.start = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.size = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRING:
                    self.language = (
                        iprot.readString().decode('utf-8')
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRING:
                    self.country = (
                        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('getActivePurchases_args')
        if self.start is not None:
            oprot.writeFieldBegin('start', TType.I64, 2)
            oprot.writeI64(self.start)
            oprot.writeFieldEnd()
        if self.size is not None:
            oprot.writeFieldBegin('size', TType.I32, 3)
            oprot.writeI32(self.size)
            oprot.writeFieldEnd()
        if self.language is not None:
            oprot.writeFieldBegin('language', TType.STRING, 4)
            oprot.writeString(
                self.language.encode('utf-8')
                if sys.version_info[0] == 2
                else self.language
            )
            oprot.writeFieldEnd()
        if self.country is not None:
            oprot.writeFieldBegin('country', TType.STRING, 5)
            oprot.writeString(
                self.country.encode('utf-8')
                if sys.version_info[0] == 2
                else self.country
            )
            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(getActivePurchases_args)
getActivePurchases_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.I64,
        'start',
        None,
        None,
    ),  # 2
    (
        3,
        TType.I32,
        'size',
        None,
        None,
    ),  # 3
    (
        4,
        TType.STRING,
        'language',
        'UTF8',
        None,
    ),  # 4
    (
        5,
        TType.STRING,
        'country',
        'UTF8',
        None,
    ),  # 5
)


class getActivePurchases_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = ProductList()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = TalkException()
                    self.e.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('getActivePurchases_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(getActivePurchases_result)
getActivePurchases_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [ProductList, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [TalkException, None],
        None,
    ),  # 1
)


class getActivePurchaseVersions_args(object):
    """
    Attributes:
     - start
     - size
     - language
     - country

    """

    def __init__(
        self,
        start=None,
        size=None,
        language=None,
        country=None,
    ):
        self.start = start
        self.size = size
        self.language = language
        self.country = country

    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 == 2:
                if ftype == TType.I64:
                    self.start = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.size = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRING:
                    self.language = (
                        iprot.readString().decode('utf-8')
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRING:
                    self.country = (
                        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('getActivePurchaseVersions_args')
        if self.start is not None:
            oprot.writeFieldBegin('start', TType.I64, 2)
            oprot.writeI64(self.start)
            oprot.writeFieldEnd()
        if self.size is not None:
            oprot.writeFieldBegin('size', TType.I32, 3)
            oprot.writeI32(self.size)
            oprot.writeFieldEnd()
        if self.language is not None:
            oprot.writeFieldBegin('language', TType.STRING, 4)
            oprot.writeString(
                self.language.encode('utf-8')
                if sys.version_info[0] == 2
                else self.language
            )
            oprot.writeFieldEnd()
        if self.country is not None:
            oprot.writeFieldBegin('country', TType.STRING, 5)
            oprot.writeString(
                self.country.encode('utf-8')
                if sys.version_info[0] == 2
                else self.country
            )
            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(getActivePurchaseVersions_args)
getActivePurchaseVersions_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.I64,
        'start',
        None,
        None,
    ),  # 2
    (
        3,
        TType.I32,
        'size',
        None,
        None,
    ),  # 3
    (
        4,
        TType.STRING,
        'language',
        'UTF8',
        None,
    ),  # 4
    (
        5,
        TType.STRING,
        'country',
        'UTF8',
        None,
    ),  # 5
)


class getActivePurchaseVersions_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = ProductSimpleList()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = TalkException()
                    self.e.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('getActivePurchaseVersions_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(getActivePurchaseVersions_result)
getActivePurchaseVersions_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [ProductSimpleList, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [TalkException, None],
        None,
    ),  # 1
)


class getCoinProducts_args(object):
    """
    Attributes:
     - appStoreCode
     - country
     - language

    """

    def __init__(
        self,
        appStoreCode=None,
        country=None,
        language=None,
    ):
        self.appStoreCode = appStoreCode
        self.country = country
        self.language = language

    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 == 2:
                if ftype == TType.I32:
                    self.appStoreCode = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.country = (
                        iprot.readString().decode('utf-8')
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRING:
                    self.language = (
                        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('getCoinProducts_args')
        if self.appStoreCode is not None:
            oprot.writeFieldBegin('appStoreCode', TType.I32, 2)
            oprot.writeI32(self.appStoreCode)
            oprot.writeFieldEnd()
        if self.country is not None:
            oprot.writeFieldBegin('country', TType.STRING, 3)
            oprot.writeString(
                self.country.encode('utf-8')
                if sys.version_info[0] == 2
                else self.country
            )
            oprot.writeFieldEnd()
        if self.language is not None:
            oprot.writeFieldBegin('language', TType.STRING, 4)
            oprot.writeString(
                self.language.encode('utf-8')
                if sys.version_info[0] == 2
                else self.language
            )
            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(getCoinProducts_args)
getCoinProducts_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.I32,
        'appStoreCode',
        None,
        None,
    ),  # 2
    (
        3,
        TType.STRING,
        'country',
        'UTF8',
        None,
    ),  # 3
    (
        4,
        TType.STRING,
        'language',
        'UTF8',
        None,
    ),  # 4
)


class getCoinProducts_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = []
                    (_etype2687, _size2684) = iprot.readListBegin()
                    for _i2688 in range(_size2684):
                        _elem2689 = CoinProductItem()
                        _elem2689.read(iprot)
                        self.success.append(_elem2689)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = TalkException()
                    self.e.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('getCoinProducts_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.LIST, 0)
            oprot.writeListBegin(TType.STRUCT, len(self.success))
            for iter2690 in self.success:
                iter2690.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(getCoinProducts_result)
getCoinProducts_result.thrift_spec = (
    (
        0,
        TType.LIST,
        'success',
        (TType.STRUCT, [CoinProductItem, None], False),
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [TalkException, None],
        None,
    ),  # 1
)


class getCoinProductsByPgCode_args(object):
    """
    Attributes:
     - appStoreCode
     - pgCode
     - country
     - language

    """

    def __init__(
        self,
        appStoreCode=None,
        pgCode=None,
        country=None,
        language=None,
    ):
        self.appStoreCode = appStoreCode
        self.pgCode = pgCode
        self.country = country
        self.language = language

    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 == 2:
                if ftype == TType.I32:
                    self.appStoreCode = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.pgCode = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRING:
                    self.country = (
                        iprot.readString().decode('utf-8')
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRING:
                    self.language = (
                        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('getCoinProductsByPgCode_args')
        if self.appStoreCode is not None:
            oprot.writeFieldBegin('appStoreCode', TType.I32, 2)
            oprot.writeI32(self.appStoreCode)
            oprot.writeFieldEnd()
        if self.pgCode is not None:
            oprot.writeFieldBegin('pgCode', TType.I32, 3)
            oprot.writeI32(self.pgCode)
            oprot.writeFieldEnd()
        if self.country is not None:
            oprot.writeFieldBegin('country', TType.STRING, 4)
            oprot.writeString(
                self.country.encode('utf-8')
                if sys.version_info[0] == 2
                else self.country
            )
            oprot.writeFieldEnd()
        if self.language is not None:
            oprot.writeFieldBegin('language', TType.STRING, 5)
            oprot.writeString(
                self.language.encode('utf-8')
                if sys.version_info[0] == 2
                else self.language
            )
            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(getCoinProductsByPgCode_args)
getCoinProductsByPgCode_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.I32,
        'appStoreCode',
        None,
        None,
    ),  # 2
    (
        3,
        TType.I32,
        'pgCode',
        None,
        None,
    ),  # 3
    (
        4,
        TType.STRING,
        'country',
        'UTF8',
        None,
    ),  # 4
    (
        5,
        TType.STRING,
        'language',
        'UTF8',
        None,
    ),  # 5
)


class getCoinProductsByPgCode_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = []
                    (_etype2694, _size2691) = iprot.readListBegin()
                    for _i2695 in range(_size2691):
                        _elem2696 = CoinProductItem()
                        _elem2696.read(iprot)
                        self.success.append(_elem2696)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = TalkException()
                    self.e.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('getCoinProductsByPgCode_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.LIST, 0)
            oprot.writeListBegin(TType.STRUCT, len(self.success))
            for iter2697 in self.success:
                iter2697.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(getCoinProductsByPgCode_result)
getCoinProductsByPgCode_result.thrift_spec = (
    (
        0,
        TType.LIST,
        'success',
        (TType.STRUCT, [CoinProductItem, None], False),
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [TalkException, None],
        None,
    ),  # 1
)


class getCoinPurchaseHistory_args(object):
    """
    Attributes:
     - request

    """

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

    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 == 2:
                if ftype == TType.STRUCT:
                    self.request = CoinHistoryCondition()
                    self.request.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('getCoinPurchaseHistory_args')
        if self.request is not None:
            oprot.writeFieldBegin('request', TType.STRUCT, 2)
            self.request.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(getCoinPurchaseHistory_args)
getCoinPurchaseHistory_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.STRUCT,
        'request',
        [CoinHistoryCondition, None],
        None,
    ),  # 2
)


class getCoinPurchaseHistory_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = CoinHistoryResult()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = TalkException()
                    self.e.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('getCoinPurchaseHistory_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(getCoinPurchaseHistory_result)
getCoinPurchaseHistory_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [CoinHistoryResult, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [TalkException, None],
        None,
    ),  # 1
)


class getCoinUseAndRefundHistory_args(object):
    """
    Attributes:
     - request

    """

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

    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 == 2:
                if ftype == TType.STRUCT:
                    self.request = CoinHistoryCondition()
                    self.request.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('getCoinUseAndRefundHistory_args')
        if self.request is not None:
            oprot.writeFieldBegin('request', TType.STRUCT, 2)
            self.request.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(getCoinUseAndRefundHistory_args)
getCoinUseAndRefundHistory_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.STRUCT,
        'request',
        [CoinHistoryCondition, None],
        None,
    ),  # 2
)


class getCoinUseAndRefundHistory_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = CoinHistoryResult()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = TalkException()
                    self.e.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('getCoinUseAndRefundHistory_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(getCoinUseAndRefundHistory_result)
getCoinUseAndRefundHistory_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [CoinHistoryResult, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [TalkException, None],
        None,
    ),  # 1
)


class getDownloads_args(object):
    """
    Attributes:
     - start
     - size
     - language
     - country

    """

    def __init__(
        self,
        start=None,
        size=None,
        language=None,
        country=None,
    ):
        self.start = start
        self.size = size
        self.language = language
        self.country = country

    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 == 2:
                if ftype == TType.I64:
                    self.start = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.size = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRING:
                    self.language = (
                        iprot.readString().decode('utf-8')
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRING:
                    self.country = (
                        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('getDownloads_args')
        if self.start is not None:
            oprot.writeFieldBegin('start', TType.I64, 2)
            oprot.writeI64(self.start)
            oprot.writeFieldEnd()
        if self.size is not None:
            oprot.writeFieldBegin('size', TType.I32, 3)
            oprot.writeI32(self.size)
            oprot.writeFieldEnd()
        if self.language is not None:
            oprot.writeFieldBegin('language', TType.STRING, 4)
            oprot.writeString(
                self.language.encode('utf-8')
                if sys.version_info[0] == 2
                else self.language
            )
            oprot.writeFieldEnd()
        if self.country is not None:
            oprot.writeFieldBegin('country', TType.STRING, 5)
            oprot.writeString(
                self.country.encode('utf-8')
                if sys.version_info[0] == 2
                else self.country
            )
            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(getDownloads_args)
getDownloads_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.I64,
        'start',
        None,
        None,
    ),  # 2
    (
        3,
        TType.I32,
        'size',
        None,
        None,
    ),  # 3
    (
        4,
        TType.STRING,
        'language',
        'UTF8',
        None,
    ),  # 4
    (
        5,
        TType.STRING,
        'country',
        'UTF8',
        None,
    ),  # 5
)


class getDownloads_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = ProductList()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = TalkException()
                    self.e.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('getDownloads_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(getDownloads_result)
getDownloads_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [ProductList, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [TalkException, None],
        None,
    ),  # 1
)


class getEventPackages_args(object):
    """
    Attributes:
     - start
     - size
     - language
     - country

    """

    def __init__(
        self,
        start=None,
        size=None,
        language=None,
        country=None,
    ):
        self.start = start
        self.size = size
        self.language = language
        self.country = country

    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 == 2:
                if ftype == TType.I64:
                    self.start = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.size = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRING:
                    self.language = (
                        iprot.readString().decode('utf-8')
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRING:
                    self.country = (
                        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('getEventPackages_args')
        if self.start is not None:
            oprot.writeFieldBegin('start', TType.I64, 2)
            oprot.writeI64(self.start)
            oprot.writeFieldEnd()
        if self.size is not None:
            oprot.writeFieldBegin('size', TType.I32, 3)
            oprot.writeI32(self.size)
            oprot.writeFieldEnd()
        if self.language is not None:
            oprot.writeFieldBegin('language', TType.STRING, 4)
            oprot.writeString(
                self.language.encode('utf-8')
                if sys.version_info[0] == 2
                else self.language
            )
            oprot.writeFieldEnd()
        if self.country is not None:
            oprot.writeFieldBegin('country', TType.STRING, 5)
            oprot.writeString(
                self.country.encode('utf-8')
                if sys.version_info[0] == 2
                else self.country
            )
            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(getEventPackages_args)
getEventPackages_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.I64,
        'start',
        None,
        None,
    ),  # 2
    (
        3,
        TType.I32,
        'size',
        None,
        None,
    ),  # 3
    (
        4,
        TType.STRING,
        'language',
        'UTF8',
        None,
    ),  # 4
    (
        5,
        TType.STRING,
        'country',
        'UTF8',
        None,
    ),  # 5
)


class getEventPackages_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = ProductList()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = TalkException()
                    self.e.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('getEventPackages_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(getEventPackages_result)
getEventPackages_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [ProductList, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [TalkException, None],
        None,
    ),  # 1
)


class getNewlyReleasedPackages_args(object):
    """
    Attributes:
     - start
     - size
     - language
     - country

    """

    def __init__(
        self,
        start=None,
        size=None,
        language=None,
        country=None,
    ):
        self.start = start
        self.size = size
        self.language = language
        self.country = country

    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 == 2:
                if ftype == TType.I64:
                    self.start = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.size = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRING:
                    self.language = (
                        iprot.readString().decode('utf-8')
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRING:
                    self.country = (
                        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('getNewlyReleasedPackages_args')
        if self.start is not None:
            oprot.writeFieldBegin('start', TType.I64, 2)
            oprot.writeI64(self.start)
            oprot.writeFieldEnd()
        if self.size is not None:
            oprot.writeFieldBegin('size', TType.I32, 3)
            oprot.writeI32(self.size)
            oprot.writeFieldEnd()
        if self.language is not None:
            oprot.writeFieldBegin('language', TType.STRING, 4)
            oprot.writeString(
                self.language.encode('utf-8')
                if sys.version_info[0] == 2
                else self.language
            )
            oprot.writeFieldEnd()
        if self.country is not None:
            oprot.writeFieldBegin('country', TType.STRING, 5)
            oprot.writeString(
                self.country.encode('utf-8')
                if sys.version_info[0] == 2
                else self.country
            )
            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(getNewlyReleasedPackages_args)
getNewlyReleasedPackages_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.I64,
        'start',
        None,
        None,
    ),  # 2
    (
        3,
        TType.I32,
        'size',
        None,
        None,
    ),  # 3
    (
        4,
        TType.STRING,
        'language',
        'UTF8',
        None,
    ),  # 4
    (
        5,
        TType.STRING,
        'country',
        'UTF8',
        None,
    ),  # 5
)


class getNewlyReleasedPackages_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = ProductList()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = TalkException()
                    self.e.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('getNewlyReleasedPackages_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(getNewlyReleasedPackages_result)
getNewlyReleasedPackages_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [ProductList, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [TalkException, None],
        None,
    ),  # 1
)


class getPopularPackages_args(object):
    """
    Attributes:
     - start
     - size
     - language
     - country

    """

    def __init__(
        self,
        start=None,
        size=None,
        language=None,
        country=None,
    ):
        self.start = start
        self.size = size
        self.language = language
        self.country = country

    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 == 2:
                if ftype == TType.I64:
                    self.start = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.size = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRING:
                    self.language = (
                        iprot.readString().decode('utf-8')
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRING:
                    self.country = (
                        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('getPopularPackages_args')
        if self.start is not None:
            oprot.writeFieldBegin('start', TType.I64, 2)
            oprot.writeI64(self.start)
            oprot.writeFieldEnd()
        if self.size is not None:
            oprot.writeFieldBegin('size', TType.I32, 3)
            oprot.writeI32(self.size)
            oprot.writeFieldEnd()
        if self.language is not None:
            oprot.writeFieldBegin('language', TType.STRING, 4)
            oprot.writeString(
                self.language.encode('utf-8')
                if sys.version_info[0] == 2
                else self.language
            )
            oprot.writeFieldEnd()
        if self.country is not None:
            oprot.writeFieldBegin('country', TType.STRING, 5)
            oprot.writeString(
                self.country.encode('utf-8')
                if sys.version_info[0] == 2
                else self.country
            )
            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(getPopularPackages_args)
getPopularPackages_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.I64,
        'start',
        None,
        None,
    ),  # 2
    (
        3,
        TType.I32,
        'size',
        None,
        None,
    ),  # 3
    (
        4,
        TType.STRING,
        'language',
        'UTF8',
        None,
    ),  # 4
    (
        5,
        TType.STRING,
        'country',
        'UTF8',
        None,
    ),  # 5
)


class getPopularPackages_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = ProductList()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = TalkException()
                    self.e.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('getPopularPackages_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(getPopularPackages_result)
getPopularPackages_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [ProductList, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [TalkException, None],
        None,
    ),  # 1
)


class getPresentsReceived_args(object):
    """
    Attributes:
     - start
     - size
     - language
     - country

    """

    def __init__(
        self,
        start=None,
        size=None,
        language=None,
        country=None,
    ):
        self.start = start
        self.size = size
        self.language = language
        self.country = country

    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 == 2:
                if ftype == TType.I64:
                    self.start = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.size = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRING:
                    self.language = (
                        iprot.readString().decode('utf-8')
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRING:
                    self.country = (
                        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('getPresentsReceived_args')
        if self.start is not None:
            oprot.writeFieldBegin('start', TType.I64, 2)
            oprot.writeI64(self.start)
            oprot.writeFieldEnd()
        if self.size is not None:
            oprot.writeFieldBegin('size', TType.I32, 3)
            oprot.writeI32(self.size)
            oprot.writeFieldEnd()
        if self.language is not None:
            oprot.writeFieldBegin('language', TType.STRING, 4)
            oprot.writeString(
                self.language.encode('utf-8')
                if sys.version_info[0] == 2
                else self.language
            )
            oprot.writeFieldEnd()
        if self.country is not None:
            oprot.writeFieldBegin('country', TType.STRING, 5)
            oprot.writeString(
                self.country.encode('utf-8')
                if sys.version_info[0] == 2
                else self.country
            )
            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(getPresentsReceived_args)
getPresentsReceived_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.I64,
        'start',
        None,
        None,
    ),  # 2
    (
        3,
        TType.I32,
        'size',
        None,
        None,
    ),  # 3
    (
        4,
        TType.STRING,
        'language',
        'UTF8',
        None,
    ),  # 4
    (
        5,
        TType.STRING,
        'country',
        'UTF8',
        None,
    ),  # 5
)


class getPresentsReceived_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = ProductList()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = TalkException()
                    self.e.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('getPresentsReceived_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(getPresentsReceived_result)
getPresentsReceived_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [ProductList, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [TalkException, None],
        None,
    ),  # 1
)


class getPresentsSent_args(object):
    """
    Attributes:
     - start
     - size
     - language
     - country

    """

    def __init__(
        self,
        start=None,
        size=None,
        language=None,
        country=None,
    ):
        self.start = start
        self.size = size
        self.language = language
        self.country = country

    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 == 2:
                if ftype == TType.I64:
                    self.start = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.size = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRING:
                    self.language = (
                        iprot.readString().decode('utf-8')
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRING:
                    self.country = (
                        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('getPresentsSent_args')
        if self.start is not None:
            oprot.writeFieldBegin('start', TType.I64, 2)
            oprot.writeI64(self.start)
            oprot.writeFieldEnd()
        if self.size is not None:
            oprot.writeFieldBegin('size', TType.I32, 3)
            oprot.writeI32(self.size)
            oprot.writeFieldEnd()
        if self.language is not None:
            oprot.writeFieldBegin('language', TType.STRING, 4)
            oprot.writeString(
                self.language.encode('utf-8')
                if sys.version_info[0] == 2
                else self.language
            )
            oprot.writeFieldEnd()
        if self.country is not None:
            oprot.writeFieldBegin('country', TType.STRING, 5)
            oprot.writeString(
                self.country.encode('utf-8')
                if sys.version_info[0] == 2
                else self.country
            )
            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(getPresentsSent_args)
getPresentsSent_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.I64,
        'start',
        None,
        None,
    ),  # 2
    (
        3,
        TType.I32,
        'size',
        None,
        None,
    ),  # 3
    (
        4,
        TType.STRING,
        'language',
        'UTF8',
        None,
    ),  # 4
    (
        5,
        TType.STRING,
        'country',
        'UTF8',
        None,
    ),  # 5
)


class getPresentsSent_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = ProductList()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = TalkException()
                    self.e.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('getPresentsSent_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(getPresentsSent_result)
getPresentsSent_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [ProductList, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [TalkException, None],
        None,
    ),  # 1
)


class getProductList_args(object):
    """
    Attributes:
     - productIdList
     - language
     - country

    """

    def __init__(
        self,
        productIdList=None,
        language=None,
        country=None,
    ):
        self.productIdList = productIdList
        self.language = language
        self.country = country

    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 == 2:
                if ftype == TType.LIST:
                    self.productIdList = []
                    (_etype2701, _size2698) = iprot.readListBegin()
                    for _i2702 in range(_size2698):
                        _elem2703 = (
                            iprot.readString().decode('utf-8')
                            if sys.version_info[0] == 2
                            else iprot.readString()
                        )
                        self.productIdList.append(_elem2703)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.language = (
                        iprot.readString().decode('utf-8')
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRING:
                    self.country = (
                        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('getProductList_args')
        if self.productIdList is not None:
            oprot.writeFieldBegin('productIdList', TType.LIST, 2)
            oprot.writeListBegin(TType.STRING, len(self.productIdList))
            for iter2704 in self.productIdList:
                oprot.writeString(
                    iter2704.encode('utf-8') if sys.version_info[0] == 2 else iter2704
                )
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.language is not None:
            oprot.writeFieldBegin('language', TType.STRING, 3)
            oprot.writeString(
                self.language.encode('utf-8')
                if sys.version_info[0] == 2
                else self.language
            )
            oprot.writeFieldEnd()
        if self.country is not None:
            oprot.writeFieldBegin('country', TType.STRING, 4)
            oprot.writeString(
                self.country.encode('utf-8')
                if sys.version_info[0] == 2
                else self.country
            )
            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(getProductList_args)
getProductList_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.LIST,
        'productIdList',
        (TType.STRING, 'UTF8', False),
        None,
    ),  # 2
    (
        3,
        TType.STRING,
        'language',
        'UTF8',
        None,
    ),  # 3
    (
        4,
        TType.STRING,
        'country',
        'UTF8',
        None,
    ),  # 4
)


class getProductList_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = ProductList()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = TalkException()
                    self.e.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('getProductList_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(getProductList_result)
getProductList_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [ProductList, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [TalkException, None],
        None,
    ),  # 1
)


class getProductListWithCarrier_args(object):
    """
    Attributes:
     - productIdList
     - language
     - country
     - carrierCode

    """

    def __init__(
        self,
        productIdList=None,
        language=None,
        country=None,
        carrierCode=None,
    ):
        self.productIdList = productIdList
        self.language = language
        self.country = country
        self.carrierCode = carrierCode

    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 == 2:
                if ftype == TType.LIST:
                    self.productIdList = []
                    (_etype2708, _size2705) = iprot.readListBegin()
                    for _i2709 in range(_size2705):
                        _elem2710 = (
                            iprot.readString().decode('utf-8')
                            if sys.version_info[0] == 2
                            else iprot.readString()
                        )
                        self.productIdList.append(_elem2710)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.language = (
                        iprot.readString().decode('utf-8')
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRING:
                    self.country = (
                        iprot.readString().decode('utf-8')
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRING:
                    self.carrierCode = (
                        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('getProductListWithCarrier_args')
        if self.productIdList is not None:
            oprot.writeFieldBegin('productIdList', TType.LIST, 2)
            oprot.writeListBegin(TType.STRING, len(self.productIdList))
            for iter2711 in self.productIdList:
                oprot.writeString(
                    iter2711.encode('utf-8') if sys.version_info[0] == 2 else iter2711
                )
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.language is not None:
            oprot.writeFieldBegin('language', TType.STRING, 3)
            oprot.writeString(
                self.language.encode('utf-8')
                if sys.version_info[0] == 2
                else self.language
            )
            oprot.writeFieldEnd()
        if self.country is not None:
            oprot.writeFieldBegin('country', TType.STRING, 4)
            oprot.writeString(
                self.country.encode('utf-8')
                if sys.version_info[0] == 2
                else self.country
            )
            oprot.writeFieldEnd()
        if self.carrierCode is not None:
            oprot.writeFieldBegin('carrierCode', TType.STRING, 5)
            oprot.writeString(
                self.carrierCode.encode('utf-8')
                if sys.version_info[0] == 2
                else self.carrierCode
            )
            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(getProductListWithCarrier_args)
getProductListWithCarrier_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.LIST,
        'productIdList',
        (TType.STRING, 'UTF8', False),
        None,
    ),  # 2
    (
        3,
        TType.STRING,
        'language',
        'UTF8',
        None,
    ),  # 3
    (
        4,
        TType.STRING,
        'country',
        'UTF8',
        None,
    ),  # 4
    (
        5,
        TType.STRING,
        'carrierCode',
        'UTF8',
        None,
    ),  # 5
)


class getProductListWithCarrier_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = ProductList()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = TalkException()
                    self.e.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('getProductListWithCarrier_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(getProductListWithCarrier_result)
getProductListWithCarrier_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [ProductList, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [TalkException, None],
        None,
    ),  # 1
)


class getProductWithCarrier_args(object):
    """
    Attributes:
     - packageID
     - language
     - country
     - carrierCode

    """

    def __init__(
        self,
        packageID=None,
        language=None,
        country=None,
        carrierCode=None,
    ):
        self.packageID = packageID
        self.language = language
        self.country = country
        self.carrierCode = carrierCode

    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 == 2:
                if ftype == TType.I64:
                    self.packageID = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.language = (
                        iprot.readString().decode('utf-8')
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRING:
                    self.country = (
                        iprot.readString().decode('utf-8')
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRING:
                    self.carrierCode = (
                        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('getProductWithCarrier_args')
        if self.packageID is not None:
            oprot.writeFieldBegin('packageID', TType.I64, 2)
            oprot.writeI64(self.packageID)
            oprot.writeFieldEnd()
        if self.language is not None:
            oprot.writeFieldBegin('language', TType.STRING, 3)
            oprot.writeString(
                self.language.encode('utf-8')
                if sys.version_info[0] == 2
                else self.language
            )
            oprot.writeFieldEnd()
        if self.country is not None:
            oprot.writeFieldBegin('country', TType.STRING, 4)
            oprot.writeString(
                self.country.encode('utf-8')
                if sys.version_info[0] == 2
                else self.country
            )
            oprot.writeFieldEnd()
        if self.carrierCode is not None:
            oprot.writeFieldBegin('carrierCode', TType.STRING, 5)
            oprot.writeString(
                self.carrierCode.encode('utf-8')
                if sys.version_info[0] == 2
                else self.carrierCode
            )
            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(getProductWithCarrier_args)
getProductWithCarrier_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.I64,
        'packageID',
        None,
        None,
    ),  # 2
    (
        3,
        TType.STRING,
        'language',
        'UTF8',
        None,
    ),  # 3
    (
        4,
        TType.STRING,
        'country',
        'UTF8',
        None,
    ),  # 4
    (
        5,
        TType.STRING,
        'carrierCode',
        'UTF8',
        None,
    ),  # 5
)


class getProductWithCarrier_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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.e = TalkException()
                    self.e.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('getProductWithCarrier_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(getProductWithCarrier_result)
getProductWithCarrier_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [Product, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [TalkException, None],
        None,
    ),  # 1
)


class getPurchaseHistory_args(object):
    """
    Attributes:
     - start
     - size
     - language
     - country

    """

    def __init__(
        self,
        start=None,
        size=None,
        language=None,
        country=None,
    ):
        self.start = start
        self.size = size
        self.language = language
        self.country = country

    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 == 2:
                if ftype == TType.I64:
                    self.start = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.size = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRING:
                    self.language = (
                        iprot.readString().decode('utf-8')
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRING:
                    self.country = (
                        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('getPurchaseHistory_args')
        if self.start is not None:
            oprot.writeFieldBegin('start', TType.I64, 2)
            oprot.writeI64(self.start)
            oprot.writeFieldEnd()
        if self.size is not None:
            oprot.writeFieldBegin('size', TType.I32, 3)
            oprot.writeI32(self.size)
            oprot.writeFieldEnd()
        if self.language is not None:
            oprot.writeFieldBegin('language', TType.STRING, 4)
            oprot.writeString(
                self.language.encode('utf-8')
                if sys.version_info[0] == 2
                else self.language
            )
            oprot.writeFieldEnd()
        if self.country is not None:
            oprot.writeFieldBegin('country', TType.STRING, 5)
            oprot.writeString(
                self.country.encode('utf-8')
                if sys.version_info[0] == 2
                else self.country
            )
            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(getPurchaseHistory_args)
getPurchaseHistory_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.I64,
        'start',
        None,
        None,
    ),  # 2
    (
        3,
        TType.I32,
        'size',
        None,
        None,
    ),  # 3
    (
        4,
        TType.STRING,
        'language',
        'UTF8',
        None,
    ),  # 4
    (
        5,
        TType.STRING,
        'country',
        'UTF8',
        None,
    ),  # 5
)


class getPurchaseHistory_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = ProductList()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = TalkException()
                    self.e.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('getPurchaseHistory_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(getPurchaseHistory_result)
getPurchaseHistory_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [ProductList, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [TalkException, None],
        None,
    ),  # 1
)


class getTotalBalance_args(object):
    """
    Attributes:
     - appStoreCode

    """

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

    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 == 2:
                if ftype == TType.I32:
                    self.appStoreCode = 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('getTotalBalance_args')
        if self.appStoreCode is not None:
            oprot.writeFieldBegin('appStoreCode', TType.I32, 2)
            oprot.writeI32(self.appStoreCode)
            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(getTotalBalance_args)
getTotalBalance_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.I32,
        'appStoreCode',
        None,
        None,
    ),  # 2
)


class getTotalBalance_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = Coin()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = TalkException()
                    self.e.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('getTotalBalance_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(getTotalBalance_result)
getTotalBalance_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [Coin, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [TalkException, None],
        None,
    ),  # 1
)


class notifyDownloaded_args(object):
    """
    Attributes:
     - packageId
     - language

    """

    def __init__(
        self,
        packageId=None,
        language=None,
    ):
        self.packageId = packageId
        self.language = language

    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 == 2:
                if ftype == TType.I64:
                    self.packageId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.language = (
                        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('notifyDownloaded_args')
        if self.packageId is not None:
            oprot.writeFieldBegin('packageId', TType.I64, 2)
            oprot.writeI64(self.packageId)
            oprot.writeFieldEnd()
        if self.language is not None:
            oprot.writeFieldBegin('language', TType.STRING, 3)
            oprot.writeString(
                self.language.encode('utf-8')
                if sys.version_info[0] == 2
                else self.language
            )
            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(notifyDownloaded_args)
notifyDownloaded_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.I64,
        'packageId',
        None,
        None,
    ),  # 2
    (
        3,
        TType.STRING,
        'language',
        'UTF8',
        None,
    ),  # 3
)


class notifyDownloaded_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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.I64:
                    self.success = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = TalkException()
                    self.e.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('notifyDownloaded_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.I64, 0)
            oprot.writeI64(self.success)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(notifyDownloaded_result)
notifyDownloaded_result.thrift_spec = (
    (
        0,
        TType.I64,
        'success',
        None,
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [TalkException, None],
        None,
    ),  # 1
)


class reserveCoinPurchase_args(object):
    """
    Attributes:
     - request

    """

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

    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 == 2:
                if ftype == TType.STRUCT:
                    self.request = CoinPurchaseReservation()
                    self.request.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('reserveCoinPurchase_args')
        if self.request is not None:
            oprot.writeFieldBegin('request', TType.STRUCT, 2)
            self.request.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(reserveCoinPurchase_args)
reserveCoinPurchase_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.STRUCT,
        'request',
        [CoinPurchaseReservation, None],
        None,
    ),  # 2
)


class reserveCoinPurchase_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = PaymentReservationResult()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = TalkException()
                    self.e.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('reserveCoinPurchase_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(reserveCoinPurchase_result)
reserveCoinPurchase_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [PaymentReservationResult, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [TalkException, None],
        None,
    ),  # 1
)


class reservePayment_args(object):
    """
    Attributes:
     - paymentReservation

    """

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

    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 == 2:
                if ftype == TType.STRUCT:
                    self.paymentReservation = PaymentReservation()
                    self.paymentReservation.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('reservePayment_args')
        if self.paymentReservation is not None:
            oprot.writeFieldBegin('paymentReservation', TType.STRUCT, 2)
            self.paymentReservation.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(reservePayment_args)
reservePayment_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.STRUCT,
        'paymentReservation',
        [PaymentReservation, None],
        None,
    ),  # 2
)


class reservePayment_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = PaymentReservationResult()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = TalkException()
                    self.e.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('reservePayment_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(reservePayment_result)
reservePayment_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [PaymentReservationResult, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [TalkException, None],
        None,
    ),  # 1
)


class canReceivePresent_args(object):
    """
    Attributes:
     - shopId
     - productId
     - locale
     - recipientMid

    """

    def __init__(
        self,
        shopId=None,
        productId=None,
        locale=None,
        recipientMid=None,
    ):
        self.shopId = shopId
        self.productId = productId
        self.locale = locale
        self.recipientMid = recipientMid

    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 == 2:
                if ftype == TType.STRING:
                    self.shopId = (
                        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.productId = (
                        iprot.readString().decode('utf-8')
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRUCT:
                    self.locale = Locale()
                    self.locale.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRING:
                    self.recipientMid = (
                        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('canReceivePresent_args')
        if self.shopId is not None:
            oprot.writeFieldBegin('shopId', TType.STRING, 2)
            oprot.writeString(
                self.shopId.encode('utf-8') if sys.version_info[0] == 2 else self.shopId
            )
            oprot.writeFieldEnd()
        if self.productId is not None:
            oprot.writeFieldBegin('productId', TType.STRING, 3)
            oprot.writeString(
                self.productId.encode('utf-8')
                if sys.version_info[0] == 2
                else self.productId
            )
            oprot.writeFieldEnd()
        if self.locale is not None:
            oprot.writeFieldBegin('locale', TType.STRUCT, 4)
            self.locale.write(oprot)
            oprot.writeFieldEnd()
        if self.recipientMid is not None:
            oprot.writeFieldBegin('recipientMid', TType.STRING, 5)
            oprot.writeString(
                self.recipientMid.encode('utf-8')
                if sys.version_info[0] == 2
                else self.recipientMid
            )
            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(canReceivePresent_args)
canReceivePresent_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.STRING,
        'shopId',
        'UTF8',
        None,
    ),  # 2
    (
        3,
        TType.STRING,
        'productId',
        'UTF8',
        None,
    ),  # 3
    (
        4,
        TType.STRUCT,
        'locale',
        [Locale, None],
        None,
    ),  # 4
    (
        5,
        TType.STRING,
        'recipientMid',
        'UTF8',
        None,
    ),  # 5
)


class canReceivePresent_result(object):
    """
    Attributes:
     - e

    """

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

    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.e = ShopException()
                    self.e.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('canReceivePresent_result')
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(canReceivePresent_result)
canReceivePresent_result.thrift_spec = (
    None,  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [ShopException, None],
        None,
    ),  # 1
)


class getAutoSuggestionShowcase_args(object):
    """
    Attributes:
     - autoSuggestionShowcaseRequest

    """

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

    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 == 2:
                if ftype == TType.STRUCT:
                    self.autoSuggestionShowcaseRequest = AutoSuggestionShowcaseRequest()
                    self.autoSuggestionShowcaseRequest.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('getAutoSuggestionShowcase_args')
        if self.autoSuggestionShowcaseRequest is not None:
            oprot.writeFieldBegin('autoSuggestionShowcaseRequest', TType.STRUCT, 2)
            self.autoSuggestionShowcaseRequest.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(getAutoSuggestionShowcase_args)
getAutoSuggestionShowcase_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.STRUCT,
        'autoSuggestionShowcaseRequest',
        [AutoSuggestionShowcaseRequest, None],
        None,
    ),  # 2
)


class getAutoSuggestionShowcase_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = AutoSuggestionShowcaseResponse()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = ShopException()
                    self.e.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('getAutoSuggestionShowcase_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(getAutoSuggestionShowcase_result)
getAutoSuggestionShowcase_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [AutoSuggestionShowcaseResponse, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [ShopException, None],
        None,
    ),  # 1
)


class getOldSticonMapping_args(object):
    """
    Attributes:
     - req

    """

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

    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 == 2:
                if ftype == TType.STRUCT:
                    self.req = GetOldSticonMappingRequest()
                    self.req.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('getOldSticonMapping_args')
        if self.req is not None:
            oprot.writeFieldBegin('req', TType.STRUCT, 2)
            self.req.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(getOldSticonMapping_args)
getOldSticonMapping_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.STRUCT,
        'req',
        [GetOldSticonMappingRequest, None],
        None,
    ),  # 2
)


class getOldSticonMapping_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = GetOldSticonMappingResponse()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = ShopException()
                    self.e.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('getOldSticonMapping_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(getOldSticonMapping_result)
getOldSticonMapping_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [GetOldSticonMappingResponse, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [ShopException, None],
        None,
    ),  # 1
)


class getOwnedProductSummaries_args(object):
    """
    Attributes:
     - shopId
     - offset
     - limit
     - locale

    """

    def __init__(
        self,
        shopId=None,
        offset=None,
        limit=None,
        locale=None,
    ):
        self.shopId = shopId
        self.offset = offset
        self.limit = limit
        self.locale = locale

    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 == 2:
                if ftype == TType.STRING:
                    self.shopId = (
                        iprot.readString().decode('utf-8')
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.offset = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I32:
                    self.limit = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRUCT:
                    self.locale = Locale()
                    self.locale.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('getOwnedProductSummaries_args')
        if self.shopId is not None:
            oprot.writeFieldBegin('shopId', TType.STRING, 2)
            oprot.writeString(
                self.shopId.encode('utf-8') if sys.version_info[0] == 2 else self.shopId
            )
            oprot.writeFieldEnd()
        if self.offset is not None:
            oprot.writeFieldBegin('offset', TType.I32, 3)
            oprot.writeI32(self.offset)
            oprot.writeFieldEnd()
        if self.limit is not None:
            oprot.writeFieldBegin('limit', TType.I32, 4)
            oprot.writeI32(self.limit)
            oprot.writeFieldEnd()
        if self.locale is not None:
            oprot.writeFieldBegin('locale', TType.STRUCT, 5)
            self.locale.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(getOwnedProductSummaries_args)
getOwnedProductSummaries_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.STRING,
        'shopId',
        'UTF8',
        None,
    ),  # 2
    (
        3,
        TType.I32,
        'offset',
        None,
        None,
    ),  # 3
    (
        4,
        TType.I32,
        'limit',
        None,
        None,
    ),  # 4
    (
        5,
        TType.STRUCT,
        'locale',
        [Locale, None],
        None,
    ),  # 5
)


class getOwnedProductSummaries_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = ProductSummaryList()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = ShopException()
                    self.e.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('getOwnedProductSummaries_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(getOwnedProductSummaries_result)
getOwnedProductSummaries_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [ProductSummaryList, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [ShopException, None],
        None,
    ),  # 1
)


class getOwnedProducts_args(object):
    """
    Attributes:
     - shopId
     - offset
     - limit
     - locale

    """

    def __init__(
        self,
        shopId=None,
        offset=None,
        limit=None,
        locale=None,
    ):
        self.shopId = shopId
        self.offset = offset
        self.limit = limit
        self.locale = locale

    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 == 2:
                if ftype == TType.STRING:
                    self.shopId = (
                        iprot.readString().decode('utf-8')
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.offset = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I32:
                    self.limit = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRUCT:
                    self.locale = Locale()
                    self.locale.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('getOwnedProducts_args')
        if self.shopId is not None:
            oprot.writeFieldBegin('shopId', TType.STRING, 2)
            oprot.writeString(
                self.shopId.encode('utf-8') if sys.version_info[0] == 2 else self.shopId
            )
            oprot.writeFieldEnd()
        if self.offset is not None:
            oprot.writeFieldBegin('offset', TType.I32, 3)
            oprot.writeI32(self.offset)
            oprot.writeFieldEnd()
        if self.limit is not None:
            oprot.writeFieldBegin('limit', TType.I32, 4)
            oprot.writeI32(self.limit)
            oprot.writeFieldEnd()
        if self.locale is not None:
            oprot.writeFieldBegin('locale', TType.STRUCT, 5)
            self.locale.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(getOwnedProducts_args)
getOwnedProducts_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.STRING,
        'shopId',
        'UTF8',
        None,
    ),  # 2
    (
        3,
        TType.I32,
        'offset',
        None,
        None,
    ),  # 3
    (
        4,
        TType.I32,
        'limit',
        None,
        None,
    ),  # 4
    (
        5,
        TType.STRUCT,
        'locale',
        [Locale, None],
        None,
    ),  # 5
)


class getOwnedProducts_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = DetailedProductList()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = ShopException()
                    self.e.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('getOwnedProducts_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(getOwnedProducts_result)
getOwnedProducts_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [DetailedProductList, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [ShopException, None],
        None,
    ),  # 1
)


class getProductByVersion_args(object):
    """
    Attributes:
     - shopId
     - productId
     - productVersion
     - locale

    """

    def __init__(
        self,
        shopId=None,
        productId=None,
        productVersion=None,
        locale=None,
    ):
        self.shopId = shopId
        self.productId = productId
        self.productVersion = productVersion
        self.locale = locale

    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 == 2:
                if ftype == TType.STRING:
                    self.shopId = (
                        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.productId = (
                        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.productVersion = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRUCT:
                    self.locale = Locale()
                    self.locale.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('getProductByVersion_args')
        if self.shopId is not None:
            oprot.writeFieldBegin('shopId', TType.STRING, 2)
            oprot.writeString(
                self.shopId.encode('utf-8') if sys.version_info[0] == 2 else self.shopId
            )
            oprot.writeFieldEnd()
        if self.productId is not None:
            oprot.writeFieldBegin('productId', TType.STRING, 3)
            oprot.writeString(
                self.productId.encode('utf-8')
                if sys.version_info[0] == 2
                else self.productId
            )
            oprot.writeFieldEnd()
        if self.productVersion is not None:
            oprot.writeFieldBegin('productVersion', TType.I64, 4)
            oprot.writeI64(self.productVersion)
            oprot.writeFieldEnd()
        if self.locale is not None:
            oprot.writeFieldBegin('locale', TType.STRUCT, 5)
            self.locale.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(getProductByVersion_args)
getProductByVersion_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.STRING,
        'shopId',
        'UTF8',
        None,
    ),  # 2
    (
        3,
        TType.STRING,
        'productId',
        'UTF8',
        None,
    ),  # 3
    (
        4,
        TType.I64,
        'productVersion',
        None,
        None,
    ),  # 4
    (
        5,
        TType.STRUCT,
        'locale',
        [Locale, None],
        None,
    ),  # 5
)


class getProductByVersion_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = ProductDetail()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = ShopException()
                    self.e.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('getProductByVersion_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(getProductByVersion_result)
getProductByVersion_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [ProductDetail, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [ShopException, None],
        None,
    ),  # 1
)


class getProductV2_args(object):
    """
    Attributes:
     - request

    """

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

    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 == 2:
                if ftype == TType.STRUCT:
                    self.request = GetProductRequest()
                    self.request.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('getProductV2_args')
        if self.request is not None:
            oprot.writeFieldBegin('request', TType.STRUCT, 2)
            self.request.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(getProductV2_args)
getProductV2_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.STRUCT,
        'request',
        [GetProductRequest, None],
        None,
    ),  # 2
)


class getProductV2_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = GetProductResponse()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = ShopException()
                    self.e.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('getProductV2_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(getProductV2_result)
getProductV2_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [GetProductResponse, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [ShopException, None],
        None,
    ),  # 1
)


class getProductValidationScheme_args(object):
    """
    Attributes:
     - shopId
     - productId
     - productVersion

    """

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

    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 == 2:
                if ftype == TType.STRING:
                    self.shopId = (
                        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.productId = (
                        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.productVersion = 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('getProductValidationScheme_args')
        if self.shopId is not None:
            oprot.writeFieldBegin('shopId', TType.STRING, 2)
            oprot.writeString(
                self.shopId.encode('utf-8') if sys.version_info[0] == 2 else self.shopId
            )
            oprot.writeFieldEnd()
        if self.productId is not None:
            oprot.writeFieldBegin('productId', TType.STRING, 3)
            oprot.writeString(
                self.productId.encode('utf-8')
                if sys.version_info[0] == 2
                else self.productId
            )
            oprot.writeFieldEnd()
        if self.productVersion is not None:
            oprot.writeFieldBegin('productVersion', TType.I64, 4)
            oprot.writeI64(self.productVersion)
            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(getProductValidationScheme_args)
getProductValidationScheme_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.STRING,
        'shopId',
        'UTF8',
        None,
    ),  # 2
    (
        3,
        TType.STRING,
        'productId',
        'UTF8',
        None,
    ),  # 3
    (
        4,
        TType.I64,
        'productVersion',
        None,
        None,
    ),  # 4
)


class getProductValidationScheme_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = ProductValidationScheme()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = ShopException()
                    self.e.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('getProductValidationScheme_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(getProductValidationScheme_result)
getProductValidationScheme_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [ProductValidationScheme, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [ShopException, None],
        None,
    ),  # 1
)


class getProduct_args(object):
    """
    Attributes:
     - shopId
     - productId
     - locale

    """

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

    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 == 2:
                if ftype == TType.STRING:
                    self.shopId = (
                        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.productId = (
                        iprot.readString().decode('utf-8')
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRUCT:
                    self.locale = Locale()
                    self.locale.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('getProduct_args')
        if self.shopId is not None:
            oprot.writeFieldBegin('shopId', TType.STRING, 2)
            oprot.writeString(
                self.shopId.encode('utf-8') if sys.version_info[0] == 2 else self.shopId
            )
            oprot.writeFieldEnd()
        if self.productId is not None:
            oprot.writeFieldBegin('productId', TType.STRING, 3)
            oprot.writeString(
                self.productId.encode('utf-8')
                if sys.version_info[0] == 2
                else self.productId
            )
            oprot.writeFieldEnd()
        if self.locale is not None:
            oprot.writeFieldBegin('locale', TType.STRUCT, 4)
            self.locale.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(getProduct_args)
getProduct_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.STRING,
        'shopId',
        'UTF8',
        None,
    ),  # 2
    (
        3,
        TType.STRING,
        'productId',
        'UTF8',
        None,
    ),  # 3
    (
        4,
        TType.STRUCT,
        'locale',
        [Locale, None],
        None,
    ),  # 4
)


class getProduct_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = ProductDetail()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = ShopException()
                    self.e.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('getProduct_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(getProduct_result)
getProduct_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [ProductDetail, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [ShopException, None],
        None,
    ),  # 1
)


class getProductsByAuthor_args(object):
    """
    Attributes:
     - productListByAuthorRequest

    """

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

    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 == 2:
                if ftype == TType.STRUCT:
                    self.productListByAuthorRequest = ProductListByAuthorRequest()
                    self.productListByAuthorRequest.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('getProductsByAuthor_args')
        if self.productListByAuthorRequest is not None:
            oprot.writeFieldBegin('productListByAuthorRequest', TType.STRUCT, 2)
            self.productListByAuthorRequest.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(getProductsByAuthor_args)
getProductsByAuthor_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.STRUCT,
        'productListByAuthorRequest',
        [ProductListByAuthorRequest, None],
        None,
    ),  # 2
)


class getProductsByAuthor_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = ProductList()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = ShopException()
                    self.e.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('getProductsByAuthor_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(getProductsByAuthor_result)
getProductsByAuthor_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [ProductList, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [ShopException, None],
        None,
    ),  # 1
)


class getPurchasedProducts_args(object):
    """
    Attributes:
     - shopId
     - offset
     - limit
     - locale

    """

    def __init__(
        self,
        shopId=None,
        offset=None,
        limit=None,
        locale=None,
    ):
        self.shopId = shopId
        self.offset = offset
        self.limit = limit
        self.locale = locale

    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 == 2:
                if ftype == TType.STRING:
                    self.shopId = (
                        iprot.readString().decode('utf-8')
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.offset = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I32:
                    self.limit = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRUCT:
                    self.locale = Locale()
                    self.locale.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('getPurchasedProducts_args')
        if self.shopId is not None:
            oprot.writeFieldBegin('shopId', TType.STRING, 2)
            oprot.writeString(
                self.shopId.encode('utf-8') if sys.version_info[0] == 2 else self.shopId
            )
            oprot.writeFieldEnd()
        if self.offset is not None:
            oprot.writeFieldBegin('offset', TType.I32, 3)
            oprot.writeI32(self.offset)
            oprot.writeFieldEnd()
        if self.limit is not None:
            oprot.writeFieldBegin('limit', TType.I32, 4)
            oprot.writeI32(self.limit)
            oprot.writeFieldEnd()
        if self.locale is not None:
            oprot.writeFieldBegin('locale', TType.STRUCT, 5)
            self.locale.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(getPurchasedProducts_args)
getPurchasedProducts_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.STRING,
        'shopId',
        'UTF8',
        None,
    ),  # 2
    (
        3,
        TType.I32,
        'offset',
        None,
        None,
    ),  # 3
    (
        4,
        TType.I32,
        'limit',
        None,
        None,
    ),  # 4
    (
        5,
        TType.STRUCT,
        'locale',
        [Locale, None],
        None,
    ),  # 5
)


class getPurchasedProducts_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = PurchaseRecordList()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = ShopException()
                    self.e.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('getPurchasedProducts_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(getPurchasedProducts_result)
getPurchasedProducts_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [PurchaseRecordList, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [ShopException, None],
        None,
    ),  # 1
)


class getReceivedPresents_args(object):
    """
    Attributes:
     - shopId
     - offset
     - limit
     - locale

    """

    def __init__(
        self,
        shopId=None,
        offset=None,
        limit=None,
        locale=None,
    ):
        self.shopId = shopId
        self.offset = offset
        self.limit = limit
        self.locale = locale

    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 == 2:
                if ftype == TType.STRING:
                    self.shopId = (
                        iprot.readString().decode('utf-8')
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.offset = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I32:
                    self.limit = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRUCT:
                    self.locale = Locale()
                    self.locale.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('getReceivedPresents_args')
        if self.shopId is not None:
            oprot.writeFieldBegin('shopId', TType.STRING, 2)
            oprot.writeString(
                self.shopId.encode('utf-8') if sys.version_info[0] == 2 else self.shopId
            )
            oprot.writeFieldEnd()
        if self.offset is not None:
            oprot.writeFieldBegin('offset', TType.I32, 3)
            oprot.writeI32(self.offset)
            oprot.writeFieldEnd()
        if self.limit is not None:
            oprot.writeFieldBegin('limit', TType.I32, 4)
            oprot.writeI32(self.limit)
            oprot.writeFieldEnd()
        if self.locale is not None:
            oprot.writeFieldBegin('locale', TType.STRUCT, 5)
            self.locale.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(getReceivedPresents_args)
getReceivedPresents_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.STRING,
        'shopId',
        'UTF8',
        None,
    ),  # 2
    (
        3,
        TType.I32,
        'offset',
        None,
        None,
    ),  # 3
    (
        4,
        TType.I32,
        'limit',
        None,
        None,
    ),  # 4
    (
        5,
        TType.STRUCT,
        'locale',
        [Locale, None],
        None,
    ),  # 5
)


class getReceivedPresents_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = PurchaseRecordList()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = ShopException()
                    self.e.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('getReceivedPresents_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(getReceivedPresents_result)
getReceivedPresents_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [PurchaseRecordList, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [ShopException, None],
        None,
    ),  # 1
)


class getRecommendOa_args(object):
    """
    Attributes:
     - req

    """

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

    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 == 2:
                if ftype == TType.STRUCT:
                    self.req = GetRecommendOaRequest()
                    self.req.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('getRecommendOa_args')
        if self.req is not None:
            oprot.writeFieldBegin('req', TType.STRUCT, 2)
            self.req.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(getRecommendOa_args)
getRecommendOa_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.STRUCT,
        'req',
        [GetRecommendOaRequest, None],
        None,
    ),  # 2
)


class getRecommendOa_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = GetRecommendOaResponse()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = ShopException()
                    self.e.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('getRecommendOa_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(getRecommendOa_result)
getRecommendOa_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [GetRecommendOaResponse, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [ShopException, None],
        None,
    ),  # 1
)


class getRecommendationForUser_args(object):
    """
    Attributes:
     - shopId
     - offset
     - limit
     - locale

    """

    def __init__(
        self,
        shopId=None,
        offset=None,
        limit=None,
        locale=None,
    ):
        self.shopId = shopId
        self.offset = offset
        self.limit = limit
        self.locale = locale

    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 == 2:
                if ftype == TType.STRING:
                    self.shopId = (
                        iprot.readString().decode('utf-8')
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.offset = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I32:
                    self.limit = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRUCT:
                    self.locale = Locale()
                    self.locale.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('getRecommendationForUser_args')
        if self.shopId is not None:
            oprot.writeFieldBegin('shopId', TType.STRING, 2)
            oprot.writeString(
                self.shopId.encode('utf-8') if sys.version_info[0] == 2 else self.shopId
            )
            oprot.writeFieldEnd()
        if self.offset is not None:
            oprot.writeFieldBegin('offset', TType.I32, 3)
            oprot.writeI32(self.offset)
            oprot.writeFieldEnd()
        if self.limit is not None:
            oprot.writeFieldBegin('limit', TType.I32, 4)
            oprot.writeI32(self.limit)
            oprot.writeFieldEnd()
        if self.locale is not None:
            oprot.writeFieldBegin('locale', TType.STRUCT, 5)
            self.locale.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(getRecommendationForUser_args)
getRecommendationForUser_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.STRING,
        'shopId',
        'UTF8',
        None,
    ),  # 2
    (
        3,
        TType.I32,
        'offset',
        None,
        None,
    ),  # 3
    (
        4,
        TType.I32,
        'limit',
        None,
        None,
    ),  # 4
    (
        5,
        TType.STRUCT,
        'locale',
        [Locale, None],
        None,
    ),  # 5
)


class getRecommendationForUser_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = ProductList()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = ShopException()
                    self.e.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('getRecommendationForUser_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(getRecommendationForUser_result)
getRecommendationForUser_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [ProductList, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [ShopException, None],
        None,
    ),  # 1
)


class getRecommendationList_args(object):
    """
    Attributes:
     - getRecommendationRequest

    """

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

    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 == 2:
                if ftype == TType.STRUCT:
                    self.getRecommendationRequest = GetRecommendationRequest()
                    self.getRecommendationRequest.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('getRecommendationList_args')
        if self.getRecommendationRequest is not None:
            oprot.writeFieldBegin('getRecommendationRequest', TType.STRUCT, 2)
            self.getRecommendationRequest.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(getRecommendationList_args)
getRecommendationList_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.STRUCT,
        'getRecommendationRequest',
        [GetRecommendationRequest, None],
        None,
    ),  # 2
)


class getRecommendationList_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = GetRecommendationResponse()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = ShopException()
                    self.e.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('getRecommendationList_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(getRecommendationList_result)
getRecommendationList_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [GetRecommendationResponse, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [ShopException, None],
        None,
    ),  # 1
)


class getSentPresents_args(object):
    """
    Attributes:
     - shopId
     - offset
     - limit
     - locale

    """

    def __init__(
        self,
        shopId=None,
        offset=None,
        limit=None,
        locale=None,
    ):
        self.shopId = shopId
        self.offset = offset
        self.limit = limit
        self.locale = locale

    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 == 2:
                if ftype == TType.STRING:
                    self.shopId = (
                        iprot.readString().decode('utf-8')
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.offset = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I32:
                    self.limit = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRUCT:
                    self.locale = Locale()
                    self.locale.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('getSentPresents_args')
        if self.shopId is not None:
            oprot.writeFieldBegin('shopId', TType.STRING, 2)
            oprot.writeString(
                self.shopId.encode('utf-8') if sys.version_info[0] == 2 else self.shopId
            )
            oprot.writeFieldEnd()
        if self.offset is not None:
            oprot.writeFieldBegin('offset', TType.I32, 3)
            oprot.writeI32(self.offset)
            oprot.writeFieldEnd()
        if self.limit is not None:
            oprot.writeFieldBegin('limit', TType.I32, 4)
            oprot.writeI32(self.limit)
            oprot.writeFieldEnd()
        if self.locale is not None:
            oprot.writeFieldBegin('locale', TType.STRUCT, 5)
            self.locale.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(getSentPresents_args)
getSentPresents_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.STRING,
        'shopId',
        'UTF8',
        None,
    ),  # 2
    (
        3,
        TType.I32,
        'offset',
        None,
        None,
    ),  # 3
    (
        4,
        TType.I32,
        'limit',
        None,
        None,
    ),  # 4
    (
        5,
        TType.STRUCT,
        'locale',
        [Locale, None],
        None,
    ),  # 5
)


class getSentPresents_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = PurchaseRecordList()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = ShopException()
                    self.e.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('getSentPresents_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(getSentPresents_result)
getSentPresents_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [PurchaseRecordList, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [ShopException, None],
        None,
    ),  # 1
)


class getShowcaseV3_args(object):
    """
    Attributes:
     - showcaseRequest

    """

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

    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.showcaseRequest = ShowcaseRequest()
                    self.showcaseRequest.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('getShowcaseV3_args')
        if self.showcaseRequest is not None:
            oprot.writeFieldBegin('showcaseRequest', TType.STRUCT, 1)
            self.showcaseRequest.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(getShowcaseV3_args)
getShowcaseV3_args.thrift_spec = (
    None,  # 0
    (
        1,
        TType.STRUCT,
        'showcaseRequest',
        [ShowcaseRequest, None],
        None,
    ),  # 1
)


class getShowcaseV3_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = ShowcaseV3()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = ShopException()
                    self.e.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('getShowcaseV3_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(getShowcaseV3_result)
getShowcaseV3_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [ShowcaseV3, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [ShopException, None],
        None,
    ),  # 1
)


class getSuggestDictionarySetting_args(object):
    """
    Attributes:
     - req

    """

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

    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 == 2:
                if ftype == TType.STRUCT:
                    self.req = GetSuggestDictionarySettingRequest()
                    self.req.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('getSuggestDictionarySetting_args')
        if self.req is not None:
            oprot.writeFieldBegin('req', TType.STRUCT, 2)
            self.req.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(getSuggestDictionarySetting_args)
getSuggestDictionarySetting_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.STRUCT,
        'req',
        [GetSuggestDictionarySettingRequest, None],
        None,
    ),  # 2
)


class getSuggestDictionarySetting_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = GetSuggestDictionarySettingResponse()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = ShopException()
                    self.e.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('getSuggestDictionarySetting_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(getSuggestDictionarySetting_result)
getSuggestDictionarySetting_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [GetSuggestDictionarySettingResponse, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [ShopException, None],
        None,
    ),  # 1
)


class getSuggestResourcesV2_args(object):
    """
    Attributes:
     - req

    """

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

    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 == 2:
                if ftype == TType.STRUCT:
                    self.req = GetSuggestResourcesV2Request()
                    self.req.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('getSuggestResourcesV2_args')
        if self.req is not None:
            oprot.writeFieldBegin('req', TType.STRUCT, 2)
            self.req.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(getSuggestResourcesV2_args)
getSuggestResourcesV2_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.STRUCT,
        'req',
        [GetSuggestResourcesV2Request, None],
        None,
    ),  # 2
)


class getSuggestResourcesV2_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = GetSuggestResourcesV2Response()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = ShopException()
                    self.e.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('getSuggestResourcesV2_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(getSuggestResourcesV2_result)
getSuggestResourcesV2_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [GetSuggestResourcesV2Response, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [ShopException, None],
        None,
    ),  # 1
)


class getUpdates_args(object):
    """
    Attributes:
     - shopId
     - locale

    """

    def __init__(
        self,
        shopId=None,
        locale=None,
    ):
        self.shopId = shopId
        self.locale = locale

    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 == 2:
                if ftype == TType.STRING:
                    self.shopId = (
                        iprot.readString().decode('utf-8')
                        if sys.version_info[0] == 2
                        else iprot.readString()
                    )
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRUCT:
                    self.locale = Locale()
                    self.locale.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('getUpdates_args')
        if self.shopId is not None:
            oprot.writeFieldBegin('shopId', TType.STRING, 2)
            oprot.writeString(
                self.shopId.encode('utf-8') if sys.version_info[0] == 2 else self.shopId
            )
            oprot.writeFieldEnd()
        if self.locale is not None:
            oprot.writeFieldBegin('locale', TType.STRUCT, 3)
            self.locale.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(getUpdates_args)
getUpdates_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.STRING,
        'shopId',
        'UTF8',
        None,
    ),  # 2
    (
        3,
        TType.STRUCT,
        'locale',
        [Locale, None],
        None,
    ),  # 3
)


class getUpdates_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = ShopUpdates()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = ShopException()
                    self.e.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('getUpdates_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(getUpdates_result)
getUpdates_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [ShopUpdates, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [ShopException, None],
        None,
    ),  # 1
)


class notifyProductEvent_args(object):
    """
    Attributes:
     - shopId
     - productId
     - productVersion
     - productEvent

    """

    def __init__(
        self,
        shopId=None,
        productId=None,
        productVersion=None,
        productEvent=None,
    ):
        self.shopId = shopId
        self.productId = productId
        self.productVersion = productVersion
        self.productEvent = productEvent

    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 == 2:
                if ftype == TType.STRING:
                    self.shopId = (
                        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.productId = (
                        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.productVersion = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.I64:
                    self.productEvent = 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('notifyProductEvent_args')
        if self.shopId is not None:
            oprot.writeFieldBegin('shopId', TType.STRING, 2)
            oprot.writeString(
                self.shopId.encode('utf-8') if sys.version_info[0] == 2 else self.shopId
            )
            oprot.writeFieldEnd()
        if self.productId is not None:
            oprot.writeFieldBegin('productId', TType.STRING, 3)
            oprot.writeString(
                self.productId.encode('utf-8')
                if sys.version_info[0] == 2
                else self.productId
            )
            oprot.writeFieldEnd()
        if self.productVersion is not None:
            oprot.writeFieldBegin('productVersion', TType.I64, 4)
            oprot.writeI64(self.productVersion)
            oprot.writeFieldEnd()
        if self.productEvent is not None:
            oprot.writeFieldBegin('productEvent', TType.I64, 5)
            oprot.writeI64(self.productEvent)
            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(notifyProductEvent_args)
notifyProductEvent_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.STRING,
        'shopId',
        'UTF8',
        None,
    ),  # 2
    (
        3,
        TType.STRING,
        'productId',
        'UTF8',
        None,
    ),  # 3
    (
        4,
        TType.I64,
        'productVersion',
        None,
        None,
    ),  # 4
    (
        5,
        TType.I64,
        'productEvent',
        None,
        None,
    ),  # 5
)


class notifyProductEvent_result(object):
    """
    Attributes:
     - e

    """

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

    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.e = ShopException()
                    self.e.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('notifyProductEvent_result')
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(notifyProductEvent_result)
notifyProductEvent_result.thrift_spec = (
    None,  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [ShopException, None],
        None,
    ),  # 1
)


class placePurchaseOrderForFreeProduct_args(object):
    """
    Attributes:
     - purchaseOrder

    """

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

    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 == 2:
                if ftype == TType.STRUCT:
                    self.purchaseOrder = PurchaseOrder()
                    self.purchaseOrder.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('placePurchaseOrderForFreeProduct_args')
        if self.purchaseOrder is not None:
            oprot.writeFieldBegin('purchaseOrder', TType.STRUCT, 2)
            self.purchaseOrder.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(placePurchaseOrderForFreeProduct_args)
placePurchaseOrderForFreeProduct_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.STRUCT,
        'purchaseOrder',
        [PurchaseOrder, None],
        None,
    ),  # 2
)


class placePurchaseOrderForFreeProduct_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = PurchaseOrderResponse()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = ShopException()
                    self.e.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('placePurchaseOrderForFreeProduct_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(placePurchaseOrderForFreeProduct_result)
placePurchaseOrderForFreeProduct_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [PurchaseOrderResponse, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [ShopException, None],
        None,
    ),  # 1
)


class placePurchaseOrderWithLineCoin_args(object):
    """
    Attributes:
     - purchaseOrder

    """

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

    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 == 2:
                if ftype == TType.STRUCT:
                    self.purchaseOrder = PurchaseOrder()
                    self.purchaseOrder.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('placePurchaseOrderWithLineCoin_args')
        if self.purchaseOrder is not None:
            oprot.writeFieldBegin('purchaseOrder', TType.STRUCT, 2)
            self.purchaseOrder.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(placePurchaseOrderWithLineCoin_args)
placePurchaseOrderWithLineCoin_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.STRUCT,
        'purchaseOrder',
        [PurchaseOrder, None],
        None,
    ),  # 2
)


class placePurchaseOrderWithLineCoin_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = PurchaseOrderResponse()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = ShopException()
                    self.e.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('placePurchaseOrderWithLineCoin_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(placePurchaseOrderWithLineCoin_result)
placePurchaseOrderWithLineCoin_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [PurchaseOrderResponse, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [ShopException, None],
        None,
    ),  # 1
)


class validateProduct_args(object):
    """
    Attributes:
     - shopId
     - productId
     - productVersion
     - validationReq

    """

    def __init__(
        self,
        shopId=None,
        productId=None,
        productVersion=None,
        validationReq=None,
    ):
        self.shopId = shopId
        self.productId = productId
        self.productVersion = productVersion
        self.validationReq = validationReq

    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 == 2:
                if ftype == TType.STRING:
                    self.shopId = (
                        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.productId = (
                        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.productVersion = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRUCT:
                    self.validationReq = ProductValidationRequest()
                    self.validationReq.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('validateProduct_args')
        if self.shopId is not None:
            oprot.writeFieldBegin('shopId', TType.STRING, 2)
            oprot.writeString(
                self.shopId.encode('utf-8') if sys.version_info[0] == 2 else self.shopId
            )
            oprot.writeFieldEnd()
        if self.productId is not None:
            oprot.writeFieldBegin('productId', TType.STRING, 3)
            oprot.writeString(
                self.productId.encode('utf-8')
                if sys.version_info[0] == 2
                else self.productId
            )
            oprot.writeFieldEnd()
        if self.productVersion is not None:
            oprot.writeFieldBegin('productVersion', TType.I64, 4)
            oprot.writeI64(self.productVersion)
            oprot.writeFieldEnd()
        if self.validationReq is not None:
            oprot.writeFieldBegin('validationReq', TType.STRUCT, 5)
            self.validationReq.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(validateProduct_args)
validateProduct_args.thrift_spec = (
    None,  # 0
    None,  # 1
    (
        2,
        TType.STRING,
        'shopId',
        'UTF8',
        None,
    ),  # 2
    (
        3,
        TType.STRING,
        'productId',
        'UTF8',
        None,
    ),  # 3
    (
        4,
        TType.I64,
        'productVersion',
        None,
        None,
    ),  # 4
    (
        5,
        TType.STRUCT,
        'validationReq',
        [ProductValidationRequest, None],
        None,
    ),  # 5
)


class validateProduct_result(object):
    """
    Attributes:
     - success
     - e

    """

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

    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 = ProductValidationResult()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 1:
                if ftype == TType.STRUCT:
                    self.e = ShopException()
                    self.e.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('validateProduct_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        if self.e is not None:
            oprot.writeFieldBegin('e', TType.STRUCT, 1)
            self.e.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(validateProduct_result)
validateProduct_result.thrift_spec = (
    (
        0,
        TType.STRUCT,
        'success',
        [ProductValidationResult, None],
        None,
    ),  # 0
    (
        1,
        TType.STRUCT,
        'e',
        [ShopException, None],
        None,
    ),  # 1
)
fix_spec(all_structs)
del all_structs
