ttypes.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:wpw-sdk-python 作者: WPTechInnovation 项目源码 文件源码
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('PaymentResponse')
        if self.serverId is not None:
            oprot.writeFieldBegin('serverId', TType.STRING, 1)
            oprot.writeString(self.serverId.encode('utf-8') if sys.version_info[0] == 2 else self.serverId)
            oprot.writeFieldEnd()
        if self.clientId is not None:
            oprot.writeFieldBegin('clientId', TType.STRING, 2)
            oprot.writeString(self.clientId.encode('utf-8') if sys.version_info[0] == 2 else self.clientId)
            oprot.writeFieldEnd()
        if self.totalPaid is not None:
            oprot.writeFieldBegin('totalPaid', TType.I32, 3)
            oprot.writeI32(self.totalPaid)
            oprot.writeFieldEnd()
        if self.serviceDeliveryToken is not None:
            oprot.writeFieldBegin('serviceDeliveryToken', TType.STRUCT, 4)
            self.serviceDeliveryToken.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号