# -*- coding: utf-8 -*-
# This file is auto-generated, don't edit it. Thanks.
from Tea.model import TeaModel
from typing import List, BinaryIO


class Config(TeaModel):
    """
    Model for initing client
    """
    def __init__(
        self,
        access_key_id: str = None,
        access_key_secret: str = None,
        security_token: str = None,
        protocol: str = None,
        read_timeout: int = None,
        connect_timeout: int = None,
        http_proxy: str = None,
        https_proxy: str = None,
        endpoint: str = None,
        no_proxy: str = None,
        max_idle_conns: int = None,
        user_agent: str = None,
        socks_5proxy: str = None,
        socks_5net_work: str = None,
        max_idle_time_millis: int = None,
        keep_alive_duration_millis: int = None,
        max_requests: int = None,
        max_requests_per_host: int = None,
    ):
        # accesskey id
        self.access_key_id = access_key_id
        # accesskey secret
        self.access_key_secret = access_key_secret
        # security token
        self.security_token = security_token
        # http protocol
        self.protocol = protocol
        # read timeout
        self.read_timeout = read_timeout
        # connect timeout
        self.connect_timeout = connect_timeout
        # http proxy
        self.http_proxy = http_proxy
        # https proxy
        self.https_proxy = https_proxy
        # endpoint
        self.endpoint = endpoint
        # proxy white list
        self.no_proxy = no_proxy
        # max idle conns
        self.max_idle_conns = max_idle_conns
        # user agent
        self.user_agent = user_agent
        # socks5 proxy
        self.socks_5proxy = socks_5proxy
        # socks5 network
        self.socks_5net_work = socks_5net_work
        # 长链接最大空闲时长
        self.max_idle_time_millis = max_idle_time_millis
        # 长链接最大连接时长
        self.keep_alive_duration_millis = keep_alive_duration_millis
        # 最大连接数（长链接最大总数）
        self.max_requests = max_requests
        # 每个目标主机的最大连接数（分主机域名的长链接最大总数
        self.max_requests_per_host = max_requests_per_host

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.access_key_id is not None:
            result['accessKeyId'] = self.access_key_id
        if self.access_key_secret is not None:
            result['accessKeySecret'] = self.access_key_secret
        if self.security_token is not None:
            result['securityToken'] = self.security_token
        if self.protocol is not None:
            result['protocol'] = self.protocol
        if self.read_timeout is not None:
            result['readTimeout'] = self.read_timeout
        if self.connect_timeout is not None:
            result['connectTimeout'] = self.connect_timeout
        if self.http_proxy is not None:
            result['httpProxy'] = self.http_proxy
        if self.https_proxy is not None:
            result['httpsProxy'] = self.https_proxy
        if self.endpoint is not None:
            result['endpoint'] = self.endpoint
        if self.no_proxy is not None:
            result['noProxy'] = self.no_proxy
        if self.max_idle_conns is not None:
            result['maxIdleConns'] = self.max_idle_conns
        if self.user_agent is not None:
            result['userAgent'] = self.user_agent
        if self.socks_5proxy is not None:
            result['socks5Proxy'] = self.socks_5proxy
        if self.socks_5net_work is not None:
            result['socks5NetWork'] = self.socks_5net_work
        if self.max_idle_time_millis is not None:
            result['maxIdleTimeMillis'] = self.max_idle_time_millis
        if self.keep_alive_duration_millis is not None:
            result['keepAliveDurationMillis'] = self.keep_alive_duration_millis
        if self.max_requests is not None:
            result['maxRequests'] = self.max_requests
        if self.max_requests_per_host is not None:
            result['maxRequestsPerHost'] = self.max_requests_per_host
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('accessKeyId') is not None:
            self.access_key_id = m.get('accessKeyId')
        if m.get('accessKeySecret') is not None:
            self.access_key_secret = m.get('accessKeySecret')
        if m.get('securityToken') is not None:
            self.security_token = m.get('securityToken')
        if m.get('protocol') is not None:
            self.protocol = m.get('protocol')
        if m.get('readTimeout') is not None:
            self.read_timeout = m.get('readTimeout')
        if m.get('connectTimeout') is not None:
            self.connect_timeout = m.get('connectTimeout')
        if m.get('httpProxy') is not None:
            self.http_proxy = m.get('httpProxy')
        if m.get('httpsProxy') is not None:
            self.https_proxy = m.get('httpsProxy')
        if m.get('endpoint') is not None:
            self.endpoint = m.get('endpoint')
        if m.get('noProxy') is not None:
            self.no_proxy = m.get('noProxy')
        if m.get('maxIdleConns') is not None:
            self.max_idle_conns = m.get('maxIdleConns')
        if m.get('userAgent') is not None:
            self.user_agent = m.get('userAgent')
        if m.get('socks5Proxy') is not None:
            self.socks_5proxy = m.get('socks5Proxy')
        if m.get('socks5NetWork') is not None:
            self.socks_5net_work = m.get('socks5NetWork')
        if m.get('maxIdleTimeMillis') is not None:
            self.max_idle_time_millis = m.get('maxIdleTimeMillis')
        if m.get('keepAliveDurationMillis') is not None:
            self.keep_alive_duration_millis = m.get('keepAliveDurationMillis')
        if m.get('maxRequests') is not None:
            self.max_requests = m.get('maxRequests')
        if m.get('maxRequestsPerHost') is not None:
            self.max_requests_per_host = m.get('maxRequestsPerHost')
        return self


class LogEntry(TeaModel):
    def __init__(
        self,
        from_: str = None,
        log_data: str = None,
        to: str = None,
        topics: List[str] = None,
    ):
        # 交易发起方
        self.from_ = from_
        # log信息
        self.log_data = log_data
        # 交易接受方
        self.to = to
        # 交易topic
        self.topics = topics

    def validate(self):
        self.validate_required(self.from_, 'from_')
        self.validate_required(self.log_data, 'log_data')
        self.validate_required(self.to, 'to')
        self.validate_required(self.topics, 'topics')

    def to_map(self):
        result = dict()
        if self.from_ is not None:
            result['from'] = self.from_
        if self.log_data is not None:
            result['log_data'] = self.log_data
        if self.to is not None:
            result['to'] = self.to
        if self.topics is not None:
            result['topics'] = self.topics
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('from') is not None:
            self.from_ = m.get('from')
        if m.get('log_data') is not None:
            self.log_data = m.get('log_data')
        if m.get('to') is not None:
            self.to = m.get('to')
        if m.get('topics') is not None:
            self.topics = m.get('topics')
        return self


class Extension(TeaModel):
    def __init__(
        self,
        key: int = None,
        value: str = None,
    ):
        # key
        self.key = key
        # value
        self.value = value

    def validate(self):
        self.validate_required(self.key, 'key')
        self.validate_required(self.value, 'value')

    def to_map(self):
        result = dict()
        if self.key is not None:
            result['key'] = self.key
        if self.value is not None:
            result['value'] = self.value
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('key') is not None:
            self.key = m.get('key')
        if m.get('value') is not None:
            self.value = m.get('value')
        return self


class UserPrice(TeaModel):
    def __init__(
        self,
        price: str = None,
        ratio: str = None,
        snapshot_tenant_price: str = None,
        user_price_type: int = None,
        user_price_with_commission: str = None,
    ):
        # 具体价格
        self.price = price
        # 相对比例
        self.ratio = ratio
        # 对租户价格(需要和当前生效价格匹配)
        self.snapshot_tenant_price = snapshot_tenant_price
        # 价格类型(数值/比例)
        self.user_price_type = user_price_type
        # 租户用户价格包括费率
        self.user_price_with_commission = user_price_with_commission

    def validate(self):
        self.validate_required(self.price, 'price')
        self.validate_required(self.ratio, 'ratio')
        self.validate_required(self.snapshot_tenant_price, 'snapshot_tenant_price')
        self.validate_required(self.user_price_type, 'user_price_type')
        self.validate_required(self.user_price_with_commission, 'user_price_with_commission')

    def to_map(self):
        result = dict()
        if self.price is not None:
            result['price'] = self.price
        if self.ratio is not None:
            result['ratio'] = self.ratio
        if self.snapshot_tenant_price is not None:
            result['snapshot_tenant_price'] = self.snapshot_tenant_price
        if self.user_price_type is not None:
            result['user_price_type'] = self.user_price_type
        if self.user_price_with_commission is not None:
            result['user_price_with_commission'] = self.user_price_with_commission
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('price') is not None:
            self.price = m.get('price')
        if m.get('ratio') is not None:
            self.ratio = m.get('ratio')
        if m.get('snapshot_tenant_price') is not None:
            self.snapshot_tenant_price = m.get('snapshot_tenant_price')
        if m.get('user_price_type') is not None:
            self.user_price_type = m.get('user_price_type')
        if m.get('user_price_with_commission') is not None:
            self.user_price_with_commission = m.get('user_price_with_commission')
        return self


class BlockTransaction(TeaModel):
    def __init__(
        self,
        data: str = None,
        extension: List[Extension] = None,
        from_: str = None,
        gas: int = None,
        group_id: str = None,
        hash: str = None,
        nonce: str = None,
        period: int = None,
        signature: List[str] = None,
        timestamp: int = None,
        to: str = None,
        type: int = None,
        value: int = None,
        version: int = None,
    ):
        # 交易信息
        self.data = data
        # 交易扩展信息
        self.extension = extension
        # 交易发起方
        self.from_ = from_
        # 交易gas消耗
        self.gas = gas
        # 分组id，暂时没用
        self.group_id = group_id
        # 交易哈希
        self.hash = hash
        # 交易随机数
        self.nonce = nonce
        # 交易时间
        self.period = period
        # 交易签名
        self.signature = signature
        # 交易时间戳
        self.timestamp = timestamp
        # 交易接收方
        self.to = to
        # 2
        self.type = type
        # 交易转账金额
        self.value = value
        # 2
        self.version = version

    def validate(self):
        self.validate_required(self.data, 'data')
        self.validate_required(self.extension, 'extension')
        if self.extension:
            for k in self.extension:
                if k:
                    k.validate()
        self.validate_required(self.from_, 'from_')
        self.validate_required(self.gas, 'gas')
        self.validate_required(self.group_id, 'group_id')
        self.validate_required(self.hash, 'hash')
        self.validate_required(self.nonce, 'nonce')
        self.validate_required(self.period, 'period')
        self.validate_required(self.signature, 'signature')
        self.validate_required(self.timestamp, 'timestamp')
        self.validate_required(self.to, 'to')
        self.validate_required(self.type, 'type')
        self.validate_required(self.value, 'value')
        self.validate_required(self.version, 'version')

    def to_map(self):
        result = dict()
        if self.data is not None:
            result['data'] = self.data
        result['extension'] = []
        if self.extension is not None:
            for k in self.extension:
                result['extension'].append(k.to_map() if k else None)
        if self.from_ is not None:
            result['from'] = self.from_
        if self.gas is not None:
            result['gas'] = self.gas
        if self.group_id is not None:
            result['group_id'] = self.group_id
        if self.hash is not None:
            result['hash'] = self.hash
        if self.nonce is not None:
            result['nonce'] = self.nonce
        if self.period is not None:
            result['period'] = self.period
        if self.signature is not None:
            result['signature'] = self.signature
        if self.timestamp is not None:
            result['timestamp'] = self.timestamp
        if self.to is not None:
            result['to'] = self.to
        if self.type is not None:
            result['type'] = self.type
        if self.value is not None:
            result['value'] = self.value
        if self.version is not None:
            result['version'] = self.version
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('data') is not None:
            self.data = m.get('data')
        self.extension = []
        if m.get('extension') is not None:
            for k in m.get('extension'):
                temp_model = Extension()
                self.extension.append(temp_model.from_map(k))
        if m.get('from') is not None:
            self.from_ = m.get('from')
        if m.get('gas') is not None:
            self.gas = m.get('gas')
        if m.get('group_id') is not None:
            self.group_id = m.get('group_id')
        if m.get('hash') is not None:
            self.hash = m.get('hash')
        if m.get('nonce') is not None:
            self.nonce = m.get('nonce')
        if m.get('period') is not None:
            self.period = m.get('period')
        if m.get('signature') is not None:
            self.signature = m.get('signature')
        if m.get('timestamp') is not None:
            self.timestamp = m.get('timestamp')
        if m.get('to') is not None:
            self.to = m.get('to')
        if m.get('type') is not None:
            self.type = m.get('type')
        if m.get('value') is not None:
            self.value = m.get('value')
        if m.get('version') is not None:
            self.version = m.get('version')
        return self


class CommissionLayer(TeaModel):
    def __init__(
        self,
        start_num: str = None,
        deduct_ratio: str = None,
        deduct_token: str = None,
    ):
        # 阶梯起始值，无结束值
        self.start_num = start_num
        # 手续费费率
        self.deduct_ratio = deduct_ratio
        # 固定的商品费率值
        self.deduct_token = deduct_token

    def validate(self):
        self.validate_required(self.start_num, 'start_num')
        self.validate_required(self.deduct_ratio, 'deduct_ratio')
        self.validate_required(self.deduct_token, 'deduct_token')

    def to_map(self):
        result = dict()
        if self.start_num is not None:
            result['start_num'] = self.start_num
        if self.deduct_ratio is not None:
            result['deduct_ratio'] = self.deduct_ratio
        if self.deduct_token is not None:
            result['deduct_token'] = self.deduct_token
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('start_num') is not None:
            self.start_num = m.get('start_num')
        if m.get('deduct_ratio') is not None:
            self.deduct_ratio = m.get('deduct_ratio')
        if m.get('deduct_token') is not None:
            self.deduct_token = m.get('deduct_token')
        return self


class DockingPeopleInfo(TeaModel):
    def __init__(
        self,
        name: str = None,
        mobile_phone: str = None,
        position: str = None,
        email: str = None,
        ding_ding: str = None,
        tele_phone: str = None,
    ):
        # 名字
        self.name = name
        # 手机号
        self.mobile_phone = mobile_phone
        # 职位
        self.position = position
        # 邮箱
        self.email = email
        # 钉钉号
        self.ding_ding = ding_ding
        # 座机
        self.tele_phone = tele_phone

    def validate(self):
        self.validate_required(self.name, 'name')
        self.validate_required(self.mobile_phone, 'mobile_phone')
        self.validate_required(self.position, 'position')

    def to_map(self):
        result = dict()
        if self.name is not None:
            result['name'] = self.name
        if self.mobile_phone is not None:
            result['mobile_phone'] = self.mobile_phone
        if self.position is not None:
            result['position'] = self.position
        if self.email is not None:
            result['email'] = self.email
        if self.ding_ding is not None:
            result['ding_ding'] = self.ding_ding
        if self.tele_phone is not None:
            result['tele_phone'] = self.tele_phone
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('name') is not None:
            self.name = m.get('name')
        if m.get('mobile_phone') is not None:
            self.mobile_phone = m.get('mobile_phone')
        if m.get('position') is not None:
            self.position = m.get('position')
        if m.get('email') is not None:
            self.email = m.get('email')
        if m.get('ding_ding') is not None:
            self.ding_ding = m.get('ding_ding')
        if m.get('tele_phone') is not None:
            self.tele_phone = m.get('tele_phone')
        return self


class BlockReceipt(TeaModel):
    def __init__(
        self,
        gas_used: int = None,
        logs: List[LogEntry] = None,
        output: str = None,
        result: int = None,
    ):
        # 使用的gas数量
        self.gas_used = gas_used
        # 收据log信息
        self.logs = logs
        # 交易输出
        self.output = output
        # 交易结果，0为成功
        self.result = result

    def validate(self):
        self.validate_required(self.gas_used, 'gas_used')
        self.validate_required(self.logs, 'logs')
        if self.logs:
            for k in self.logs:
                if k:
                    k.validate()
        self.validate_required(self.output, 'output')
        self.validate_required(self.result, 'result')

    def to_map(self):
        result = dict()
        if self.gas_used is not None:
            result['gas_used'] = self.gas_used
        result['logs'] = []
        if self.logs is not None:
            for k in self.logs:
                result['logs'].append(k.to_map() if k else None)
        if self.output is not None:
            result['output'] = self.output
        if self.result is not None:
            result['result'] = self.result
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('gas_used') is not None:
            self.gas_used = m.get('gas_used')
        self.logs = []
        if m.get('logs') is not None:
            for k in m.get('logs'):
                temp_model = LogEntry()
                self.logs.append(temp_model.from_map(k))
        if m.get('output') is not None:
            self.output = m.get('output')
        if m.get('result') is not None:
            self.result = m.get('result')
        return self


class IpSkuInfo(TeaModel):
    def __init__(
        self,
        ip_id: str = None,
        channel_name: str = None,
        price_range: str = None,
        purchase_price: str = None,
        sale_num: str = None,
    ):
        # ip的链上id
        self.ip_id = ip_id
        # ip的渠道名字
        self.channel_name = channel_name
        # 售卖的商品价格范围
        self.price_range = price_range
        # ip售卖单价
        self.purchase_price = purchase_price
        # 套餐中ip的数量
        self.sale_num = sale_num

    def validate(self):
        self.validate_required(self.ip_id, 'ip_id')
        self.validate_required(self.channel_name, 'channel_name')
        self.validate_required(self.price_range, 'price_range')
        self.validate_required(self.purchase_price, 'purchase_price')
        self.validate_required(self.sale_num, 'sale_num')

    def to_map(self):
        result = dict()
        if self.ip_id is not None:
            result['ip_id'] = self.ip_id
        if self.channel_name is not None:
            result['channel_name'] = self.channel_name
        if self.price_range is not None:
            result['price_range'] = self.price_range
        if self.purchase_price is not None:
            result['purchase_price'] = self.purchase_price
        if self.sale_num is not None:
            result['sale_num'] = self.sale_num
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('ip_id') is not None:
            self.ip_id = m.get('ip_id')
        if m.get('channel_name') is not None:
            self.channel_name = m.get('channel_name')
        if m.get('price_range') is not None:
            self.price_range = m.get('price_range')
        if m.get('purchase_price') is not None:
            self.purchase_price = m.get('purchase_price')
        if m.get('sale_num') is not None:
            self.sale_num = m.get('sale_num')
        return self


class SubCommissionRule(TeaModel):
    def __init__(
        self,
        deduct_token: str = None,
        deduct_ratio: str = None,
        account_id: str = None,
    ):
        # deduct_token
        self.deduct_token = deduct_token
        # deduct_ratio
        self.deduct_ratio = deduct_ratio
        # account_id
        self.account_id = account_id

    def validate(self):
        self.validate_required(self.deduct_token, 'deduct_token')
        self.validate_required(self.deduct_ratio, 'deduct_ratio')
        self.validate_required(self.account_id, 'account_id')

    def to_map(self):
        result = dict()
        if self.deduct_token is not None:
            result['deduct_token'] = self.deduct_token
        if self.deduct_ratio is not None:
            result['deduct_ratio'] = self.deduct_ratio
        if self.account_id is not None:
            result['account_id'] = self.account_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('deduct_token') is not None:
            self.deduct_token = m.get('deduct_token')
        if m.get('deduct_ratio') is not None:
            self.deduct_ratio = m.get('deduct_ratio')
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        return self


class IPAddressInfo(TeaModel):
    def __init__(
        self,
        province_code: str = None,
        city_code: str = None,
        district_code: str = None,
        address: str = None,
    ):
        # 省份编码
        self.province_code = province_code
        # 城市编码
        self.city_code = city_code
        # 区域编码
        self.district_code = district_code
        # 详细地址
        self.address = address

    def validate(self):
        self.validate_required(self.province_code, 'province_code')
        self.validate_required(self.city_code, 'city_code')
        self.validate_required(self.district_code, 'district_code')
        self.validate_required(self.address, 'address')

    def to_map(self):
        result = dict()
        if self.province_code is not None:
            result['province_code'] = self.province_code
        if self.city_code is not None:
            result['city_code'] = self.city_code
        if self.district_code is not None:
            result['district_code'] = self.district_code
        if self.address is not None:
            result['address'] = self.address
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('province_code') is not None:
            self.province_code = m.get('province_code')
        if m.get('city_code') is not None:
            self.city_code = m.get('city_code')
        if m.get('district_code') is not None:
            self.district_code = m.get('district_code')
        if m.get('address') is not None:
            self.address = m.get('address')
        return self


class IPCardInfo(TeaModel):
    def __init__(
        self,
        account_holder_name: str = None,
        account_no: str = None,
        account_inst_name: str = None,
        account_inst_id: str = None,
        bank_code: str = None,
        account_inst_province: str = None,
        account_inst_city: str = None,
        account_branch_name: str = None,
    ):
        # 卡户名
        self.account_holder_name = account_holder_name
        # 卡号
        self.account_no = account_no
        # 银行名称
        self.account_inst_name = account_inst_name
        # 银行缩写
        self.account_inst_id = account_inst_id
        # 联行号
        self.bank_code = bank_code
        # 开户行所在省份
        self.account_inst_province = account_inst_province
        # 开户行所在城市
        self.account_inst_city = account_inst_city
        # 开户行支行名称
        self.account_branch_name = account_branch_name

    def validate(self):
        self.validate_required(self.account_holder_name, 'account_holder_name')
        self.validate_required(self.account_no, 'account_no')
        self.validate_required(self.account_inst_name, 'account_inst_name')
        self.validate_required(self.account_inst_id, 'account_inst_id')
        self.validate_required(self.account_inst_province, 'account_inst_province')
        self.validate_required(self.account_inst_city, 'account_inst_city')
        self.validate_required(self.account_branch_name, 'account_branch_name')

    def to_map(self):
        result = dict()
        if self.account_holder_name is not None:
            result['account_holder_name'] = self.account_holder_name
        if self.account_no is not None:
            result['account_no'] = self.account_no
        if self.account_inst_name is not None:
            result['account_inst_name'] = self.account_inst_name
        if self.account_inst_id is not None:
            result['account_inst_id'] = self.account_inst_id
        if self.bank_code is not None:
            result['bank_code'] = self.bank_code
        if self.account_inst_province is not None:
            result['account_inst_province'] = self.account_inst_province
        if self.account_inst_city is not None:
            result['account_inst_city'] = self.account_inst_city
        if self.account_branch_name is not None:
            result['account_branch_name'] = self.account_branch_name
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('account_holder_name') is not None:
            self.account_holder_name = m.get('account_holder_name')
        if m.get('account_no') is not None:
            self.account_no = m.get('account_no')
        if m.get('account_inst_name') is not None:
            self.account_inst_name = m.get('account_inst_name')
        if m.get('account_inst_id') is not None:
            self.account_inst_id = m.get('account_inst_id')
        if m.get('bank_code') is not None:
            self.bank_code = m.get('bank_code')
        if m.get('account_inst_province') is not None:
            self.account_inst_province = m.get('account_inst_province')
        if m.get('account_inst_city') is not None:
            self.account_inst_city = m.get('account_inst_city')
        if m.get('account_branch_name') is not None:
            self.account_branch_name = m.get('account_branch_name')
        return self


class IPCodeGoodsInfo(TeaModel):
    def __init__(
        self,
        goods_name: str = None,
        goods_url: str = None,
        goods_image: str = None,
        goods_store: str = None,
        goods_store_logo: str = None,
    ):
        # 商品名称
        self.goods_name = goods_name
        # 商品链接
        self.goods_url = goods_url
        # 商品图片
        self.goods_image = goods_image
        # 商品店铺名称
        self.goods_store = goods_store
        # 店铺logo图片链接
        self.goods_store_logo = goods_store_logo

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.goods_name is not None:
            result['goods_name'] = self.goods_name
        if self.goods_url is not None:
            result['goods_url'] = self.goods_url
        if self.goods_image is not None:
            result['goods_image'] = self.goods_image
        if self.goods_store is not None:
            result['goods_store'] = self.goods_store
        if self.goods_store_logo is not None:
            result['goods_store_logo'] = self.goods_store_logo
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('goods_name') is not None:
            self.goods_name = m.get('goods_name')
        if m.get('goods_url') is not None:
            self.goods_url = m.get('goods_url')
        if m.get('goods_image') is not None:
            self.goods_image = m.get('goods_image')
        if m.get('goods_store') is not None:
            self.goods_store = m.get('goods_store')
        if m.get('goods_store_logo') is not None:
            self.goods_store_logo = m.get('goods_store_logo')
        return self


class ValueAddedServiceInfo(TeaModel):
    def __init__(
        self,
        account_id: str = None,
        service_id: str = None,
        service_name: str = None,
        images: str = None,
        images_detail: str = None,
        description: str = None,
        docking_people: List[DockingPeopleInfo] = None,
        copy_right: str = None,
        memo: str = None,
        status: int = None,
    ):
        # 增值服务归属账户id
        self.account_id = account_id
        # 增值服务id
        self.service_id = service_id
        # 增值服务名字
        self.service_name = service_name
        # 主图 链接地址
        self.images = images
        # 详情图
        self.images_detail = images_detail
        # 增值服务描述
        self.description = description
        # 联系人列表
        self.docking_people = docking_people
        # 资质证明
        self.copy_right = copy_right
        # 备注
        self.memo = memo
        # 服务状态（0:待审核 1:审核拒绝 2:上线【审核通过】 3: 下线）
        self.status = status

    def validate(self):
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.service_id, 'service_id')
        self.validate_required(self.service_name, 'service_name')
        self.validate_required(self.images, 'images')
        self.validate_required(self.images_detail, 'images_detail')
        self.validate_required(self.docking_people, 'docking_people')
        if self.docking_people:
            for k in self.docking_people:
                if k:
                    k.validate()
        self.validate_required(self.status, 'status')

    def to_map(self):
        result = dict()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.service_id is not None:
            result['service_id'] = self.service_id
        if self.service_name is not None:
            result['service_name'] = self.service_name
        if self.images is not None:
            result['images'] = self.images
        if self.images_detail is not None:
            result['images_detail'] = self.images_detail
        if self.description is not None:
            result['description'] = self.description
        result['docking_people'] = []
        if self.docking_people is not None:
            for k in self.docking_people:
                result['docking_people'].append(k.to_map() if k else None)
        if self.copy_right is not None:
            result['copy_right'] = self.copy_right
        if self.memo is not None:
            result['memo'] = self.memo
        if self.status is not None:
            result['status'] = self.status
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('service_id') is not None:
            self.service_id = m.get('service_id')
        if m.get('service_name') is not None:
            self.service_name = m.get('service_name')
        if m.get('images') is not None:
            self.images = m.get('images')
        if m.get('images_detail') is not None:
            self.images_detail = m.get('images_detail')
        if m.get('description') is not None:
            self.description = m.get('description')
        self.docking_people = []
        if m.get('docking_people') is not None:
            for k in m.get('docking_people'):
                temp_model = DockingPeopleInfo()
                self.docking_people.append(temp_model.from_map(k))
        if m.get('copy_right') is not None:
            self.copy_right = m.get('copy_right')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('status') is not None:
            self.status = m.get('status')
        return self


class EquityExtInfo(TeaModel):
    def __init__(
        self,
        limit_per_day_used: int = None,
        limit_per_month_used: int = None,
        open_to_tenant_id: str = None,
        target_date: str = None,
        tenant_price: str = None,
        tenant_user_price: UserPrice = None,
        tenant_price_with_commission: str = None,
        commission: str = None,
    ):
        # 指定兑换日限制已使用
        self.limit_per_day_used = limit_per_day_used
        # 指定兑换月限制已使用
        self.limit_per_month_used = limit_per_month_used
        # 权益开放的租户ID
        self.open_to_tenant_id = open_to_tenant_id
        # 指定日期
        self.target_date = target_date
        # 权益对租户价格
        self.tenant_price = tenant_price
        # 授权给租户用户的价格
        self.tenant_user_price = tenant_user_price
        # 租户价格包括费率
        self.tenant_price_with_commission = tenant_price_with_commission
        # 费率
        self.commission = commission

    def validate(self):
        self.validate_required(self.limit_per_day_used, 'limit_per_day_used')
        self.validate_required(self.limit_per_month_used, 'limit_per_month_used')
        self.validate_required(self.open_to_tenant_id, 'open_to_tenant_id')
        self.validate_required(self.target_date, 'target_date')
        self.validate_required(self.tenant_price, 'tenant_price')
        self.validate_required(self.tenant_user_price, 'tenant_user_price')
        if self.tenant_user_price:
            self.tenant_user_price.validate()
        self.validate_required(self.tenant_price_with_commission, 'tenant_price_with_commission')
        self.validate_required(self.commission, 'commission')

    def to_map(self):
        result = dict()
        if self.limit_per_day_used is not None:
            result['limit_per_day_used'] = self.limit_per_day_used
        if self.limit_per_month_used is not None:
            result['limit_per_month_used'] = self.limit_per_month_used
        if self.open_to_tenant_id is not None:
            result['open_to_tenant_id'] = self.open_to_tenant_id
        if self.target_date is not None:
            result['target_date'] = self.target_date
        if self.tenant_price is not None:
            result['tenant_price'] = self.tenant_price
        if self.tenant_user_price is not None:
            result['tenant_user_price'] = self.tenant_user_price.to_map()
        if self.tenant_price_with_commission is not None:
            result['tenant_price_with_commission'] = self.tenant_price_with_commission
        if self.commission is not None:
            result['commission'] = self.commission
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('limit_per_day_used') is not None:
            self.limit_per_day_used = m.get('limit_per_day_used')
        if m.get('limit_per_month_used') is not None:
            self.limit_per_month_used = m.get('limit_per_month_used')
        if m.get('open_to_tenant_id') is not None:
            self.open_to_tenant_id = m.get('open_to_tenant_id')
        if m.get('target_date') is not None:
            self.target_date = m.get('target_date')
        if m.get('tenant_price') is not None:
            self.tenant_price = m.get('tenant_price')
        if m.get('tenant_user_price') is not None:
            temp_model = UserPrice()
            self.tenant_user_price = temp_model.from_map(m['tenant_user_price'])
        if m.get('tenant_price_with_commission') is not None:
            self.tenant_price_with_commission = m.get('tenant_price_with_commission')
        if m.get('commission') is not None:
            self.commission = m.get('commission')
        return self


class AssetExtInfo(TeaModel):
    def __init__(
        self,
        dispense_balance: str = None,
        dispense_tenant_id: str = None,
        user_credit_balance: str = None,
        user_id: str = None,
    ):
        # 发放账户余额
        self.dispense_balance = dispense_balance
        # 发放账户归属租户ID
        self.dispense_tenant_id = dispense_tenant_id
        # 用户账户余额
        self.user_credit_balance = user_credit_balance
        # 用户ID
        self.user_id = user_id

    def validate(self):
        self.validate_required(self.dispense_balance, 'dispense_balance')
        self.validate_required(self.dispense_tenant_id, 'dispense_tenant_id')
        self.validate_required(self.user_credit_balance, 'user_credit_balance')
        self.validate_required(self.user_id, 'user_id')

    def to_map(self):
        result = dict()
        if self.dispense_balance is not None:
            result['dispense_balance'] = self.dispense_balance
        if self.dispense_tenant_id is not None:
            result['dispense_tenant_id'] = self.dispense_tenant_id
        if self.user_credit_balance is not None:
            result['user_credit_balance'] = self.user_credit_balance
        if self.user_id is not None:
            result['user_id'] = self.user_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('dispense_balance') is not None:
            self.dispense_balance = m.get('dispense_balance')
        if m.get('dispense_tenant_id') is not None:
            self.dispense_tenant_id = m.get('dispense_tenant_id')
        if m.get('user_credit_balance') is not None:
            self.user_credit_balance = m.get('user_credit_balance')
        if m.get('user_id') is not None:
            self.user_id = m.get('user_id')
        return self


class StatisticalInfo(TeaModel):
    def __init__(
        self,
        credit_token_balance: str = None,
        debit_token_balance: str = None,
        other_token_balance: str = None,
        used_token_balance: str = None,
    ):
        # 可用于消费的信用Token等值金额(单位:元, 精确到小数点后12位)
        self.credit_token_balance = credit_token_balance
        # 可用于消费的Token等值金额(单位:元, 精确到小数点后12位)
        self.debit_token_balance = debit_token_balance
        # 目前持有的他人Token的金额(单位:元, 精确到小数点后12位)
        self.other_token_balance = other_token_balance
        # 已消费的累积金额(单位:元, 精确到小数点后12位)
        self.used_token_balance = used_token_balance

    def validate(self):
        self.validate_required(self.credit_token_balance, 'credit_token_balance')
        self.validate_required(self.debit_token_balance, 'debit_token_balance')
        self.validate_required(self.other_token_balance, 'other_token_balance')
        self.validate_required(self.used_token_balance, 'used_token_balance')

    def to_map(self):
        result = dict()
        if self.credit_token_balance is not None:
            result['credit_token_balance'] = self.credit_token_balance
        if self.debit_token_balance is not None:
            result['debit_token_balance'] = self.debit_token_balance
        if self.other_token_balance is not None:
            result['other_token_balance'] = self.other_token_balance
        if self.used_token_balance is not None:
            result['used_token_balance'] = self.used_token_balance
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('credit_token_balance') is not None:
            self.credit_token_balance = m.get('credit_token_balance')
        if m.get('debit_token_balance') is not None:
            self.debit_token_balance = m.get('debit_token_balance')
        if m.get('other_token_balance') is not None:
            self.other_token_balance = m.get('other_token_balance')
        if m.get('used_token_balance') is not None:
            self.used_token_balance = m.get('used_token_balance')
        return self


class IPSettleRule(TeaModel):
    def __init__(
        self,
        settle_type: int = None,
        settle_target: str = None,
    ):
        # 结算类型， 1-表示结算到银行卡；2-表示结算到支付宝账号
        self.settle_type = settle_type
        # 结算目标 如果settle_type = 1, 这里填写银行卡卡号; 如果settle_type = 2, 这里填写支付宝账号登录号, 且要求与商户名称name同名
        self.settle_target = settle_target

    def validate(self):
        self.validate_required(self.settle_type, 'settle_type')
        self.validate_required(self.settle_target, 'settle_target')

    def to_map(self):
        result = dict()
        if self.settle_type is not None:
            result['settle_type'] = self.settle_type
        if self.settle_target is not None:
            result['settle_target'] = self.settle_target
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('settle_type') is not None:
            self.settle_type = m.get('settle_type')
        if m.get('settle_target') is not None:
            self.settle_target = m.get('settle_target')
        return self


class MetaDataDO(TeaModel):
    def __init__(
        self,
        key: str = None,
        value: str = None,
    ):
        # key
        self.key = key
        # value
        self.value = value

    def validate(self):
        self.validate_required(self.key, 'key')
        self.validate_required(self.value, 'value')

    def to_map(self):
        result = dict()
        if self.key is not None:
            result['key'] = self.key
        if self.value is not None:
            result['value'] = self.value
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('key') is not None:
            self.key = m.get('key')
        if m.get('value') is not None:
            self.value = m.get('value')
        return self


class DebitWallet(TeaModel):
    def __init__(
        self,
        balance: str = None,
        bank_account_name: str = None,
        bank_address: str = None,
        bank_branch_name: str = None,
        bank_card_id: str = None,
        bank_name: str = None,
        ext_info: str = None,
        fund_manager_id: str = None,
        trustee_id: str = None,
        wallet_type: int = None,
    ):
        # 钱包余额(单位:元, 精确到小数点后4位)
        self.balance = balance
        # 开户名称
        self.bank_account_name = bank_account_name
        # 开户地
        self.bank_address = bank_address
        # 开户银行分支机构名称
        self.bank_branch_name = bank_branch_name
        # 开户卡号
        self.bank_card_id = bank_card_id
        # 开户行名称
        self.bank_name = bank_name
        # 其他信息（例举：联行号）
        self.ext_info = ext_info
        # 资金管理员
        self.fund_manager_id = fund_manager_id
        # 资金托管员
        self.trustee_id = trustee_id
        # 钱包类型（0:debit,1:credit）
        self.wallet_type = wallet_type

    def validate(self):
        self.validate_required(self.balance, 'balance')
        self.validate_required(self.bank_account_name, 'bank_account_name')
        self.validate_required(self.bank_address, 'bank_address')
        self.validate_required(self.bank_branch_name, 'bank_branch_name')
        self.validate_required(self.bank_card_id, 'bank_card_id')
        self.validate_required(self.bank_name, 'bank_name')
        self.validate_required(self.ext_info, 'ext_info')
        self.validate_required(self.fund_manager_id, 'fund_manager_id')
        self.validate_required(self.trustee_id, 'trustee_id')
        self.validate_required(self.wallet_type, 'wallet_type')

    def to_map(self):
        result = dict()
        if self.balance is not None:
            result['balance'] = self.balance
        if self.bank_account_name is not None:
            result['bank_account_name'] = self.bank_account_name
        if self.bank_address is not None:
            result['bank_address'] = self.bank_address
        if self.bank_branch_name is not None:
            result['bank_branch_name'] = self.bank_branch_name
        if self.bank_card_id is not None:
            result['bank_card_id'] = self.bank_card_id
        if self.bank_name is not None:
            result['bank_name'] = self.bank_name
        if self.ext_info is not None:
            result['ext_info'] = self.ext_info
        if self.fund_manager_id is not None:
            result['fund_manager_id'] = self.fund_manager_id
        if self.trustee_id is not None:
            result['trustee_id'] = self.trustee_id
        if self.wallet_type is not None:
            result['wallet_type'] = self.wallet_type
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('balance') is not None:
            self.balance = m.get('balance')
        if m.get('bank_account_name') is not None:
            self.bank_account_name = m.get('bank_account_name')
        if m.get('bank_address') is not None:
            self.bank_address = m.get('bank_address')
        if m.get('bank_branch_name') is not None:
            self.bank_branch_name = m.get('bank_branch_name')
        if m.get('bank_card_id') is not None:
            self.bank_card_id = m.get('bank_card_id')
        if m.get('bank_name') is not None:
            self.bank_name = m.get('bank_name')
        if m.get('ext_info') is not None:
            self.ext_info = m.get('ext_info')
        if m.get('fund_manager_id') is not None:
            self.fund_manager_id = m.get('fund_manager_id')
        if m.get('trustee_id') is not None:
            self.trustee_id = m.get('trustee_id')
        if m.get('wallet_type') is not None:
            self.wallet_type = m.get('wallet_type')
        return self


class IpSkuEmphasisInfo(TeaModel):
    def __init__(
        self,
        price_range: str = None,
        purchase_price: str = None,
        sale_num: str = None,
    ):
        # 价格区间，不做校验
        self.price_range = price_range
        # 单价
        self.purchase_price = purchase_price
        # 套餐数量
        self.sale_num = sale_num

    def validate(self):
        self.validate_required(self.price_range, 'price_range')
        self.validate_required(self.purchase_price, 'purchase_price')
        self.validate_required(self.sale_num, 'sale_num')

    def to_map(self):
        result = dict()
        if self.price_range is not None:
            result['price_range'] = self.price_range
        if self.purchase_price is not None:
            result['purchase_price'] = self.purchase_price
        if self.sale_num is not None:
            result['sale_num'] = self.sale_num
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('price_range') is not None:
            self.price_range = m.get('price_range')
        if m.get('purchase_price') is not None:
            self.purchase_price = m.get('purchase_price')
        if m.get('sale_num') is not None:
            self.sale_num = m.get('sale_num')
        return self


class BlockBody(TeaModel):
    def __init__(
        self,
        consensus_proof: str = None,
        receipt_list: List[BlockReceipt] = None,
        transaction_list: List[BlockTransaction] = None,
    ):
        # 区块共识证明(HEX)
        self.consensus_proof = consensus_proof
        # 区块中交易回执列表
        self.receipt_list = receipt_list
        # 区块中交易列表
        self.transaction_list = transaction_list

    def validate(self):
        self.validate_required(self.consensus_proof, 'consensus_proof')
        self.validate_required(self.receipt_list, 'receipt_list')
        if self.receipt_list:
            for k in self.receipt_list:
                if k:
                    k.validate()
        self.validate_required(self.transaction_list, 'transaction_list')
        if self.transaction_list:
            for k in self.transaction_list:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.consensus_proof is not None:
            result['consensus_proof'] = self.consensus_proof
        result['receipt_list'] = []
        if self.receipt_list is not None:
            for k in self.receipt_list:
                result['receipt_list'].append(k.to_map() if k else None)
        result['transaction_list'] = []
        if self.transaction_list is not None:
            for k in self.transaction_list:
                result['transaction_list'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('consensus_proof') is not None:
            self.consensus_proof = m.get('consensus_proof')
        self.receipt_list = []
        if m.get('receipt_list') is not None:
            for k in m.get('receipt_list'):
                temp_model = BlockReceipt()
                self.receipt_list.append(temp_model.from_map(k))
        self.transaction_list = []
        if m.get('transaction_list') is not None:
            for k in m.get('transaction_list'):
                temp_model = BlockTransaction()
                self.transaction_list.append(temp_model.from_map(k))
        return self


class CommissionPeriod(TeaModel):
    def __init__(
        self,
        deduct_ratio: str = None,
        sub_commission_rules: List[SubCommissionRule] = None,
        merchant_layers: List[CommissionLayer] = None,
        goods_layers: List[CommissionLayer] = None,
        start_time_mills: int = None,
        layer_type: int = None,
        counter_time_type: int = None,
        deduct_token: str = None,
    ):
        # 手续费费率
        self.deduct_ratio = deduct_ratio
        # 手续费子结构
        self.sub_commission_rules = sub_commission_rules
        # 买家的历史统计做阶梯计费，最多50个
        self.merchant_layers = merchant_layers
        # 商品阶梯
        self.goods_layers = goods_layers
        # 手续费开始时间（无结束时间）
        self.start_time_mills = start_time_mills
        # 0: txcount（成功的交易）; 1: 累计交易金额; 2:累计手续费; 3：单笔金额, ...
        self.layer_type = layer_type
        # 分层的周期，（0是月，1是日，2是年（这期不用，需要设置一下）, 3是季度）
        self.counter_time_type = counter_time_type
        # 商品固定费用
        self.deduct_token = deduct_token

    def validate(self):
        self.validate_required(self.deduct_ratio, 'deduct_ratio')
        self.validate_required(self.sub_commission_rules, 'sub_commission_rules')
        if self.sub_commission_rules:
            for k in self.sub_commission_rules:
                if k:
                    k.validate()
        self.validate_required(self.merchant_layers, 'merchant_layers')
        if self.merchant_layers:
            for k in self.merchant_layers:
                if k:
                    k.validate()
        self.validate_required(self.goods_layers, 'goods_layers')
        if self.goods_layers:
            for k in self.goods_layers:
                if k:
                    k.validate()
        self.validate_required(self.start_time_mills, 'start_time_mills')
        self.validate_required(self.layer_type, 'layer_type')
        self.validate_required(self.counter_time_type, 'counter_time_type')
        self.validate_required(self.deduct_token, 'deduct_token')

    def to_map(self):
        result = dict()
        if self.deduct_ratio is not None:
            result['deduct_ratio'] = self.deduct_ratio
        result['sub_commission_rules'] = []
        if self.sub_commission_rules is not None:
            for k in self.sub_commission_rules:
                result['sub_commission_rules'].append(k.to_map() if k else None)
        result['merchant_layers'] = []
        if self.merchant_layers is not None:
            for k in self.merchant_layers:
                result['merchant_layers'].append(k.to_map() if k else None)
        result['goods_layers'] = []
        if self.goods_layers is not None:
            for k in self.goods_layers:
                result['goods_layers'].append(k.to_map() if k else None)
        if self.start_time_mills is not None:
            result['start_time_mills'] = self.start_time_mills
        if self.layer_type is not None:
            result['layer_type'] = self.layer_type
        if self.counter_time_type is not None:
            result['counter_time_type'] = self.counter_time_type
        if self.deduct_token is not None:
            result['deduct_token'] = self.deduct_token
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('deduct_ratio') is not None:
            self.deduct_ratio = m.get('deduct_ratio')
        self.sub_commission_rules = []
        if m.get('sub_commission_rules') is not None:
            for k in m.get('sub_commission_rules'):
                temp_model = SubCommissionRule()
                self.sub_commission_rules.append(temp_model.from_map(k))
        self.merchant_layers = []
        if m.get('merchant_layers') is not None:
            for k in m.get('merchant_layers'):
                temp_model = CommissionLayer()
                self.merchant_layers.append(temp_model.from_map(k))
        self.goods_layers = []
        if m.get('goods_layers') is not None:
            for k in m.get('goods_layers'):
                temp_model = CommissionLayer()
                self.goods_layers.append(temp_model.from_map(k))
        if m.get('start_time_mills') is not None:
            self.start_time_mills = m.get('start_time_mills')
        if m.get('layer_type') is not None:
            self.layer_type = m.get('layer_type')
        if m.get('counter_time_type') is not None:
            self.counter_time_type = m.get('counter_time_type')
        if m.get('deduct_token') is not None:
            self.deduct_token = m.get('deduct_token')
        return self


class Provision(TeaModel):
    def __init__(
        self,
        credit_max: str = None,
        credit_used: str = None,
        currency: str = None,
        debit: str = None,
    ):
        # 授信上限
        self.credit_max = credit_max
        # 授信已使用
        self.credit_used = credit_used
        # 币种
        self.currency = currency
        # 余额
        self.debit = debit

    def validate(self):
        self.validate_required(self.credit_max, 'credit_max')
        self.validate_required(self.credit_used, 'credit_used')
        self.validate_required(self.currency, 'currency')
        self.validate_required(self.debit, 'debit')

    def to_map(self):
        result = dict()
        if self.credit_max is not None:
            result['credit_max'] = self.credit_max
        if self.credit_used is not None:
            result['credit_used'] = self.credit_used
        if self.currency is not None:
            result['currency'] = self.currency
        if self.debit is not None:
            result['debit'] = self.debit
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('credit_max') is not None:
            self.credit_max = m.get('credit_max')
        if m.get('credit_used') is not None:
            self.credit_used = m.get('credit_used')
        if m.get('currency') is not None:
            self.currency = m.get('currency')
        if m.get('debit') is not None:
            self.debit = m.get('debit')
        return self


class CreditWallet(TeaModel):
    def __init__(
        self,
        max_balance: str = None,
        used_balance: str = None,
        wallet_type: int = None,
        fund_manager_id: str = None,
        trustee_id: str = None,
        ext_info: str = None,
    ):
        # 最大授信额度(单位:元,精确到小数点后4位)
        self.max_balance = max_balance
        # 已经使用的授信额度(单位:元,精确到小数点后4位)
        self.used_balance = used_balance
        # 钱包类型（0:debit,1:credit）
        self.wallet_type = wallet_type
        # 资金管理员
        self.fund_manager_id = fund_manager_id
        # 资金托管员
        self.trustee_id = trustee_id
        # 其他信息（例举：联行号）
        self.ext_info = ext_info

    def validate(self):
        self.validate_required(self.max_balance, 'max_balance')
        self.validate_required(self.used_balance, 'used_balance')
        self.validate_required(self.wallet_type, 'wallet_type')
        self.validate_required(self.fund_manager_id, 'fund_manager_id')
        self.validate_required(self.trustee_id, 'trustee_id')
        self.validate_required(self.ext_info, 'ext_info')

    def to_map(self):
        result = dict()
        if self.max_balance is not None:
            result['max_balance'] = self.max_balance
        if self.used_balance is not None:
            result['used_balance'] = self.used_balance
        if self.wallet_type is not None:
            result['wallet_type'] = self.wallet_type
        if self.fund_manager_id is not None:
            result['fund_manager_id'] = self.fund_manager_id
        if self.trustee_id is not None:
            result['trustee_id'] = self.trustee_id
        if self.ext_info is not None:
            result['ext_info'] = self.ext_info
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('max_balance') is not None:
            self.max_balance = m.get('max_balance')
        if m.get('used_balance') is not None:
            self.used_balance = m.get('used_balance')
        if m.get('wallet_type') is not None:
            self.wallet_type = m.get('wallet_type')
        if m.get('fund_manager_id') is not None:
            self.fund_manager_id = m.get('fund_manager_id')
        if m.get('trustee_id') is not None:
            self.trustee_id = m.get('trustee_id')
        if m.get('ext_info') is not None:
            self.ext_info = m.get('ext_info')
        return self


class EquityDetail(TeaModel):
    def __init__(
        self,
        description: str = None,
        desc_images: str = None,
        equity_id: str = None,
        equity_name: str = None,
        equity_type: str = None,
        equity_value: str = None,
        images: str = None,
        price: str = None,
        sku_id: str = None,
    ):
        # 权益描述
        self.description = description
        # 权益描述图片OSS地址（分号;分隔）
        self.desc_images = desc_images
        # 权益ID
        self.equity_id = equity_id
        # 权益名称
        self.equity_name = equity_name
        # 权益类型
        self.equity_type = equity_type
        # 权益面值(元)
        self.equity_value = equity_value
        # 权益主图片OSS地址（分号;分隔）
        self.images = images
        # 对客价(元)
        self.price = price
        # 权益SKU
        self.sku_id = sku_id

    def validate(self):
        self.validate_required(self.description, 'description')
        self.validate_required(self.desc_images, 'desc_images')
        self.validate_required(self.equity_id, 'equity_id')
        self.validate_required(self.equity_name, 'equity_name')
        self.validate_required(self.equity_type, 'equity_type')
        self.validate_required(self.equity_value, 'equity_value')
        self.validate_required(self.images, 'images')
        self.validate_required(self.price, 'price')
        self.validate_required(self.sku_id, 'sku_id')

    def to_map(self):
        result = dict()
        if self.description is not None:
            result['description'] = self.description
        if self.desc_images is not None:
            result['desc_images'] = self.desc_images
        if self.equity_id is not None:
            result['equity_id'] = self.equity_id
        if self.equity_name is not None:
            result['equity_name'] = self.equity_name
        if self.equity_type is not None:
            result['equity_type'] = self.equity_type
        if self.equity_value is not None:
            result['equity_value'] = self.equity_value
        if self.images is not None:
            result['images'] = self.images
        if self.price is not None:
            result['price'] = self.price
        if self.sku_id is not None:
            result['sku_id'] = self.sku_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('description') is not None:
            self.description = m.get('description')
        if m.get('desc_images') is not None:
            self.desc_images = m.get('desc_images')
        if m.get('equity_id') is not None:
            self.equity_id = m.get('equity_id')
        if m.get('equity_name') is not None:
            self.equity_name = m.get('equity_name')
        if m.get('equity_type') is not None:
            self.equity_type = m.get('equity_type')
        if m.get('equity_value') is not None:
            self.equity_value = m.get('equity_value')
        if m.get('images') is not None:
            self.images = m.get('images')
        if m.get('price') is not None:
            self.price = m.get('price')
        if m.get('sku_id') is not None:
            self.sku_id = m.get('sku_id')
        return self


class IpBasicInfo(TeaModel):
    def __init__(
        self,
        ip_name: str = None,
        ip_id: str = None,
        ip_type: str = None,
        audience_group: str = None,
        image: str = None,
        image_detail: str = None,
        description: str = None,
        docking_people_info: List[DockingPeopleInfo] = None,
        copy_right_type: str = None,
        copy_right: str = None,
        cooperation_case: str = None,
        cooperation_note: str = None,
        channel_name: str = None,
        ip_create_time: int = None,
        future_milestones: str = None,
        promotion_channels: str = None,
        system_create_time: int = None,
        ip_other_name: str = None,
        approval_status: int = None,
        approval_comments: str = None,
        memo: str = None,
        copy_right_begin_time: int = None,
        account_id: str = None,
        copy_right_end_time: int = None,
        account_name: str = None,
    ):
        # ip名字
        self.ip_name = ip_name
        # ip的链上id
        self.ip_id = ip_id
        # ip类型，多个用;隔开
        self.ip_type = ip_type
        # 受众群体，多个用;隔开
        self.audience_group = audience_group
        # ip主图,存放oss图片链接;隔开
        self.image = image
        # 商品详情图 存放OSS图片链接 用;隔开
        self.image_detail = image_detail
        # ip 描述
        self.description = description
        # 对接人信息，json列表
        # [{
        # "name":"123", //联系人名字，必填
        # "mobilePhone":"123",// 联系人手机号,必填
        # "email":"456",// 联系人邮箱,选填
        # "dingDing":"999",// 联系人钉钉号,选填
        # "telePhone":"8888",// 联系人座机,选填
        # "position":"aaa"// 联系人职务,必填
        # }]
        self.docking_people_info = docking_people_info
        # 资质证书类型，0为自己上传的资质证书，1为区块链版权证书
        self.copy_right_type = copy_right_type
        # 资质信息
        self.copy_right = copy_right
        # 合作案例，图片存放oss链接，多张用,隔开
        self.cooperation_case = cooperation_case
        # 合作事项
        self.cooperation_note = cooperation_note
        # 查询渠道
        self.channel_name = channel_name
        # ip的外部创建时间，毫秒时间戳
        self.ip_create_time = ip_create_time
        # 未来大事件
        self.future_milestones = future_milestones
        # 推广渠道
        self.promotion_channels = promotion_channels
        # 系统中创建时间
        self.system_create_time = system_create_time
        # ip别名，多个用;隔开
        self.ip_other_name = ip_other_name
        # ip的状态 0 待审批， 1 审批通过 2 审批拒绝
        self.approval_status = approval_status
        # 审批意见
        self.approval_comments = approval_comments
        # 备注信息
        self.memo = memo
        # 资质生效时间，毫秒时间戳
        self.copy_right_begin_time = copy_right_begin_time
        # 创建ip的版权方的链上账户
        self.account_id = account_id
        # 资质生效的结束时间
        self.copy_right_end_time = copy_right_end_time
        # 账户名称
        self.account_name = account_name

    def validate(self):
        self.validate_required(self.ip_name, 'ip_name')
        self.validate_required(self.ip_id, 'ip_id')
        self.validate_required(self.ip_type, 'ip_type')
        self.validate_required(self.audience_group, 'audience_group')
        self.validate_required(self.image, 'image')
        self.validate_required(self.image_detail, 'image_detail')
        self.validate_required(self.description, 'description')
        self.validate_required(self.docking_people_info, 'docking_people_info')
        if self.docking_people_info:
            for k in self.docking_people_info:
                if k:
                    k.validate()
        self.validate_required(self.copy_right_type, 'copy_right_type')
        self.validate_required(self.channel_name, 'channel_name')
        self.validate_required(self.system_create_time, 'system_create_time')
        self.validate_required(self.ip_other_name, 'ip_other_name')
        self.validate_required(self.memo, 'memo')
        self.validate_required(self.copy_right_begin_time, 'copy_right_begin_time')
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.copy_right_end_time, 'copy_right_end_time')

    def to_map(self):
        result = dict()
        if self.ip_name is not None:
            result['ip_name'] = self.ip_name
        if self.ip_id is not None:
            result['ip_id'] = self.ip_id
        if self.ip_type is not None:
            result['ip_type'] = self.ip_type
        if self.audience_group is not None:
            result['audience_group'] = self.audience_group
        if self.image is not None:
            result['image'] = self.image
        if self.image_detail is not None:
            result['image_detail'] = self.image_detail
        if self.description is not None:
            result['description'] = self.description
        result['docking_people_info'] = []
        if self.docking_people_info is not None:
            for k in self.docking_people_info:
                result['docking_people_info'].append(k.to_map() if k else None)
        if self.copy_right_type is not None:
            result['copy_right_type'] = self.copy_right_type
        if self.copy_right is not None:
            result['copy_right'] = self.copy_right
        if self.cooperation_case is not None:
            result['cooperation_case'] = self.cooperation_case
        if self.cooperation_note is not None:
            result['cooperation_note'] = self.cooperation_note
        if self.channel_name is not None:
            result['channel_name'] = self.channel_name
        if self.ip_create_time is not None:
            result['ip_create_time'] = self.ip_create_time
        if self.future_milestones is not None:
            result['future_milestones'] = self.future_milestones
        if self.promotion_channels is not None:
            result['promotion_channels'] = self.promotion_channels
        if self.system_create_time is not None:
            result['system_create_time'] = self.system_create_time
        if self.ip_other_name is not None:
            result['ip_other_name'] = self.ip_other_name
        if self.approval_status is not None:
            result['approval_status'] = self.approval_status
        if self.approval_comments is not None:
            result['approval_comments'] = self.approval_comments
        if self.memo is not None:
            result['memo'] = self.memo
        if self.copy_right_begin_time is not None:
            result['copy_right_begin_time'] = self.copy_right_begin_time
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.copy_right_end_time is not None:
            result['copy_right_end_time'] = self.copy_right_end_time
        if self.account_name is not None:
            result['account_name'] = self.account_name
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('ip_name') is not None:
            self.ip_name = m.get('ip_name')
        if m.get('ip_id') is not None:
            self.ip_id = m.get('ip_id')
        if m.get('ip_type') is not None:
            self.ip_type = m.get('ip_type')
        if m.get('audience_group') is not None:
            self.audience_group = m.get('audience_group')
        if m.get('image') is not None:
            self.image = m.get('image')
        if m.get('image_detail') is not None:
            self.image_detail = m.get('image_detail')
        if m.get('description') is not None:
            self.description = m.get('description')
        self.docking_people_info = []
        if m.get('docking_people_info') is not None:
            for k in m.get('docking_people_info'):
                temp_model = DockingPeopleInfo()
                self.docking_people_info.append(temp_model.from_map(k))
        if m.get('copy_right_type') is not None:
            self.copy_right_type = m.get('copy_right_type')
        if m.get('copy_right') is not None:
            self.copy_right = m.get('copy_right')
        if m.get('cooperation_case') is not None:
            self.cooperation_case = m.get('cooperation_case')
        if m.get('cooperation_note') is not None:
            self.cooperation_note = m.get('cooperation_note')
        if m.get('channel_name') is not None:
            self.channel_name = m.get('channel_name')
        if m.get('ip_create_time') is not None:
            self.ip_create_time = m.get('ip_create_time')
        if m.get('future_milestones') is not None:
            self.future_milestones = m.get('future_milestones')
        if m.get('promotion_channels') is not None:
            self.promotion_channels = m.get('promotion_channels')
        if m.get('system_create_time') is not None:
            self.system_create_time = m.get('system_create_time')
        if m.get('ip_other_name') is not None:
            self.ip_other_name = m.get('ip_other_name')
        if m.get('approval_status') is not None:
            self.approval_status = m.get('approval_status')
        if m.get('approval_comments') is not None:
            self.approval_comments = m.get('approval_comments')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('copy_right_begin_time') is not None:
            self.copy_right_begin_time = m.get('copy_right_begin_time')
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('copy_right_end_time') is not None:
            self.copy_right_end_time = m.get('copy_right_end_time')
        if m.get('account_name') is not None:
            self.account_name = m.get('account_name')
        return self


class IPContactInfo(TeaModel):
    def __init__(
        self,
        name: str = None,
        mobile: str = None,
        phone: str = None,
        type: int = None,
        certno: str = None,
    ):
        # 联系人姓名
        self.name = name
        # 联系人手机号码
        self.mobile = mobile
        # 联系人电话号码
        self.phone = phone
        # 联系人类型, 1-法人；2-实际控制人；3-代理人；4-其他
        self.type = type
        # 联系人身份证号
        self.certno = certno

    def validate(self):
        self.validate_required(self.name, 'name')
        self.validate_required(self.type, 'type')

    def to_map(self):
        result = dict()
        if self.name is not None:
            result['name'] = self.name
        if self.mobile is not None:
            result['mobile'] = self.mobile
        if self.phone is not None:
            result['phone'] = self.phone
        if self.type is not None:
            result['type'] = self.type
        if self.certno is not None:
            result['certno'] = self.certno
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('name') is not None:
            self.name = m.get('name')
        if m.get('mobile') is not None:
            self.mobile = m.get('mobile')
        if m.get('phone') is not None:
            self.phone = m.get('phone')
        if m.get('type') is not None:
            self.type = m.get('type')
        if m.get('certno') is not None:
            self.certno = m.get('certno')
        return self


class IPCodeAdvertisingInfo(TeaModel):
    def __init__(
        self,
        ad_image: str = None,
        ad_url: str = None,
    ):
        # 资源位头图
        self.ad_image = ad_image
        # 资源位链接
        self.ad_url = ad_url

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.ad_image is not None:
            result['ad_image'] = self.ad_image
        if self.ad_url is not None:
            result['ad_url'] = self.ad_url
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('ad_image') is not None:
            self.ad_image = m.get('ad_image')
        if m.get('ad_url') is not None:
            self.ad_url = m.get('ad_url')
        return self


class BlockHeader(TeaModel):
    def __init__(
        self,
        gas_used: int = None,
        hash: str = None,
        log_bloom: str = None,
        number: int = None,
        parent_hash: str = None,
        receipt_root: str = None,
        state_root: str = None,
        timestamp: int = None,
        transaction_root: str = None,
        version: int = None,
    ):
        # gas总消耗
        self.gas_used = gas_used
        # 十六进制区块哈希值
        self.hash = hash
        # log bloom
        self.log_bloom = log_bloom
        # 区块高度
        self.number = number
        # 十六进制区块父hash
        self.parent_hash = parent_hash
        # 交易单据树根
        self.receipt_root = receipt_root
        # 状态树根
        self.state_root = state_root
        # 区块时间戳
        self.timestamp = timestamp
        # 十六进制交易merkle树根
        self.transaction_root = transaction_root
        # 区块版本
        self.version = version

    def validate(self):
        self.validate_required(self.gas_used, 'gas_used')
        self.validate_required(self.hash, 'hash')
        self.validate_required(self.log_bloom, 'log_bloom')
        self.validate_required(self.number, 'number')
        self.validate_required(self.parent_hash, 'parent_hash')
        self.validate_required(self.receipt_root, 'receipt_root')
        self.validate_required(self.state_root, 'state_root')
        self.validate_required(self.timestamp, 'timestamp')
        self.validate_required(self.transaction_root, 'transaction_root')
        self.validate_required(self.version, 'version')

    def to_map(self):
        result = dict()
        if self.gas_used is not None:
            result['gas_used'] = self.gas_used
        if self.hash is not None:
            result['hash'] = self.hash
        if self.log_bloom is not None:
            result['log_bloom'] = self.log_bloom
        if self.number is not None:
            result['number'] = self.number
        if self.parent_hash is not None:
            result['parent_hash'] = self.parent_hash
        if self.receipt_root is not None:
            result['receipt_root'] = self.receipt_root
        if self.state_root is not None:
            result['state_root'] = self.state_root
        if self.timestamp is not None:
            result['timestamp'] = self.timestamp
        if self.transaction_root is not None:
            result['transaction_root'] = self.transaction_root
        if self.version is not None:
            result['version'] = self.version
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('gas_used') is not None:
            self.gas_used = m.get('gas_used')
        if m.get('hash') is not None:
            self.hash = m.get('hash')
        if m.get('log_bloom') is not None:
            self.log_bloom = m.get('log_bloom')
        if m.get('number') is not None:
            self.number = m.get('number')
        if m.get('parent_hash') is not None:
            self.parent_hash = m.get('parent_hash')
        if m.get('receipt_root') is not None:
            self.receipt_root = m.get('receipt_root')
        if m.get('state_root') is not None:
            self.state_root = m.get('state_root')
        if m.get('timestamp') is not None:
            self.timestamp = m.get('timestamp')
        if m.get('transaction_root') is not None:
            self.transaction_root = m.get('transaction_root')
        if m.get('version') is not None:
            self.version = m.get('version')
        return self


class TokenInstructionDO(TeaModel):
    def __init__(
        self,
        token_type: int = None,
        token_price: str = None,
        pay_account_id: str = None,
    ):
        # token类型
        self.token_type = token_type
        # token价格
        self.token_price = token_price
        # token来源账户ID
        self.pay_account_id = pay_account_id

    def validate(self):
        self.validate_required(self.token_type, 'token_type')
        self.validate_required(self.token_price, 'token_price')
        self.validate_required(self.pay_account_id, 'pay_account_id')

    def to_map(self):
        result = dict()
        if self.token_type is not None:
            result['token_type'] = self.token_type
        if self.token_price is not None:
            result['token_price'] = self.token_price
        if self.pay_account_id is not None:
            result['pay_account_id'] = self.pay_account_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('token_type') is not None:
            self.token_type = m.get('token_type')
        if m.get('token_price') is not None:
            self.token_price = m.get('token_price')
        if m.get('pay_account_id') is not None:
            self.pay_account_id = m.get('pay_account_id')
        return self


class IpChannelWithSku(TeaModel):
    def __init__(
        self,
        channel_name: str = None,
        authorization_mode: int = None,
        pay_mode: int = None,
        ip_level: int = None,
        sku_info: List[IpSkuInfo] = None,
        status: int = None,
        trade_need_confirm: bool = None,
    ):
        # 渠道名字
        self.channel_name = channel_name
        # 授权模式 商品授权 0普通授权/1独家授权 本期只有0
        # 
        self.authorization_mode = authorization_mode
        # 计费模式 0:按量 1:按金额
        # 
        self.pay_mode = pay_mode
        # ip等级  0:经典IP/1:流量IP/2:设计IP
        self.ip_level = ip_level
        # sku信息
        self.sku_info = sku_info
        # 商品状态（0:待上架，1:上架，2:下架）
        self.status = status
        # 交易是否需要确认
        self.trade_need_confirm = trade_need_confirm

    def validate(self):
        self.validate_required(self.channel_name, 'channel_name')
        self.validate_required(self.authorization_mode, 'authorization_mode')
        self.validate_required(self.pay_mode, 'pay_mode')
        self.validate_required(self.ip_level, 'ip_level')
        self.validate_required(self.sku_info, 'sku_info')
        if self.sku_info:
            for k in self.sku_info:
                if k:
                    k.validate()
        self.validate_required(self.status, 'status')

    def to_map(self):
        result = dict()
        if self.channel_name is not None:
            result['channel_name'] = self.channel_name
        if self.authorization_mode is not None:
            result['authorization_mode'] = self.authorization_mode
        if self.pay_mode is not None:
            result['pay_mode'] = self.pay_mode
        if self.ip_level is not None:
            result['ip_level'] = self.ip_level
        result['sku_info'] = []
        if self.sku_info is not None:
            for k in self.sku_info:
                result['sku_info'].append(k.to_map() if k else None)
        if self.status is not None:
            result['status'] = self.status
        if self.trade_need_confirm is not None:
            result['trade_need_confirm'] = self.trade_need_confirm
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('channel_name') is not None:
            self.channel_name = m.get('channel_name')
        if m.get('authorization_mode') is not None:
            self.authorization_mode = m.get('authorization_mode')
        if m.get('pay_mode') is not None:
            self.pay_mode = m.get('pay_mode')
        if m.get('ip_level') is not None:
            self.ip_level = m.get('ip_level')
        self.sku_info = []
        if m.get('sku_info') is not None:
            for k in m.get('sku_info'):
                temp_model = IpSkuInfo()
                self.sku_info.append(temp_model.from_map(k))
        if m.get('status') is not None:
            self.status = m.get('status')
        if m.get('trade_need_confirm') is not None:
            self.trade_need_confirm = m.get('trade_need_confirm')
        return self


class Card(TeaModel):
    def __init__(
        self,
        cal_status: int = None,
        card_id: str = None,
        charge_time: int = None,
        count_of_min_unit: int = None,
        create_time: int = None,
        create_tx_hash: str = None,
        desensitized_uid: str = None,
        ext_info: str = None,
        min_unit: int = None,
        public_key: str = None,
        status: int = None,
        uid_public_key: str = None,
        valid_after: int = None,
        valid_before: int = None,
        valid_days: int = None,
        value: int = None,
        version: int = None,
    ):
        # 计算理论上应该变为的状态
        self.cal_status = cal_status
        # 卡密ID
        self.card_id = card_id
        # 充值时间
        self.charge_time = charge_time
        # 数量
        self.count_of_min_unit = count_of_min_unit
        # 卡密创建时间
        self.create_time = create_time
        # 创建卡密时的交易hash
        self.create_tx_hash = create_tx_hash
        # 脱敏手机信息
        self.desensitized_uid = desensitized_uid
        # 附加信息
        self.ext_info = ext_info
        # 最小单位数量
        self.min_unit = min_unit
        # 公钥
        self.public_key = public_key
        # 状态
        self.status = status
        # 公钥信息
        self.uid_public_key = uid_public_key
        # 卡密在该时间后有效
        self.valid_after = valid_after
        # 卡密在该时间前有效
        self.valid_before = valid_before
        # 有效天数
        self.valid_days = valid_days
        # 价值
        self.value = value
        # 卡密版本
        self.version = version

    def validate(self):
        self.validate_required(self.cal_status, 'cal_status')
        self.validate_required(self.card_id, 'card_id')
        self.validate_required(self.charge_time, 'charge_time')
        self.validate_required(self.count_of_min_unit, 'count_of_min_unit')
        self.validate_required(self.create_time, 'create_time')
        self.validate_required(self.create_tx_hash, 'create_tx_hash')
        self.validate_required(self.desensitized_uid, 'desensitized_uid')
        self.validate_required(self.ext_info, 'ext_info')
        self.validate_required(self.min_unit, 'min_unit')
        self.validate_required(self.public_key, 'public_key')
        self.validate_required(self.status, 'status')
        self.validate_required(self.uid_public_key, 'uid_public_key')
        self.validate_required(self.valid_after, 'valid_after')
        self.validate_required(self.valid_before, 'valid_before')
        self.validate_required(self.valid_days, 'valid_days')
        self.validate_required(self.value, 'value')
        self.validate_required(self.version, 'version')

    def to_map(self):
        result = dict()
        if self.cal_status is not None:
            result['cal_status'] = self.cal_status
        if self.card_id is not None:
            result['card_id'] = self.card_id
        if self.charge_time is not None:
            result['charge_time'] = self.charge_time
        if self.count_of_min_unit is not None:
            result['count_of_min_unit'] = self.count_of_min_unit
        if self.create_time is not None:
            result['create_time'] = self.create_time
        if self.create_tx_hash is not None:
            result['create_tx_hash'] = self.create_tx_hash
        if self.desensitized_uid is not None:
            result['desensitized_uid'] = self.desensitized_uid
        if self.ext_info is not None:
            result['ext_info'] = self.ext_info
        if self.min_unit is not None:
            result['min_unit'] = self.min_unit
        if self.public_key is not None:
            result['public_key'] = self.public_key
        if self.status is not None:
            result['status'] = self.status
        if self.uid_public_key is not None:
            result['uid_public_key'] = self.uid_public_key
        if self.valid_after is not None:
            result['valid_after'] = self.valid_after
        if self.valid_before is not None:
            result['valid_before'] = self.valid_before
        if self.valid_days is not None:
            result['valid_days'] = self.valid_days
        if self.value is not None:
            result['value'] = self.value
        if self.version is not None:
            result['version'] = self.version
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('cal_status') is not None:
            self.cal_status = m.get('cal_status')
        if m.get('card_id') is not None:
            self.card_id = m.get('card_id')
        if m.get('charge_time') is not None:
            self.charge_time = m.get('charge_time')
        if m.get('count_of_min_unit') is not None:
            self.count_of_min_unit = m.get('count_of_min_unit')
        if m.get('create_time') is not None:
            self.create_time = m.get('create_time')
        if m.get('create_tx_hash') is not None:
            self.create_tx_hash = m.get('create_tx_hash')
        if m.get('desensitized_uid') is not None:
            self.desensitized_uid = m.get('desensitized_uid')
        if m.get('ext_info') is not None:
            self.ext_info = m.get('ext_info')
        if m.get('min_unit') is not None:
            self.min_unit = m.get('min_unit')
        if m.get('public_key') is not None:
            self.public_key = m.get('public_key')
        if m.get('status') is not None:
            self.status = m.get('status')
        if m.get('uid_public_key') is not None:
            self.uid_public_key = m.get('uid_public_key')
        if m.get('valid_after') is not None:
            self.valid_after = m.get('valid_after')
        if m.get('valid_before') is not None:
            self.valid_before = m.get('valid_before')
        if m.get('valid_days') is not None:
            self.valid_days = m.get('valid_days')
        if m.get('value') is not None:
            self.value = m.get('value')
        if m.get('version') is not None:
            self.version = m.get('version')
        return self


class SKUItem(TeaModel):
    def __init__(
        self,
        rate: str = None,
        sku_amount: int = None,
        sku_id: str = None,
        sku_name: str = None,
        sku_price: str = None,
        status: int = None,
    ):
        # 集分宝销售费率
        self.rate = rate
        # 包含集分宝个数
        self.sku_amount = sku_amount
        # 商品ID
        self.sku_id = sku_id
        # 商品名称
        self.sku_name = sku_name
        # 商品面值（单位：元）
        self.sku_price = sku_price
        # 商品状态：0可用，1冻结，2下线
        self.status = status

    def validate(self):
        self.validate_required(self.rate, 'rate')
        self.validate_required(self.sku_amount, 'sku_amount')
        self.validate_required(self.sku_id, 'sku_id')
        self.validate_required(self.sku_name, 'sku_name')
        self.validate_required(self.sku_price, 'sku_price')
        self.validate_required(self.status, 'status')

    def to_map(self):
        result = dict()
        if self.rate is not None:
            result['rate'] = self.rate
        if self.sku_amount is not None:
            result['sku_amount'] = self.sku_amount
        if self.sku_id is not None:
            result['sku_id'] = self.sku_id
        if self.sku_name is not None:
            result['sku_name'] = self.sku_name
        if self.sku_price is not None:
            result['sku_price'] = self.sku_price
        if self.status is not None:
            result['status'] = self.status
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('rate') is not None:
            self.rate = m.get('rate')
        if m.get('sku_amount') is not None:
            self.sku_amount = m.get('sku_amount')
        if m.get('sku_id') is not None:
            self.sku_id = m.get('sku_id')
        if m.get('sku_name') is not None:
            self.sku_name = m.get('sku_name')
        if m.get('sku_price') is not None:
            self.sku_price = m.get('sku_price')
        if m.get('status') is not None:
            self.status = m.get('status')
        return self


class CommissionRuleResponse(TeaModel):
    def __init__(
        self,
        account_id: str = None,
        commission_periods: List[CommissionPeriod] = None,
    ):
        # 手续费到账方
        self.account_id = account_id
        # 手续费周期列表
        self.commission_periods = commission_periods

    def validate(self):
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.commission_periods, 'commission_periods')
        if self.commission_periods:
            for k in self.commission_periods:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        result['commission_periods'] = []
        if self.commission_periods is not None:
            for k in self.commission_periods:
                result['commission_periods'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        self.commission_periods = []
        if m.get('commission_periods') is not None:
            for k in m.get('commission_periods'):
                temp_model = CommissionPeriod()
                self.commission_periods.append(temp_model.from_map(k))
        return self


class IPMCC(TeaModel):
    def __init__(
        self,
        mcc_code: str = None,
        category_level_1: str = None,
        category_level_2: str = None,
        category_level_3: str = None,
    ):
        # MCC编码
        self.mcc_code = mcc_code
        # 经营类目一级
        self.category_level_1 = category_level_1
        # 经营类目二级
        self.category_level_2 = category_level_2
        # 经营类目三级
        self.category_level_3 = category_level_3

    def validate(self):
        self.validate_required(self.mcc_code, 'mcc_code')
        self.validate_required(self.category_level_1, 'category_level_1')
        self.validate_required(self.category_level_2, 'category_level_2')
        self.validate_required(self.category_level_3, 'category_level_3')

    def to_map(self):
        result = dict()
        if self.mcc_code is not None:
            result['mcc_code'] = self.mcc_code
        if self.category_level_1 is not None:
            result['category_level1'] = self.category_level_1
        if self.category_level_2 is not None:
            result['category_level2'] = self.category_level_2
        if self.category_level_3 is not None:
            result['category_level3'] = self.category_level_3
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('mcc_code') is not None:
            self.mcc_code = m.get('mcc_code')
        if m.get('category_level1') is not None:
            self.category_level_1 = m.get('category_level1')
        if m.get('category_level2') is not None:
            self.category_level_2 = m.get('category_level2')
        if m.get('category_level3') is not None:
            self.category_level_3 = m.get('category_level3')
        return self


class AccountInChannels(TeaModel):
    def __init__(
        self,
        channel_name: str = None,
        is_settled: bool = None,
        settled_status: str = None,
    ):
        # 天猫渠道
        self.channel_name = channel_name
        # 是否入驻
        self.is_settled = is_settled
        # WAIT_CHECK:渠道已申请开通但未审核，SUCCESS:渠道开通审核成功，渠道开通
        self.settled_status = settled_status

    def validate(self):
        self.validate_required(self.channel_name, 'channel_name')
        self.validate_required(self.is_settled, 'is_settled')

    def to_map(self):
        result = dict()
        if self.channel_name is not None:
            result['channel_name'] = self.channel_name
        if self.is_settled is not None:
            result['is_settled'] = self.is_settled
        if self.settled_status is not None:
            result['settled_status'] = self.settled_status
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('channel_name') is not None:
            self.channel_name = m.get('channel_name')
        if m.get('is_settled') is not None:
            self.is_settled = m.get('is_settled')
        if m.get('settled_status') is not None:
            self.settled_status = m.get('settled_status')
        return self


class Commission(TeaModel):
    def __init__(
        self,
        status: int = None,
        begin_time: int = None,
        end_time: int = None,
        commission: str = None,
    ):
        # 要更新的手续费状态
        self.status = status
        # 手续费生效时间（时间戳 ms）
        self.begin_time = begin_time
        # 手续费结束时间
        self.end_time = end_time
        # 手续费
        self.commission = commission

    def validate(self):
        self.validate_required(self.status, 'status')
        self.validate_required(self.commission, 'commission')

    def to_map(self):
        result = dict()
        if self.status is not None:
            result['status'] = self.status
        if self.begin_time is not None:
            result['begin_time'] = self.begin_time
        if self.end_time is not None:
            result['end_time'] = self.end_time
        if self.commission is not None:
            result['commission'] = self.commission
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('status') is not None:
            self.status = m.get('status')
        if m.get('begin_time') is not None:
            self.begin_time = m.get('begin_time')
        if m.get('end_time') is not None:
            self.end_time = m.get('end_time')
        if m.get('commission') is not None:
            self.commission = m.get('commission')
        return self


class BlockConsumeCardInfo(TeaModel):
    def __init__(
        self,
        user_id: str = None,
        account_id: str = None,
        bank_name: str = None,
        bank_card_id: str = None,
        account_name: str = None,
        debit_amount: str = None,
        credit_amount: str = None,
        asset_map: str = None,
    ):
        # 外部系统对该个人/机构用户的内部编号,用于唯一识别该用户
        self.user_id = user_id
        # 用户的链上账户Id
        self.account_id = account_id
        # 开户行名称
        self.bank_name = bank_name
        # 消费卡开通绑定的银行卡卡号
        self.bank_card_id = bank_card_id
        # 开户名称
        self.account_name = account_name
        # 账户余额(元)
        self.debit_amount = debit_amount
        # 信用余额(元)
        self.credit_amount = credit_amount
        # 资产的来源<来源账户ID_余额/信用额, 数量>, 例如: "accountId1_Debit": 11000表示这笔资产来源于accountId1,是accountId1这个账户通过Debit余额发行的资产。
        self.asset_map = asset_map

    def validate(self):
        self.validate_required(self.user_id, 'user_id')
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.bank_name, 'bank_name')
        self.validate_required(self.bank_card_id, 'bank_card_id')
        self.validate_required(self.account_name, 'account_name')
        self.validate_required(self.debit_amount, 'debit_amount')
        self.validate_required(self.credit_amount, 'credit_amount')
        self.validate_required(self.asset_map, 'asset_map')

    def to_map(self):
        result = dict()
        if self.user_id is not None:
            result['user_id'] = self.user_id
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.bank_name is not None:
            result['bank_name'] = self.bank_name
        if self.bank_card_id is not None:
            result['bank_card_id'] = self.bank_card_id
        if self.account_name is not None:
            result['account_name'] = self.account_name
        if self.debit_amount is not None:
            result['debit_amount'] = self.debit_amount
        if self.credit_amount is not None:
            result['credit_amount'] = self.credit_amount
        if self.asset_map is not None:
            result['asset_map'] = self.asset_map
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('user_id') is not None:
            self.user_id = m.get('user_id')
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('bank_name') is not None:
            self.bank_name = m.get('bank_name')
        if m.get('bank_card_id') is not None:
            self.bank_card_id = m.get('bank_card_id')
        if m.get('account_name') is not None:
            self.account_name = m.get('account_name')
        if m.get('debit_amount') is not None:
            self.debit_amount = m.get('debit_amount')
        if m.get('credit_amount') is not None:
            self.credit_amount = m.get('credit_amount')
        if m.get('asset_map') is not None:
            self.asset_map = m.get('asset_map')
        return self


class IpSkuConfigWithLevel(TeaModel):
    def __init__(
        self,
        price_range: str = None,
        purchase_price: str = None,
        sale_num: int = None,
        ip_level: int = None,
    ):
        # 价格区间
        self.price_range = price_range
        # 单价
        self.purchase_price = purchase_price
        # 销售数量
        self.sale_num = sale_num
        # ip等级
        self.ip_level = ip_level

    def validate(self):
        self.validate_required(self.price_range, 'price_range')
        self.validate_required(self.purchase_price, 'purchase_price')
        self.validate_required(self.sale_num, 'sale_num')
        self.validate_required(self.ip_level, 'ip_level')

    def to_map(self):
        result = dict()
        if self.price_range is not None:
            result['price_range'] = self.price_range
        if self.purchase_price is not None:
            result['purchase_price'] = self.purchase_price
        if self.sale_num is not None:
            result['sale_num'] = self.sale_num
        if self.ip_level is not None:
            result['ip_level'] = self.ip_level
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('price_range') is not None:
            self.price_range = m.get('price_range')
        if m.get('purchase_price') is not None:
            self.purchase_price = m.get('purchase_price')
        if m.get('sale_num') is not None:
            self.sale_num = m.get('sale_num')
        if m.get('ip_level') is not None:
            self.ip_level = m.get('ip_level')
        return self


class MultiURL(TeaModel):
    def __init__(
        self,
        normal: str = None,
        style_200: str = None,
        style_150: str = None,
        style_70: str = None,
    ):
        # 上传的图片正常大小
        self.normal = normal
        # style200
        self.style_200 = style_200
        # style150
        self.style_150 = style_150
        # style70
        self.style_70 = style_70

    def validate(self):
        self.validate_required(self.normal, 'normal')
        self.validate_required(self.style_200, 'style_200')
        self.validate_required(self.style_150, 'style_150')
        self.validate_required(self.style_70, 'style_70')

    def to_map(self):
        result = dict()
        if self.normal is not None:
            result['normal'] = self.normal
        if self.style_200 is not None:
            result['style_200'] = self.style_200
        if self.style_150 is not None:
            result['style_150'] = self.style_150
        if self.style_70 is not None:
            result['style_70'] = self.style_70
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('normal') is not None:
            self.normal = m.get('normal')
        if m.get('style_200') is not None:
            self.style_200 = m.get('style_200')
        if m.get('style_150') is not None:
            self.style_150 = m.get('style_150')
        if m.get('style_70') is not None:
            self.style_70 = m.get('style_70')
        return self


class BaseRequest(TeaModel):
    def __init__(
        self,
        account_id: str = None,
        biz_id: str = None,
        chain_id: str = None,
        memo: str = None,
        product_code: str = None,
    ):
        # 用户的链上账户Id(长度不超过256个字符)
        self.account_id = account_id
        # 业务幂等Id,防止同一笔交易重复发送(长度不超过256个字符)
        self.biz_id = biz_id
        # 支持多链多合约,该参数为指明需要操作哪个智能合约环境(长度不超过50个字符)
        self.chain_id = chain_id
        # 备注信息(不要超过500个字符)。
        # 部分接口要求memo必填，以接口返回信息为准。
        self.memo = memo
        # 场景码(入驻时申请)(长度不超过50个字符)
        self.product_code = product_code

    def validate(self):
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.biz_id, 'biz_id')
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.product_code, 'product_code')

    def to_map(self):
        result = dict()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.biz_id is not None:
            result['biz_id'] = self.biz_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.memo is not None:
            result['memo'] = self.memo
        if self.product_code is not None:
            result['product_code'] = self.product_code
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('biz_id') is not None:
            self.biz_id = m.get('biz_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('product_code') is not None:
            self.product_code = m.get('product_code')
        return self


class ValueAddedServiceInfoWithSku(TeaModel):
    def __init__(
        self,
        add_value_info: ValueAddedServiceInfo = None,
        skus: List[IpSkuEmphasisInfo] = None,
    ):
        # 增值服务信息
        self.add_value_info = add_value_info
        # sku信息
        self.skus = skus

    def validate(self):
        self.validate_required(self.add_value_info, 'add_value_info')
        if self.add_value_info:
            self.add_value_info.validate()
        self.validate_required(self.skus, 'skus')
        if self.skus:
            for k in self.skus:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.add_value_info is not None:
            result['add_value_info'] = self.add_value_info.to_map()
        result['skus'] = []
        if self.skus is not None:
            for k in self.skus:
                result['skus'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('add_value_info') is not None:
            temp_model = ValueAddedServiceInfo()
            self.add_value_info = temp_model.from_map(m['add_value_info'])
        self.skus = []
        if m.get('skus') is not None:
            for k in m.get('skus'):
                temp_model = IpSkuEmphasisInfo()
                self.skus.append(temp_model.from_map(k))
        return self


class Transaction(TeaModel):
    def __init__(
        self,
        data: str = None,
        from_: str = None,
        hash: str = None,
        nonce: int = None,
        period: int = None,
        public_key: str = None,
        signature: str = None,
        timestamp: int = None,
        to: str = None,
    ):
        # 交易数据，转换位十六进制
        self.data = data
        # 卡密管理员链上ID，64位十六进制。
        self.from_ = from_
        # 交易hash，十六进制编码
        self.hash = hash
        # 交易随机数
        self.nonce = nonce
        # 交易时间
        self.period = period
        # from账户对应的公钥，128位十六进制。
        self.public_key = public_key
        # 交易签名，十六进制编码
        self.signature = signature
        # 交易时间戳
        self.timestamp = timestamp
        # 交易目标地址，64位十六进制。
        self.to = to

    def validate(self):
        self.validate_required(self.data, 'data')
        self.validate_required(self.from_, 'from_')
        self.validate_required(self.hash, 'hash')
        self.validate_required(self.nonce, 'nonce')
        self.validate_required(self.period, 'period')
        self.validate_required(self.public_key, 'public_key')
        self.validate_required(self.signature, 'signature')
        self.validate_required(self.timestamp, 'timestamp')
        self.validate_required(self.to, 'to')

    def to_map(self):
        result = dict()
        if self.data is not None:
            result['data'] = self.data
        if self.from_ is not None:
            result['from'] = self.from_
        if self.hash is not None:
            result['hash'] = self.hash
        if self.nonce is not None:
            result['nonce'] = self.nonce
        if self.period is not None:
            result['period'] = self.period
        if self.public_key is not None:
            result['public_key'] = self.public_key
        if self.signature is not None:
            result['signature'] = self.signature
        if self.timestamp is not None:
            result['timestamp'] = self.timestamp
        if self.to is not None:
            result['to'] = self.to
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('data') is not None:
            self.data = m.get('data')
        if m.get('from') is not None:
            self.from_ = m.get('from')
        if m.get('hash') is not None:
            self.hash = m.get('hash')
        if m.get('nonce') is not None:
            self.nonce = m.get('nonce')
        if m.get('period') is not None:
            self.period = m.get('period')
        if m.get('public_key') is not None:
            self.public_key = m.get('public_key')
        if m.get('signature') is not None:
            self.signature = m.get('signature')
        if m.get('timestamp') is not None:
            self.timestamp = m.get('timestamp')
        if m.get('to') is not None:
            self.to = m.get('to')
        return self


class DiscreteValue(TeaModel):
    def __init__(
        self,
        sort_id: int = None,
        text: str = None,
        value: str = None,
    ):
        # 序号
        self.sort_id = sort_id
        # 文本信息
        self.text = text
        # 文本值
        self.value = value

    def validate(self):
        self.validate_required(self.sort_id, 'sort_id')
        self.validate_required(self.text, 'text')
        self.validate_required(self.value, 'value')

    def to_map(self):
        result = dict()
        if self.sort_id is not None:
            result['sort_id'] = self.sort_id
        if self.text is not None:
            result['text'] = self.text
        if self.value is not None:
            result['value'] = self.value
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('sort_id') is not None:
            self.sort_id = m.get('sort_id')
        if m.get('text') is not None:
            self.text = m.get('text')
        if m.get('value') is not None:
            self.value = m.get('value')
        return self


class BaseResponseData(TeaModel):
    def __init__(
        self,
        block_number: int = None,
        out_biz_id: str = None,
        tx_hash: str = None,
    ):
        # 区块链交易执行的区块高度
        self.block_number = block_number
        # 交易的业务幂等Id,与交易发起时外部传入的一致
        self.out_biz_id = out_biz_id
        # 区块链交易执行的哈希
        self.tx_hash = tx_hash

    def validate(self):
        self.validate_required(self.block_number, 'block_number')
        self.validate_required(self.out_biz_id, 'out_biz_id')
        self.validate_required(self.tx_hash, 'tx_hash')

    def to_map(self):
        result = dict()
        if self.block_number is not None:
            result['block_number'] = self.block_number
        if self.out_biz_id is not None:
            result['out_biz_id'] = self.out_biz_id
        if self.tx_hash is not None:
            result['tx_hash'] = self.tx_hash
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('block_number') is not None:
            self.block_number = m.get('block_number')
        if m.get('out_biz_id') is not None:
            self.out_biz_id = m.get('out_biz_id')
        if m.get('tx_hash') is not None:
            self.tx_hash = m.get('tx_hash')
        return self


class IPGalleryInstruction(TeaModel):
    def __init__(
        self,
        timestamp: int = None,
        ip_order_id: str = None,
        ip_id: str = None,
        ip_gallery_url: str = None,
        ip_gallery_temporary_url: str = None,
        ip_gallery_version: int = None,
        ip_gallery_status: int = None,
        ext_info: str = None,
    ):
        # 下载时间
        self.timestamp = timestamp
        # 授权订单ID
        self.ip_order_id = ip_order_id
        # IP链上ID
        self.ip_id = ip_id
        # 图库链接
        self.ip_gallery_url = ip_gallery_url
        # 图库下载链接，默认过期时间2小时
        self.ip_gallery_temporary_url = ip_gallery_temporary_url
        # 图库版本
        self.ip_gallery_version = ip_gallery_version
        # IP当前图库状态：0 生效中，1 已失效
        self.ip_gallery_status = ip_gallery_status
        # 备注信息
        self.ext_info = ext_info

    def validate(self):
        self.validate_required(self.timestamp, 'timestamp')
        self.validate_required(self.ip_order_id, 'ip_order_id')
        self.validate_required(self.ip_id, 'ip_id')
        self.validate_required(self.ip_gallery_url, 'ip_gallery_url')
        self.validate_required(self.ip_gallery_temporary_url, 'ip_gallery_temporary_url')
        self.validate_required(self.ip_gallery_version, 'ip_gallery_version')
        self.validate_required(self.ip_gallery_status, 'ip_gallery_status')

    def to_map(self):
        result = dict()
        if self.timestamp is not None:
            result['timestamp'] = self.timestamp
        if self.ip_order_id is not None:
            result['ip_order_id'] = self.ip_order_id
        if self.ip_id is not None:
            result['ip_id'] = self.ip_id
        if self.ip_gallery_url is not None:
            result['ip_gallery_url'] = self.ip_gallery_url
        if self.ip_gallery_temporary_url is not None:
            result['ip_gallery_temporary_url'] = self.ip_gallery_temporary_url
        if self.ip_gallery_version is not None:
            result['ip_gallery_version'] = self.ip_gallery_version
        if self.ip_gallery_status is not None:
            result['ip_gallery_status'] = self.ip_gallery_status
        if self.ext_info is not None:
            result['ext_info'] = self.ext_info
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('timestamp') is not None:
            self.timestamp = m.get('timestamp')
        if m.get('ip_order_id') is not None:
            self.ip_order_id = m.get('ip_order_id')
        if m.get('ip_id') is not None:
            self.ip_id = m.get('ip_id')
        if m.get('ip_gallery_url') is not None:
            self.ip_gallery_url = m.get('ip_gallery_url')
        if m.get('ip_gallery_temporary_url') is not None:
            self.ip_gallery_temporary_url = m.get('ip_gallery_temporary_url')
        if m.get('ip_gallery_version') is not None:
            self.ip_gallery_version = m.get('ip_gallery_version')
        if m.get('ip_gallery_status') is not None:
            self.ip_gallery_status = m.get('ip_gallery_status')
        if m.get('ext_info') is not None:
            self.ext_info = m.get('ext_info')
        return self


class Block(TeaModel):
    def __init__(
        self,
        header: BlockHeader = None,
        body: BlockBody = None,
    ):
        # 区块头
        self.header = header
        # 区块体
        self.body = body

    def validate(self):
        self.validate_required(self.header, 'header')
        if self.header:
            self.header.validate()
        self.validate_required(self.body, 'body')
        if self.body:
            self.body.validate()

    def to_map(self):
        result = dict()
        if self.header is not None:
            result['header'] = self.header.to_map()
        if self.body is not None:
            result['body'] = self.body.to_map()
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('header') is not None:
            temp_model = BlockHeader()
            self.header = temp_model.from_map(m['header'])
        if m.get('body') is not None:
            temp_model = BlockBody()
            self.body = temp_model.from_map(m['body'])
        return self


class SkuWithLevel(TeaModel):
    def __init__(self):
        pass

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        return self


class IpBasicInfoWithUpdate(TeaModel):
    def __init__(
        self,
        ip_basic_info: IpBasicInfo = None,
        is_update: bool = None,
    ):
        # 基础信息
        self.ip_basic_info = ip_basic_info
        # 是否有更新
        self.is_update = is_update

    def validate(self):
        self.validate_required(self.ip_basic_info, 'ip_basic_info')
        if self.ip_basic_info:
            self.ip_basic_info.validate()
        self.validate_required(self.is_update, 'is_update')

    def to_map(self):
        result = dict()
        if self.ip_basic_info is not None:
            result['ip_basic_info'] = self.ip_basic_info.to_map()
        if self.is_update is not None:
            result['is_update'] = self.is_update
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('ip_basic_info') is not None:
            temp_model = IpBasicInfo()
            self.ip_basic_info = temp_model.from_map(m['ip_basic_info'])
        if m.get('is_update') is not None:
            self.is_update = m.get('is_update')
        return self


class BaseRequestInfo(TeaModel):
    def __init__(
        self,
        biz_id: str = None,
        chain_id: str = None,
        product_code: str = None,
    ):
        # 业务幂等Id,防止同一笔交易重复发送(长度不超过256个字符)
        self.biz_id = biz_id
        # 支持多链多合约,该参数为指明需要操作哪个智能合约环境(长度不超过50个字符)
        self.chain_id = chain_id
        # 场景码(入驻时申请)(长度不超过50个字符)
        self.product_code = product_code

    def validate(self):
        self.validate_required(self.biz_id, 'biz_id')
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.product_code, 'product_code')

    def to_map(self):
        result = dict()
        if self.biz_id is not None:
            result['biz_id'] = self.biz_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.product_code is not None:
            result['product_code'] = self.product_code
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('biz_id') is not None:
            self.biz_id = m.get('biz_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('product_code') is not None:
            self.product_code = m.get('product_code')
        return self


class AccountSettlementInfo(TeaModel):
    def __init__(
        self,
        account_id: str = None,
        account_name: str = None,
        settled_status: str = None,
        contact_name: str = None,
        contact_mobile: str = None,
        contact_phone: str = None,
        apply_time: int = None,
    ):
        # 账户id
        self.account_id = account_id
        # 版权方名字
        self.account_name = account_name
        # WAIT_CHECK:渠道已申请开通但未审核，SUCCESS，审核成功
        self.settled_status = settled_status
        # 版权方联系人名字
        self.contact_name = contact_name
        # 版权方联系人手机
        self.contact_mobile = contact_mobile
        # 版权方联系人手机号
        self.contact_phone = contact_phone
        # 申请入驻时间
        self.apply_time = apply_time

    def validate(self):
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.account_name, 'account_name')
        self.validate_required(self.settled_status, 'settled_status')
        self.validate_required(self.contact_phone, 'contact_phone')
        self.validate_required(self.apply_time, 'apply_time')

    def to_map(self):
        result = dict()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.account_name is not None:
            result['account_name'] = self.account_name
        if self.settled_status is not None:
            result['settled_status'] = self.settled_status
        if self.contact_name is not None:
            result['contact_name'] = self.contact_name
        if self.contact_mobile is not None:
            result['contact_mobile'] = self.contact_mobile
        if self.contact_phone is not None:
            result['contact_phone'] = self.contact_phone
        if self.apply_time is not None:
            result['apply_time'] = self.apply_time
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('account_name') is not None:
            self.account_name = m.get('account_name')
        if m.get('settled_status') is not None:
            self.settled_status = m.get('settled_status')
        if m.get('contact_name') is not None:
            self.contact_name = m.get('contact_name')
        if m.get('contact_mobile') is not None:
            self.contact_mobile = m.get('contact_mobile')
        if m.get('contact_phone') is not None:
            self.contact_phone = m.get('contact_phone')
        if m.get('apply_time') is not None:
            self.apply_time = m.get('apply_time')
        return self


class ExchangeableEquityList(TeaModel):
    def __init__(
        self,
        end_row: int = None,
        equity_list: List[EquityDetail] = None,
        first_page: int = None,
        has_next_page: bool = None,
        has_previous_page: bool = None,
        is_first_page: bool = None,
        is_last_page: bool = None,
        last_page: int = None,
        next_page: int = None,
        order_by: str = None,
        pages: int = None,
        page_number: int = None,
        page_size: int = None,
        pre_page: int = None,
        size: int = None,
        start_row: int = None,
        total: int = None,
    ):
        # 页面上数据在总数据中的结束位置（第几个数据）
        self.end_row = end_row
        # 权益信息列表
        self.equity_list = equity_list
        # 第一页页码
        self.first_page = first_page
        # 是否有下一页
        self.has_next_page = has_next_page
        # 是否有前一页
        self.has_previous_page = has_previous_page
        # 是否第一页
        self.is_first_page = is_first_page
        # 是否最后一页
        self.is_last_page = is_last_page
        # 最后一页页码
        self.last_page = last_page
        # 下一页页码
        self.next_page = next_page
        # 排序规则
        self.order_by = order_by
        # 可兑换的权益总页数
        self.pages = pages
        # 当前页码
        self.page_number = page_number
        # 页面大小
        self.page_size = page_size
        # 前一页页码
        self.pre_page = pre_page
        # 页面中实际数量
        self.size = size
        # 页面上数据在总数据中的开始位置（第几个数据）
        self.start_row = start_row
        # 可兑换的权益总数
        self.total = total

    def validate(self):
        self.validate_required(self.end_row, 'end_row')
        self.validate_required(self.equity_list, 'equity_list')
        if self.equity_list:
            for k in self.equity_list:
                if k:
                    k.validate()
        self.validate_required(self.first_page, 'first_page')
        self.validate_required(self.has_next_page, 'has_next_page')
        self.validate_required(self.has_previous_page, 'has_previous_page')
        self.validate_required(self.is_first_page, 'is_first_page')
        self.validate_required(self.is_last_page, 'is_last_page')
        self.validate_required(self.last_page, 'last_page')
        self.validate_required(self.next_page, 'next_page')
        self.validate_required(self.order_by, 'order_by')
        self.validate_required(self.pages, 'pages')
        self.validate_required(self.page_number, 'page_number')
        self.validate_required(self.page_size, 'page_size')
        self.validate_required(self.pre_page, 'pre_page')
        self.validate_required(self.size, 'size')
        self.validate_required(self.start_row, 'start_row')
        self.validate_required(self.total, 'total')

    def to_map(self):
        result = dict()
        if self.end_row is not None:
            result['end_row'] = self.end_row
        result['equity_list'] = []
        if self.equity_list is not None:
            for k in self.equity_list:
                result['equity_list'].append(k.to_map() if k else None)
        if self.first_page is not None:
            result['first_page'] = self.first_page
        if self.has_next_page is not None:
            result['has_next_page'] = self.has_next_page
        if self.has_previous_page is not None:
            result['has_previous_page'] = self.has_previous_page
        if self.is_first_page is not None:
            result['is_first_page'] = self.is_first_page
        if self.is_last_page is not None:
            result['is_last_page'] = self.is_last_page
        if self.last_page is not None:
            result['last_page'] = self.last_page
        if self.next_page is not None:
            result['next_page'] = self.next_page
        if self.order_by is not None:
            result['order_by'] = self.order_by
        if self.pages is not None:
            result['pages'] = self.pages
        if self.page_number is not None:
            result['page_number'] = self.page_number
        if self.page_size is not None:
            result['page_size'] = self.page_size
        if self.pre_page is not None:
            result['pre_page'] = self.pre_page
        if self.size is not None:
            result['size'] = self.size
        if self.start_row is not None:
            result['start_row'] = self.start_row
        if self.total is not None:
            result['total'] = self.total
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('end_row') is not None:
            self.end_row = m.get('end_row')
        self.equity_list = []
        if m.get('equity_list') is not None:
            for k in m.get('equity_list'):
                temp_model = EquityDetail()
                self.equity_list.append(temp_model.from_map(k))
        if m.get('first_page') is not None:
            self.first_page = m.get('first_page')
        if m.get('has_next_page') is not None:
            self.has_next_page = m.get('has_next_page')
        if m.get('has_previous_page') is not None:
            self.has_previous_page = m.get('has_previous_page')
        if m.get('is_first_page') is not None:
            self.is_first_page = m.get('is_first_page')
        if m.get('is_last_page') is not None:
            self.is_last_page = m.get('is_last_page')
        if m.get('last_page') is not None:
            self.last_page = m.get('last_page')
        if m.get('next_page') is not None:
            self.next_page = m.get('next_page')
        if m.get('order_by') is not None:
            self.order_by = m.get('order_by')
        if m.get('pages') is not None:
            self.pages = m.get('pages')
        if m.get('page_number') is not None:
            self.page_number = m.get('page_number')
        if m.get('page_size') is not None:
            self.page_size = m.get('page_size')
        if m.get('pre_page') is not None:
            self.pre_page = m.get('pre_page')
        if m.get('size') is not None:
            self.size = m.get('size')
        if m.get('start_row') is not None:
            self.start_row = m.get('start_row')
        if m.get('total') is not None:
            self.total = m.get('total')
        return self


class ChannelCounter(TeaModel):
    def __init__(
        self,
        channel_name: str = None,
        counter: int = None,
        month: str = None,
        total_price: str = None,
    ):
        # 渠道名字
        self.channel_name = channel_name
        # 统计值
        self.counter = counter
        # 月份。如果月份有具体值则数据为该月份数据，月份为空则为全部统计数据。
        self.month = month
        # 渠道交易金额
        self.total_price = total_price

    def validate(self):
        self.validate_required(self.channel_name, 'channel_name')
        self.validate_required(self.counter, 'counter')

    def to_map(self):
        result = dict()
        if self.channel_name is not None:
            result['channel_name'] = self.channel_name
        if self.counter is not None:
            result['counter'] = self.counter
        if self.month is not None:
            result['month'] = self.month
        if self.total_price is not None:
            result['total_price'] = self.total_price
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('channel_name') is not None:
            self.channel_name = m.get('channel_name')
        if m.get('counter') is not None:
            self.counter = m.get('counter')
        if m.get('month') is not None:
            self.month = m.get('month')
        if m.get('total_price') is not None:
            self.total_price = m.get('total_price')
        return self


class CommissionResult(TeaModel):
    def __init__(
        self,
        begin_time: int = None,
        commission: str = None,
        commission_id: str = None,
        commission_status: int = None,
        end_time: int = None,
        equity_type: int = None,
        tenant_id: str = None,
        commission_sub_id: str = None,
    ):
        # 手续费生效时间
        self.begin_time = begin_time
        # 手续费
        self.commission = commission
        # 手续费信息ID
        self.commission_id = commission_id
        # 手续费状态（0可用，1停用，2禁用）
        self.commission_status = commission_status
        # 手续费失效时间
        self.end_time = end_time
        # 商品类型
        self.equity_type = equity_type
        # 租户ID
        self.tenant_id = tenant_id
        # 手续费信息ID
        self.commission_sub_id = commission_sub_id

    def validate(self):
        self.validate_required(self.begin_time, 'begin_time')
        self.validate_required(self.commission, 'commission')
        self.validate_required(self.commission_id, 'commission_id')
        self.validate_required(self.commission_status, 'commission_status')
        self.validate_required(self.end_time, 'end_time')
        self.validate_required(self.equity_type, 'equity_type')
        self.validate_required(self.tenant_id, 'tenant_id')
        self.validate_required(self.commission_sub_id, 'commission_sub_id')

    def to_map(self):
        result = dict()
        if self.begin_time is not None:
            result['begin_time'] = self.begin_time
        if self.commission is not None:
            result['commission'] = self.commission
        if self.commission_id is not None:
            result['commission_id'] = self.commission_id
        if self.commission_status is not None:
            result['commission_status'] = self.commission_status
        if self.end_time is not None:
            result['end_time'] = self.end_time
        if self.equity_type is not None:
            result['equity_type'] = self.equity_type
        if self.tenant_id is not None:
            result['tenant_id'] = self.tenant_id
        if self.commission_sub_id is not None:
            result['commission_sub_id'] = self.commission_sub_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('begin_time') is not None:
            self.begin_time = m.get('begin_time')
        if m.get('commission') is not None:
            self.commission = m.get('commission')
        if m.get('commission_id') is not None:
            self.commission_id = m.get('commission_id')
        if m.get('commission_status') is not None:
            self.commission_status = m.get('commission_status')
        if m.get('end_time') is not None:
            self.end_time = m.get('end_time')
        if m.get('equity_type') is not None:
            self.equity_type = m.get('equity_type')
        if m.get('tenant_id') is not None:
            self.tenant_id = m.get('tenant_id')
        if m.get('commission_sub_id') is not None:
            self.commission_sub_id = m.get('commission_sub_id')
        return self


class CommissionRule(TeaModel):
    def __init__(
        self,
        account_id: str = None,
        commission_period: CommissionPeriod = None,
    ):
        # 一级分账方的账户ID
        self.account_id = account_id
        # 手续费规则
        self.commission_period = commission_period

    def validate(self):
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.commission_period, 'commission_period')
        if self.commission_period:
            self.commission_period.validate()

    def to_map(self):
        result = dict()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.commission_period is not None:
            result['commission_period'] = self.commission_period.to_map()
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('commission_period') is not None:
            temp_model = CommissionPeriod()
            self.commission_period = temp_model.from_map(m['commission_period'])
        return self


class UserPriceEquity(TeaModel):
    def __init__(
        self,
        admin_id: str = None,
        auth_type: int = None,
        currency: str = None,
        default_price: str = None,
        description: str = None,
        desc_images: str = None,
        equity_d: str = None,
        equity_name: str = None,
        equity_type: int = None,
        images: str = None,
        is_public: bool = None,
        limit_per_merchant_and_day: int = None,
        limit_per_merchant_and_month: int = None,
        limit_per_user_and_day: int = None,
        limit_per_user_and_month: int = None,
        memo: str = None,
        open_to_tenant_id: str = None,
        price: str = None,
        ratio: str = None,
        snapshot_tenant_price: str = None,
        status: int = None,
        tenant_id: str = None,
        total_count: str = None,
        user_price_type: int = None,
        use_valid_not_after: int = None,
        use_valid_not_before: int = None,
        valid_not_after: int = None,
        valid_not_before: int = None,
        value: str = None,
    ):
        # 权益提供商商户ID
        self.admin_id = admin_id
        # 授权类型
        self.auth_type = auth_type
        # 币种
        self.currency = currency
        # 默认价格
        self.default_price = default_price
        # 权益描述
        self.description = description
        # 权益描述图片
        self.desc_images = desc_images
        # 权益ID
        self.equity_d = equity_d
        # 权益名称
        self.equity_name = equity_name
        # 权益类型
        self.equity_type = equity_type
        # 权益主图片
        self.images = images
        # 是否公开权益
        self.is_public = is_public
        # 商户每日兑换上线
        self.limit_per_merchant_and_day = limit_per_merchant_and_day
        # 商户每月兑换上线
        self.limit_per_merchant_and_month = limit_per_merchant_and_month
        # 用户每日兑换上线
        self.limit_per_user_and_day = limit_per_user_and_day
        # 用户每月兑换上限
        self.limit_per_user_and_month = limit_per_user_and_month
        # 权益附言信息
        self.memo = memo
        # 授权的租户ID
        self.open_to_tenant_id = open_to_tenant_id
        # 用户价格
        self.price = price
        # 用户价格比例
        self.ratio = ratio
        # 快照租户价格
        self.snapshot_tenant_price = snapshot_tenant_price
        # 权益状态
        self.status = status
        # 权益提供商租户ID
        self.tenant_id = tenant_id
        # 权益库存
        self.total_count = total_count
        # 用户价格类型
        self.user_price_type = user_price_type
        # 可用右区间
        self.use_valid_not_after = use_valid_not_after
        # 可用左区间
        self.use_valid_not_before = use_valid_not_before
        # 有效右区间
        self.valid_not_after = valid_not_after
        # 有效左区间
        self.valid_not_before = valid_not_before
        # 价值
        self.value = value

    def validate(self):
        self.validate_required(self.admin_id, 'admin_id')
        self.validate_required(self.auth_type, 'auth_type')
        self.validate_required(self.currency, 'currency')
        self.validate_required(self.default_price, 'default_price')
        self.validate_required(self.description, 'description')
        self.validate_required(self.desc_images, 'desc_images')
        self.validate_required(self.equity_d, 'equity_d')
        self.validate_required(self.equity_name, 'equity_name')
        self.validate_required(self.equity_type, 'equity_type')
        self.validate_required(self.images, 'images')
        self.validate_required(self.is_public, 'is_public')
        self.validate_required(self.limit_per_merchant_and_day, 'limit_per_merchant_and_day')
        self.validate_required(self.limit_per_merchant_and_month, 'limit_per_merchant_and_month')
        self.validate_required(self.limit_per_user_and_day, 'limit_per_user_and_day')
        self.validate_required(self.limit_per_user_and_month, 'limit_per_user_and_month')
        self.validate_required(self.memo, 'memo')
        self.validate_required(self.open_to_tenant_id, 'open_to_tenant_id')
        self.validate_required(self.price, 'price')
        self.validate_required(self.ratio, 'ratio')
        self.validate_required(self.snapshot_tenant_price, 'snapshot_tenant_price')
        self.validate_required(self.status, 'status')
        self.validate_required(self.tenant_id, 'tenant_id')
        self.validate_required(self.total_count, 'total_count')
        self.validate_required(self.user_price_type, 'user_price_type')
        self.validate_required(self.use_valid_not_after, 'use_valid_not_after')
        self.validate_required(self.use_valid_not_before, 'use_valid_not_before')
        self.validate_required(self.valid_not_after, 'valid_not_after')
        self.validate_required(self.valid_not_before, 'valid_not_before')
        self.validate_required(self.value, 'value')

    def to_map(self):
        result = dict()
        if self.admin_id is not None:
            result['admin_id'] = self.admin_id
        if self.auth_type is not None:
            result['auth_type'] = self.auth_type
        if self.currency is not None:
            result['currency'] = self.currency
        if self.default_price is not None:
            result['default_price'] = self.default_price
        if self.description is not None:
            result['description'] = self.description
        if self.desc_images is not None:
            result['desc_images'] = self.desc_images
        if self.equity_d is not None:
            result['equity_d'] = self.equity_d
        if self.equity_name is not None:
            result['equity_name'] = self.equity_name
        if self.equity_type is not None:
            result['equity_type'] = self.equity_type
        if self.images is not None:
            result['images'] = self.images
        if self.is_public is not None:
            result['is_public'] = self.is_public
        if self.limit_per_merchant_and_day is not None:
            result['limit_per_merchant_and_day'] = self.limit_per_merchant_and_day
        if self.limit_per_merchant_and_month is not None:
            result['limit_per_merchant_and_month'] = self.limit_per_merchant_and_month
        if self.limit_per_user_and_day is not None:
            result['limit_per_user_and_day'] = self.limit_per_user_and_day
        if self.limit_per_user_and_month is not None:
            result['limit_per_user_and_month'] = self.limit_per_user_and_month
        if self.memo is not None:
            result['memo'] = self.memo
        if self.open_to_tenant_id is not None:
            result['open_to_tenant_id'] = self.open_to_tenant_id
        if self.price is not None:
            result['price'] = self.price
        if self.ratio is not None:
            result['ratio'] = self.ratio
        if self.snapshot_tenant_price is not None:
            result['snapshot_tenant_price'] = self.snapshot_tenant_price
        if self.status is not None:
            result['status'] = self.status
        if self.tenant_id is not None:
            result['tenant_id'] = self.tenant_id
        if self.total_count is not None:
            result['total_count'] = self.total_count
        if self.user_price_type is not None:
            result['user_price_type'] = self.user_price_type
        if self.use_valid_not_after is not None:
            result['use_valid_not_after'] = self.use_valid_not_after
        if self.use_valid_not_before is not None:
            result['use_valid_not_before'] = self.use_valid_not_before
        if self.valid_not_after is not None:
            result['valid_not_after'] = self.valid_not_after
        if self.valid_not_before is not None:
            result['valid_not_before'] = self.valid_not_before
        if self.value is not None:
            result['value'] = self.value
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('admin_id') is not None:
            self.admin_id = m.get('admin_id')
        if m.get('auth_type') is not None:
            self.auth_type = m.get('auth_type')
        if m.get('currency') is not None:
            self.currency = m.get('currency')
        if m.get('default_price') is not None:
            self.default_price = m.get('default_price')
        if m.get('description') is not None:
            self.description = m.get('description')
        if m.get('desc_images') is not None:
            self.desc_images = m.get('desc_images')
        if m.get('equity_d') is not None:
            self.equity_d = m.get('equity_d')
        if m.get('equity_name') is not None:
            self.equity_name = m.get('equity_name')
        if m.get('equity_type') is not None:
            self.equity_type = m.get('equity_type')
        if m.get('images') is not None:
            self.images = m.get('images')
        if m.get('is_public') is not None:
            self.is_public = m.get('is_public')
        if m.get('limit_per_merchant_and_day') is not None:
            self.limit_per_merchant_and_day = m.get('limit_per_merchant_and_day')
        if m.get('limit_per_merchant_and_month') is not None:
            self.limit_per_merchant_and_month = m.get('limit_per_merchant_and_month')
        if m.get('limit_per_user_and_day') is not None:
            self.limit_per_user_and_day = m.get('limit_per_user_and_day')
        if m.get('limit_per_user_and_month') is not None:
            self.limit_per_user_and_month = m.get('limit_per_user_and_month')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('open_to_tenant_id') is not None:
            self.open_to_tenant_id = m.get('open_to_tenant_id')
        if m.get('price') is not None:
            self.price = m.get('price')
        if m.get('ratio') is not None:
            self.ratio = m.get('ratio')
        if m.get('snapshot_tenant_price') is not None:
            self.snapshot_tenant_price = m.get('snapshot_tenant_price')
        if m.get('status') is not None:
            self.status = m.get('status')
        if m.get('tenant_id') is not None:
            self.tenant_id = m.get('tenant_id')
        if m.get('total_count') is not None:
            self.total_count = m.get('total_count')
        if m.get('user_price_type') is not None:
            self.user_price_type = m.get('user_price_type')
        if m.get('use_valid_not_after') is not None:
            self.use_valid_not_after = m.get('use_valid_not_after')
        if m.get('use_valid_not_before') is not None:
            self.use_valid_not_before = m.get('use_valid_not_before')
        if m.get('valid_not_after') is not None:
            self.valid_not_after = m.get('valid_not_after')
        if m.get('valid_not_before') is not None:
            self.valid_not_before = m.get('valid_not_before')
        if m.get('value') is not None:
            self.value = m.get('value')
        return self


class IPMerchantApplyInfo(TeaModel):
    def __init__(
        self,
        account_id: str = None,
        alipay_login_name: str = None,
        merchant_alias_name: str = None,
        merchant_type: int = None,
        merchant_cert_type: int = None,
        merchant_cert_number: str = None,
        merchant_cert_image: str = None,
        merchant_sign_image: str = None,
        mcc: str = None,
        legal_name: str = None,
        legal_cert_no: str = None,
        address_info: IPAddressInfo = None,
        settle_rule: IPSettleRule = None,
        contact_info: IPContactInfo = None,
        card_info: IPCardInfo = None,
    ):
        # 链上账户Id
        self.account_id = account_id
        # 支付宝的登陆用户名(必须实名制)
        self.alipay_login_name = alipay_login_name
        # 商户别名, 会展示在账单以及支付结果页中
        self.merchant_alias_name = merchant_alias_name
        # 商户类型(本期仅支持: 1:企业, 6:个人商户)
        self.merchant_type = merchant_type
        # 商户证件类型(本期仅支持: 201: 营业执照, 100: 个人商户身份证) 如果merchant_type为企业, 需要传入201; 如果merchant_type为个人, 需要传入100
        self.merchant_cert_type = merchant_cert_type
        # 商户证件编号(企业提供营业执照),本期人工审核
        self.merchant_cert_number = merchant_cert_number
        # 商户营业执照的图片地址,本期人工审核
        self.merchant_cert_image = merchant_cert_image
        # 税务登记证明的图片,本期人工审核
        self.merchant_sign_image = merchant_sign_image
        # 商户类别码mcc，参见https://gw.alipayobjects.com/os/bmw-prod/05c9a32e-42d1-436b-ace7-13101d91f672.xlsx
        self.mcc = mcc
        # 商户法人名称, merchant_type = 01时必填
        # 
        self.legal_name = legal_name
        # 商户法人身份证号码, merchant_type = 1时必填
        # 
        self.legal_cert_no = legal_cert_no
        # 商户经营地址
        # 
        self.address_info = address_info
        # 默认结算规则
        # 
        self.settle_rule = settle_rule
        # 商户联系人信息
        # 
        self.contact_info = contact_info
        # 银行卡结算信息, 结算到银行卡时必填, 当前仅支持填入一张卡
        # 
        self.card_info = card_info

    def validate(self):
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.alipay_login_name, 'alipay_login_name')
        self.validate_required(self.merchant_alias_name, 'merchant_alias_name')
        self.validate_required(self.merchant_type, 'merchant_type')
        self.validate_required(self.merchant_cert_type, 'merchant_cert_type')
        self.validate_required(self.merchant_cert_number, 'merchant_cert_number')
        self.validate_required(self.merchant_cert_image, 'merchant_cert_image')
        self.validate_required(self.merchant_sign_image, 'merchant_sign_image')
        self.validate_required(self.mcc, 'mcc')
        self.validate_required(self.legal_name, 'legal_name')
        self.validate_required(self.legal_cert_no, 'legal_cert_no')
        self.validate_required(self.address_info, 'address_info')
        if self.address_info:
            self.address_info.validate()
        self.validate_required(self.settle_rule, 'settle_rule')
        if self.settle_rule:
            self.settle_rule.validate()
        self.validate_required(self.contact_info, 'contact_info')
        if self.contact_info:
            self.contact_info.validate()
        self.validate_required(self.card_info, 'card_info')
        if self.card_info:
            self.card_info.validate()

    def to_map(self):
        result = dict()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.alipay_login_name is not None:
            result['alipay_login_name'] = self.alipay_login_name
        if self.merchant_alias_name is not None:
            result['merchant_alias_name'] = self.merchant_alias_name
        if self.merchant_type is not None:
            result['merchant_type'] = self.merchant_type
        if self.merchant_cert_type is not None:
            result['merchant_cert_type'] = self.merchant_cert_type
        if self.merchant_cert_number is not None:
            result['merchant_cert_number'] = self.merchant_cert_number
        if self.merchant_cert_image is not None:
            result['merchant_cert_image'] = self.merchant_cert_image
        if self.merchant_sign_image is not None:
            result['merchant_sign_image'] = self.merchant_sign_image
        if self.mcc is not None:
            result['mcc'] = self.mcc
        if self.legal_name is not None:
            result['legal_name'] = self.legal_name
        if self.legal_cert_no is not None:
            result['legal_cert_no'] = self.legal_cert_no
        if self.address_info is not None:
            result['address_info'] = self.address_info.to_map()
        if self.settle_rule is not None:
            result['settle_rule'] = self.settle_rule.to_map()
        if self.contact_info is not None:
            result['contact_info'] = self.contact_info.to_map()
        if self.card_info is not None:
            result['card_info'] = self.card_info.to_map()
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('alipay_login_name') is not None:
            self.alipay_login_name = m.get('alipay_login_name')
        if m.get('merchant_alias_name') is not None:
            self.merchant_alias_name = m.get('merchant_alias_name')
        if m.get('merchant_type') is not None:
            self.merchant_type = m.get('merchant_type')
        if m.get('merchant_cert_type') is not None:
            self.merchant_cert_type = m.get('merchant_cert_type')
        if m.get('merchant_cert_number') is not None:
            self.merchant_cert_number = m.get('merchant_cert_number')
        if m.get('merchant_cert_image') is not None:
            self.merchant_cert_image = m.get('merchant_cert_image')
        if m.get('merchant_sign_image') is not None:
            self.merchant_sign_image = m.get('merchant_sign_image')
        if m.get('mcc') is not None:
            self.mcc = m.get('mcc')
        if m.get('legal_name') is not None:
            self.legal_name = m.get('legal_name')
        if m.get('legal_cert_no') is not None:
            self.legal_cert_no = m.get('legal_cert_no')
        if m.get('address_info') is not None:
            temp_model = IPAddressInfo()
            self.address_info = temp_model.from_map(m['address_info'])
        if m.get('settle_rule') is not None:
            temp_model = IPSettleRule()
            self.settle_rule = temp_model.from_map(m['settle_rule'])
        if m.get('contact_info') is not None:
            temp_model = IPContactInfo()
            self.contact_info = temp_model.from_map(m['contact_info'])
        if m.get('card_info') is not None:
            temp_model = IPCardInfo()
            self.card_info = temp_model.from_map(m['card_info'])
        return self


class IPBill(TeaModel):
    def __init__(
        self,
        ip_order_id: str = None,
        ip_bill_id: str = None,
        biz_id: str = None,
        seller_id: str = None,
        buyer_id: str = None,
        status: int = None,
        create_time: int = None,
        memo: str = None,
        trade_type: int = None,
        pay_url: str = None,
        bill_pay_amount: str = None,
        bill_sales: str = None,
        cycle_start_time: int = None,
        cycle_end_time: int = None,
    ):
        # 订单ID
        self.ip_order_id = ip_order_id
        # 账单ID
        self.ip_bill_id = ip_bill_id
        # 上传销售数据时的bizId
        self.biz_id = biz_id
        # 收款方
        self.seller_id = seller_id
        # 付款方
        self.buyer_id = buyer_id
        # 账单状态
        self.status = status
        # 账单创建时间，时间戳（毫秒）
        self.create_time = create_time
        # 备注信息
        self.memo = memo
        # 交易类型：0套餐交易，1定向授权
        self.trade_type = trade_type
        # 支付链接
        self.pay_url = pay_url
        # 账单金额，支付金额
        self.bill_pay_amount = bill_pay_amount
        # 销售金额
        self.bill_sales = bill_sales
        # 账单周期开始时间，时间戳（毫秒）
        self.cycle_start_time = cycle_start_time
        # 账单周期结束时间，时间戳（毫秒）
        self.cycle_end_time = cycle_end_time

    def validate(self):
        self.validate_required(self.ip_order_id, 'ip_order_id')
        self.validate_required(self.ip_bill_id, 'ip_bill_id')
        self.validate_required(self.biz_id, 'biz_id')
        self.validate_required(self.seller_id, 'seller_id')
        self.validate_required(self.buyer_id, 'buyer_id')
        self.validate_required(self.status, 'status')
        self.validate_required(self.create_time, 'create_time')
        self.validate_required(self.memo, 'memo')
        self.validate_required(self.trade_type, 'trade_type')
        self.validate_required(self.pay_url, 'pay_url')
        self.validate_required(self.bill_pay_amount, 'bill_pay_amount')
        self.validate_required(self.bill_sales, 'bill_sales')
        self.validate_required(self.cycle_start_time, 'cycle_start_time')
        self.validate_required(self.cycle_end_time, 'cycle_end_time')

    def to_map(self):
        result = dict()
        if self.ip_order_id is not None:
            result['ip_order_id'] = self.ip_order_id
        if self.ip_bill_id is not None:
            result['ip_bill_id'] = self.ip_bill_id
        if self.biz_id is not None:
            result['biz_id'] = self.biz_id
        if self.seller_id is not None:
            result['seller_id'] = self.seller_id
        if self.buyer_id is not None:
            result['buyer_id'] = self.buyer_id
        if self.status is not None:
            result['status'] = self.status
        if self.create_time is not None:
            result['create_time'] = self.create_time
        if self.memo is not None:
            result['memo'] = self.memo
        if self.trade_type is not None:
            result['trade_type'] = self.trade_type
        if self.pay_url is not None:
            result['pay_url'] = self.pay_url
        if self.bill_pay_amount is not None:
            result['bill_pay_amount'] = self.bill_pay_amount
        if self.bill_sales is not None:
            result['bill_sales'] = self.bill_sales
        if self.cycle_start_time is not None:
            result['cycle_start_time'] = self.cycle_start_time
        if self.cycle_end_time is not None:
            result['cycle_end_time'] = self.cycle_end_time
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('ip_order_id') is not None:
            self.ip_order_id = m.get('ip_order_id')
        if m.get('ip_bill_id') is not None:
            self.ip_bill_id = m.get('ip_bill_id')
        if m.get('biz_id') is not None:
            self.biz_id = m.get('biz_id')
        if m.get('seller_id') is not None:
            self.seller_id = m.get('seller_id')
        if m.get('buyer_id') is not None:
            self.buyer_id = m.get('buyer_id')
        if m.get('status') is not None:
            self.status = m.get('status')
        if m.get('create_time') is not None:
            self.create_time = m.get('create_time')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('trade_type') is not None:
            self.trade_type = m.get('trade_type')
        if m.get('pay_url') is not None:
            self.pay_url = m.get('pay_url')
        if m.get('bill_pay_amount') is not None:
            self.bill_pay_amount = m.get('bill_pay_amount')
        if m.get('bill_sales') is not None:
            self.bill_sales = m.get('bill_sales')
        if m.get('cycle_start_time') is not None:
            self.cycle_start_time = m.get('cycle_start_time')
        if m.get('cycle_end_time') is not None:
            self.cycle_end_time = m.get('cycle_end_time')
        return self


class CouponCollection(TeaModel):
    def __init__(
        self,
        collection_id: str = None,
        name: str = None,
        issuer: str = None,
        coupon_number_prefix: str = None,
        coupon_admin_account: str = None,
        coupon_admin_tenant_id: str = None,
        expire_monitor_account: str = None,
        expire_monitor_tenant_id: str = None,
        need_registered: bool = None,
        need_pre_registered: bool = None,
    ):
        # 批次ID
        self.collection_id = collection_id
        # 电子券批次名称
        self.name = name
        # 批次发行方
        self.issuer = issuer
        # 批次前缀
        self.coupon_number_prefix = coupon_number_prefix
        # 批次管理员链上ID
        self.coupon_admin_account = coupon_admin_account
        # 批次管理员租户ID
        self.coupon_admin_tenant_id = coupon_admin_tenant_id
        # 批次过期观察员链上ID
        self.expire_monitor_account = expire_monitor_account
        # 批次过期观察员租户ID
        self.expire_monitor_tenant_id = expire_monitor_tenant_id
        # 是否记名
        self.need_registered = need_registered
        # 是否创建时记名
        self.need_pre_registered = need_pre_registered

    def validate(self):
        self.validate_required(self.collection_id, 'collection_id')
        self.validate_required(self.name, 'name')
        self.validate_required(self.issuer, 'issuer')
        self.validate_required(self.coupon_number_prefix, 'coupon_number_prefix')
        self.validate_required(self.coupon_admin_account, 'coupon_admin_account')
        self.validate_required(self.coupon_admin_tenant_id, 'coupon_admin_tenant_id')
        self.validate_required(self.expire_monitor_account, 'expire_monitor_account')
        self.validate_required(self.expire_monitor_tenant_id, 'expire_monitor_tenant_id')
        self.validate_required(self.need_registered, 'need_registered')
        self.validate_required(self.need_pre_registered, 'need_pre_registered')

    def to_map(self):
        result = dict()
        if self.collection_id is not None:
            result['collection_id'] = self.collection_id
        if self.name is not None:
            result['name'] = self.name
        if self.issuer is not None:
            result['issuer'] = self.issuer
        if self.coupon_number_prefix is not None:
            result['coupon_number_prefix'] = self.coupon_number_prefix
        if self.coupon_admin_account is not None:
            result['coupon_admin_account'] = self.coupon_admin_account
        if self.coupon_admin_tenant_id is not None:
            result['coupon_admin_tenant_id'] = self.coupon_admin_tenant_id
        if self.expire_monitor_account is not None:
            result['expire_monitor_account'] = self.expire_monitor_account
        if self.expire_monitor_tenant_id is not None:
            result['expire_monitor_tenant_id'] = self.expire_monitor_tenant_id
        if self.need_registered is not None:
            result['need_registered'] = self.need_registered
        if self.need_pre_registered is not None:
            result['need_pre_registered'] = self.need_pre_registered
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('collection_id') is not None:
            self.collection_id = m.get('collection_id')
        if m.get('name') is not None:
            self.name = m.get('name')
        if m.get('issuer') is not None:
            self.issuer = m.get('issuer')
        if m.get('coupon_number_prefix') is not None:
            self.coupon_number_prefix = m.get('coupon_number_prefix')
        if m.get('coupon_admin_account') is not None:
            self.coupon_admin_account = m.get('coupon_admin_account')
        if m.get('coupon_admin_tenant_id') is not None:
            self.coupon_admin_tenant_id = m.get('coupon_admin_tenant_id')
        if m.get('expire_monitor_account') is not None:
            self.expire_monitor_account = m.get('expire_monitor_account')
        if m.get('expire_monitor_tenant_id') is not None:
            self.expire_monitor_tenant_id = m.get('expire_monitor_tenant_id')
        if m.get('need_registered') is not None:
            self.need_registered = m.get('need_registered')
        if m.get('need_pre_registered') is not None:
            self.need_pre_registered = m.get('need_pre_registered')
        return self


class IPOrder(TeaModel):
    def __init__(
        self,
        ip_order_id: str = None,
        seller_id: str = None,
        seller_name: str = None,
        buyer_id: str = None,
        buyer_name: str = None,
        type: int = None,
        ip_id: str = None,
        ip_name: str = None,
        channel_id: str = None,
        total_amount: int = None,
        used_amount: int = None,
        price_range: str = None,
        total_price: str = None,
        auth_rate: str = None,
        auth_start_time: int = None,
        auth_end_time: int = None,
        contract: str = None,
        design_draft: str = None,
        operator: str = None,
        operator_name: str = None,
        status: int = None,
        create_time: int = None,
        update_time: int = None,
        charge_type: int = None,
        auth_price: str = None,
        guaranteed: bool = None,
        guaranteed_fund: str = None,
        guaranteed_goods_amount: int = None,
        used_guaranteed_goods_amount: int = None,
        guaranteed_sales: str = None,
        used_guaranteed_sales: str = None,
        auth_product_scope: str = None,
        auth_area_scope: str = None,
        sales_channel: str = None,
        goods_type: int = None,
        related_order_id: str = None,
        supervise_approve: bool = None,
        ip_gallery_url: str = None,
        ip_gallery_version: int = None,
        download_ip_gallery: bool = None,
        memo: str = None,
        additional_clause: str = None,
        contract_files: List[str] = None,
    ):
        # 订单ID
        self.ip_order_id = ip_order_id
        # 卖方
        self.seller_id = seller_id
        # 卖家名称
        self.seller_name = seller_name
        # 买方
        self.buyer_id = buyer_id
        # 买家名称
        self.buyer_name = buyer_name
        # 订单交易类型：0套餐交易，1授权交易
        self.type = type
        # ip id
        self.ip_id = ip_id
        # IP名称
        self.ip_name = ip_name
        # 渠道信息
        self.channel_id = channel_id
        # 套餐总量
        self.total_amount = total_amount
        # 套餐已使用数量
        self.used_amount = used_amount
        # 终端商品价格范围
        self.price_range = price_range
        # 套餐交易总费用
        self.total_price = total_price
        # 授权佣金比例
        self.auth_rate = auth_rate
        # 授权合作开始时间（毫秒时间戳）
        self.auth_start_time = auth_start_time
        # 授权合作结束时间
        self.auth_end_time = auth_end_time
        # 合同信息
        self.contract = contract
        # 设计稿信息
        self.design_draft = design_draft
        # 操作人
        self.operator = operator
        # 操作者名称
        self.operator_name = operator_name
        # 订单状态。TODO 补充枚举信息
        self.status = status
        # 订单创建时间，时间戳（毫秒）
        self.create_time = create_time
        # 订单最近更新时间
        self.update_time = update_time
        # 收费模式：0 销售抽佣, 1 按量付费
        self.charge_type = charge_type
        # 按量付费的收费单价（按量付费模式必填）
        self.auth_price = auth_price
        # 是否有保底金
        self.guaranteed = guaranteed
        # 保底金金额
        self.guaranteed_fund = guaranteed_fund
        # 保底商品个数（按量付费）
        self.guaranteed_goods_amount = guaranteed_goods_amount
        # 已使用的保底商品个数（按量付费），订单销售数量超过保底部分需按量付费
        self.used_guaranteed_goods_amount = used_guaranteed_goods_amount
        # 保底商品销售金额（销售抽佣）
        self.guaranteed_sales = guaranteed_sales
        # 已使用的保底商品销售金额（销售抽佣），订单销售额超过保底部分需按比例抽拥
        # 
        self.used_guaranteed_sales = used_guaranteed_sales
        # 授权产品范围
        self.auth_product_scope = auth_product_scope
        # 授权地域范围
        self.auth_area_scope = auth_area_scope
        # 商品销售渠道
        self.sales_channel = sales_channel
        # 0 IP交易，1 增值服务交易
        self.goods_type = goods_type
        # 增值服务交易绑定的ip授权交易订单
        self.related_order_id = related_order_id
        # 是否已监修报审
        self.supervise_approve = supervise_approve
        # 订单图库信息，未确认则为空
        self.ip_gallery_url = ip_gallery_url
        # 图库版本
        self.ip_gallery_version = ip_gallery_version
        # 商家是否已下载过本订单的图库
        self.download_ip_gallery = download_ip_gallery
        # 备注信息
        self.memo = memo
        # 附加条款
        self.additional_clause = additional_clause
        # 合同文件列表
        self.contract_files = contract_files

    def validate(self):
        self.validate_required(self.ip_order_id, 'ip_order_id')
        self.validate_required(self.seller_id, 'seller_id')
        self.validate_required(self.seller_name, 'seller_name')
        self.validate_required(self.buyer_id, 'buyer_id')
        self.validate_required(self.buyer_name, 'buyer_name')
        self.validate_required(self.type, 'type')
        self.validate_required(self.ip_id, 'ip_id')
        self.validate_required(self.ip_name, 'ip_name')
        self.validate_required(self.channel_id, 'channel_id')
        self.validate_required(self.total_amount, 'total_amount')
        self.validate_required(self.used_amount, 'used_amount')
        self.validate_required(self.price_range, 'price_range')
        self.validate_required(self.total_price, 'total_price')
        self.validate_required(self.auth_rate, 'auth_rate')
        self.validate_required(self.auth_start_time, 'auth_start_time')
        self.validate_required(self.auth_end_time, 'auth_end_time')
        self.validate_required(self.contract, 'contract')
        self.validate_required(self.design_draft, 'design_draft')
        self.validate_required(self.operator, 'operator')
        self.validate_required(self.operator_name, 'operator_name')
        self.validate_required(self.status, 'status')
        self.validate_required(self.create_time, 'create_time')
        self.validate_required(self.update_time, 'update_time')
        self.validate_required(self.charge_type, 'charge_type')
        self.validate_required(self.auth_price, 'auth_price')
        self.validate_required(self.guaranteed, 'guaranteed')
        self.validate_required(self.guaranteed_fund, 'guaranteed_fund')
        self.validate_required(self.guaranteed_goods_amount, 'guaranteed_goods_amount')
        self.validate_required(self.used_guaranteed_goods_amount, 'used_guaranteed_goods_amount')
        self.validate_required(self.guaranteed_sales, 'guaranteed_sales')
        self.validate_required(self.used_guaranteed_sales, 'used_guaranteed_sales')
        self.validate_required(self.auth_product_scope, 'auth_product_scope')
        self.validate_required(self.auth_area_scope, 'auth_area_scope')
        self.validate_required(self.sales_channel, 'sales_channel')
        self.validate_required(self.goods_type, 'goods_type')
        self.validate_required(self.related_order_id, 'related_order_id')
        self.validate_required(self.supervise_approve, 'supervise_approve')
        self.validate_required(self.memo, 'memo')

    def to_map(self):
        result = dict()
        if self.ip_order_id is not None:
            result['ip_order_id'] = self.ip_order_id
        if self.seller_id is not None:
            result['seller_id'] = self.seller_id
        if self.seller_name is not None:
            result['seller_name'] = self.seller_name
        if self.buyer_id is not None:
            result['buyer_id'] = self.buyer_id
        if self.buyer_name is not None:
            result['buyer_name'] = self.buyer_name
        if self.type is not None:
            result['type'] = self.type
        if self.ip_id is not None:
            result['ip_id'] = self.ip_id
        if self.ip_name is not None:
            result['ip_name'] = self.ip_name
        if self.channel_id is not None:
            result['channel_id'] = self.channel_id
        if self.total_amount is not None:
            result['total_amount'] = self.total_amount
        if self.used_amount is not None:
            result['used_amount'] = self.used_amount
        if self.price_range is not None:
            result['price_range'] = self.price_range
        if self.total_price is not None:
            result['total_price'] = self.total_price
        if self.auth_rate is not None:
            result['auth_rate'] = self.auth_rate
        if self.auth_start_time is not None:
            result['auth_start_time'] = self.auth_start_time
        if self.auth_end_time is not None:
            result['auth_end_time'] = self.auth_end_time
        if self.contract is not None:
            result['contract'] = self.contract
        if self.design_draft is not None:
            result['design_draft'] = self.design_draft
        if self.operator is not None:
            result['operator'] = self.operator
        if self.operator_name is not None:
            result['operator_name'] = self.operator_name
        if self.status is not None:
            result['status'] = self.status
        if self.create_time is not None:
            result['create_time'] = self.create_time
        if self.update_time is not None:
            result['update_time'] = self.update_time
        if self.charge_type is not None:
            result['charge_type'] = self.charge_type
        if self.auth_price is not None:
            result['auth_price'] = self.auth_price
        if self.guaranteed is not None:
            result['guaranteed'] = self.guaranteed
        if self.guaranteed_fund is not None:
            result['guaranteed_fund'] = self.guaranteed_fund
        if self.guaranteed_goods_amount is not None:
            result['guaranteed_goods_amount'] = self.guaranteed_goods_amount
        if self.used_guaranteed_goods_amount is not None:
            result['used_guaranteed_goods_amount'] = self.used_guaranteed_goods_amount
        if self.guaranteed_sales is not None:
            result['guaranteed_sales'] = self.guaranteed_sales
        if self.used_guaranteed_sales is not None:
            result['used_guaranteed_sales'] = self.used_guaranteed_sales
        if self.auth_product_scope is not None:
            result['auth_product_scope'] = self.auth_product_scope
        if self.auth_area_scope is not None:
            result['auth_area_scope'] = self.auth_area_scope
        if self.sales_channel is not None:
            result['sales_channel'] = self.sales_channel
        if self.goods_type is not None:
            result['goods_type'] = self.goods_type
        if self.related_order_id is not None:
            result['related_order_id'] = self.related_order_id
        if self.supervise_approve is not None:
            result['supervise_approve'] = self.supervise_approve
        if self.ip_gallery_url is not None:
            result['ip_gallery_url'] = self.ip_gallery_url
        if self.ip_gallery_version is not None:
            result['ip_gallery_version'] = self.ip_gallery_version
        if self.download_ip_gallery is not None:
            result['download_ip_gallery'] = self.download_ip_gallery
        if self.memo is not None:
            result['memo'] = self.memo
        if self.additional_clause is not None:
            result['additional_clause'] = self.additional_clause
        if self.contract_files is not None:
            result['contract_files'] = self.contract_files
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('ip_order_id') is not None:
            self.ip_order_id = m.get('ip_order_id')
        if m.get('seller_id') is not None:
            self.seller_id = m.get('seller_id')
        if m.get('seller_name') is not None:
            self.seller_name = m.get('seller_name')
        if m.get('buyer_id') is not None:
            self.buyer_id = m.get('buyer_id')
        if m.get('buyer_name') is not None:
            self.buyer_name = m.get('buyer_name')
        if m.get('type') is not None:
            self.type = m.get('type')
        if m.get('ip_id') is not None:
            self.ip_id = m.get('ip_id')
        if m.get('ip_name') is not None:
            self.ip_name = m.get('ip_name')
        if m.get('channel_id') is not None:
            self.channel_id = m.get('channel_id')
        if m.get('total_amount') is not None:
            self.total_amount = m.get('total_amount')
        if m.get('used_amount') is not None:
            self.used_amount = m.get('used_amount')
        if m.get('price_range') is not None:
            self.price_range = m.get('price_range')
        if m.get('total_price') is not None:
            self.total_price = m.get('total_price')
        if m.get('auth_rate') is not None:
            self.auth_rate = m.get('auth_rate')
        if m.get('auth_start_time') is not None:
            self.auth_start_time = m.get('auth_start_time')
        if m.get('auth_end_time') is not None:
            self.auth_end_time = m.get('auth_end_time')
        if m.get('contract') is not None:
            self.contract = m.get('contract')
        if m.get('design_draft') is not None:
            self.design_draft = m.get('design_draft')
        if m.get('operator') is not None:
            self.operator = m.get('operator')
        if m.get('operator_name') is not None:
            self.operator_name = m.get('operator_name')
        if m.get('status') is not None:
            self.status = m.get('status')
        if m.get('create_time') is not None:
            self.create_time = m.get('create_time')
        if m.get('update_time') is not None:
            self.update_time = m.get('update_time')
        if m.get('charge_type') is not None:
            self.charge_type = m.get('charge_type')
        if m.get('auth_price') is not None:
            self.auth_price = m.get('auth_price')
        if m.get('guaranteed') is not None:
            self.guaranteed = m.get('guaranteed')
        if m.get('guaranteed_fund') is not None:
            self.guaranteed_fund = m.get('guaranteed_fund')
        if m.get('guaranteed_goods_amount') is not None:
            self.guaranteed_goods_amount = m.get('guaranteed_goods_amount')
        if m.get('used_guaranteed_goods_amount') is not None:
            self.used_guaranteed_goods_amount = m.get('used_guaranteed_goods_amount')
        if m.get('guaranteed_sales') is not None:
            self.guaranteed_sales = m.get('guaranteed_sales')
        if m.get('used_guaranteed_sales') is not None:
            self.used_guaranteed_sales = m.get('used_guaranteed_sales')
        if m.get('auth_product_scope') is not None:
            self.auth_product_scope = m.get('auth_product_scope')
        if m.get('auth_area_scope') is not None:
            self.auth_area_scope = m.get('auth_area_scope')
        if m.get('sales_channel') is not None:
            self.sales_channel = m.get('sales_channel')
        if m.get('goods_type') is not None:
            self.goods_type = m.get('goods_type')
        if m.get('related_order_id') is not None:
            self.related_order_id = m.get('related_order_id')
        if m.get('supervise_approve') is not None:
            self.supervise_approve = m.get('supervise_approve')
        if m.get('ip_gallery_url') is not None:
            self.ip_gallery_url = m.get('ip_gallery_url')
        if m.get('ip_gallery_version') is not None:
            self.ip_gallery_version = m.get('ip_gallery_version')
        if m.get('download_ip_gallery') is not None:
            self.download_ip_gallery = m.get('download_ip_gallery')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('additional_clause') is not None:
            self.additional_clause = m.get('additional_clause')
        if m.get('contract_files') is not None:
            self.contract_files = m.get('contract_files')
        return self


class EquityAuthInfo(TeaModel):
    def __init__(
        self,
        chain_id: str = None,
        equity_id: str = None,
        open_to_tenant_id: str = None,
        tenant_price: str = None,
        block_number: str = None,
        tx_hash: str = None,
        block_time: int = None,
    ):
        # 链ID
        self.chain_id = chain_id
        # 商品ID
        self.equity_id = equity_id
        # 授权租户
        self.open_to_tenant_id = open_to_tenant_id
        # 租户价格（自定义价格）
        self.tenant_price = tenant_price
        # 区块高度
        self.block_number = block_number
        # 交易hash
        self.tx_hash = tx_hash
        # 区块时间戳
        self.block_time = block_time

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.equity_id, 'equity_id')
        self.validate_required(self.open_to_tenant_id, 'open_to_tenant_id')
        self.validate_required(self.tenant_price, 'tenant_price')
        self.validate_required(self.block_number, 'block_number')
        self.validate_required(self.tx_hash, 'tx_hash')
        self.validate_required(self.block_time, 'block_time')

    def to_map(self):
        result = dict()
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.equity_id is not None:
            result['equity_id'] = self.equity_id
        if self.open_to_tenant_id is not None:
            result['open_to_tenant_id'] = self.open_to_tenant_id
        if self.tenant_price is not None:
            result['tenant_price'] = self.tenant_price
        if self.block_number is not None:
            result['block_number'] = self.block_number
        if self.tx_hash is not None:
            result['tx_hash'] = self.tx_hash
        if self.block_time is not None:
            result['block_time'] = self.block_time
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('equity_id') is not None:
            self.equity_id = m.get('equity_id')
        if m.get('open_to_tenant_id') is not None:
            self.open_to_tenant_id = m.get('open_to_tenant_id')
        if m.get('tenant_price') is not None:
            self.tenant_price = m.get('tenant_price')
        if m.get('block_number') is not None:
            self.block_number = m.get('block_number')
        if m.get('tx_hash') is not None:
            self.tx_hash = m.get('tx_hash')
        if m.get('block_time') is not None:
            self.block_time = m.get('block_time')
        return self


class Coupon(TeaModel):
    def __init__(
        self,
        bind_time: int = None,
        bind_tx_hash: str = None,
        cal_status: int = None,
        charge_time: int = None,
        coupon_code: str = None,
        coupon_ext_code: str = None,
        coupon_id: str = None,
        coupon_name: str = None,
        create_time: int = None,
        create_tx_hash: str = None,
        desensitized_uid: str = None,
        ext_info: str = None,
        last_time: int = None,
        last_tx_hash: str = None,
        public_key: str = None,
        query_count: int = None,
        query_time: int = None,
        query_tx_hash: str = None,
        risk_status: int = None,
        status: int = None,
        uid_public_key: str = None,
        valid_after: int = None,
        valid_before: int = None,
        value: str = None,
        version: int = None,
        charge_tx_hash: str = None,
        holder_user_account: str = None,
    ):
        # 绑定时间戳（毫秒）
        self.bind_time = bind_time
        # 绑定电子券的哈希
        self.bind_tx_hash = bind_tx_hash
        # 电子券理论上应处于的状态（比如电子券已过期）
        self.cal_status = cal_status
        # 激活时间戳（毫秒）
        self.charge_time = charge_time
        # 激活码
        self.coupon_code = coupon_code
        # 激活码附加信息
        self.coupon_ext_code = coupon_ext_code
        # 电子券ID
        self.coupon_id = coupon_id
        # 电子券名称
        self.coupon_name = coupon_name
        # 创建时间戳（毫秒）
        self.create_time = create_time
        # 创建电子券的哈希
        self.create_tx_hash = create_tx_hash
        # 脱敏用户ID
        self.desensitized_uid = desensitized_uid
        # 扩展信息
        self.ext_info = ext_info
        # 最后一次操作时间戳（毫秒）
        self.last_time = last_time
        # 最后一次操作的交易哈希
        self.last_tx_hash = last_tx_hash
        # 电子券公钥。椭圆曲线密码学 Secp256k1曲线的公钥，长度64字节，十六进制128位。
        self.public_key = public_key
        # 调子券信息查询次数
        self.query_count = query_count
        # 最后一次查询时间戳（毫秒）
        self.query_time = query_time
        # 最近一次查询的交易哈希
        self.query_tx_hash = query_tx_hash
        # 风控状态：0 启用，1 禁用
        self.risk_status = risk_status
        # 电子券状态：
        self.status = status
        # 用户公钥
        self.uid_public_key = uid_public_key
        # 有效开始时间（毫秒时间戳）
        self.valid_after = valid_after
        # 有效结束时间（毫秒时间戳）
        self.valid_before = valid_before
        # 价值
        self.value = value
        # 电子券版本
        self.version = version
        # 电子券激活交易哈希
        self.charge_tx_hash = charge_tx_hash
        # 记名电子券持有者账户
        self.holder_user_account = holder_user_account

    def validate(self):
        self.validate_required(self.bind_time, 'bind_time')
        self.validate_required(self.bind_tx_hash, 'bind_tx_hash')
        self.validate_required(self.cal_status, 'cal_status')
        self.validate_required(self.charge_time, 'charge_time')
        self.validate_required(self.coupon_code, 'coupon_code')
        self.validate_required(self.coupon_ext_code, 'coupon_ext_code')
        self.validate_required(self.coupon_id, 'coupon_id')
        self.validate_required(self.coupon_name, 'coupon_name')
        self.validate_required(self.create_time, 'create_time')
        self.validate_required(self.create_tx_hash, 'create_tx_hash')
        self.validate_required(self.desensitized_uid, 'desensitized_uid')
        self.validate_required(self.ext_info, 'ext_info')
        self.validate_required(self.last_time, 'last_time')
        self.validate_required(self.last_tx_hash, 'last_tx_hash')
        self.validate_required(self.public_key, 'public_key')
        self.validate_required(self.query_count, 'query_count')
        self.validate_required(self.query_time, 'query_time')
        self.validate_required(self.query_tx_hash, 'query_tx_hash')
        self.validate_required(self.risk_status, 'risk_status')
        self.validate_required(self.status, 'status')
        self.validate_required(self.uid_public_key, 'uid_public_key')
        self.validate_required(self.valid_after, 'valid_after')
        self.validate_required(self.valid_before, 'valid_before')
        self.validate_required(self.value, 'value')
        self.validate_required(self.version, 'version')
        self.validate_required(self.charge_tx_hash, 'charge_tx_hash')
        self.validate_required(self.holder_user_account, 'holder_user_account')

    def to_map(self):
        result = dict()
        if self.bind_time is not None:
            result['bind_time'] = self.bind_time
        if self.bind_tx_hash is not None:
            result['bind_tx_hash'] = self.bind_tx_hash
        if self.cal_status is not None:
            result['cal_status'] = self.cal_status
        if self.charge_time is not None:
            result['charge_time'] = self.charge_time
        if self.coupon_code is not None:
            result['coupon_code'] = self.coupon_code
        if self.coupon_ext_code is not None:
            result['coupon_ext_code'] = self.coupon_ext_code
        if self.coupon_id is not None:
            result['coupon_id'] = self.coupon_id
        if self.coupon_name is not None:
            result['coupon_name'] = self.coupon_name
        if self.create_time is not None:
            result['create_time'] = self.create_time
        if self.create_tx_hash is not None:
            result['create_tx_hash'] = self.create_tx_hash
        if self.desensitized_uid is not None:
            result['desensitized_uid'] = self.desensitized_uid
        if self.ext_info is not None:
            result['ext_info'] = self.ext_info
        if self.last_time is not None:
            result['last_time'] = self.last_time
        if self.last_tx_hash is not None:
            result['last_tx_hash'] = self.last_tx_hash
        if self.public_key is not None:
            result['public_key'] = self.public_key
        if self.query_count is not None:
            result['query_count'] = self.query_count
        if self.query_time is not None:
            result['query_time'] = self.query_time
        if self.query_tx_hash is not None:
            result['query_tx_hash'] = self.query_tx_hash
        if self.risk_status is not None:
            result['risk_status'] = self.risk_status
        if self.status is not None:
            result['status'] = self.status
        if self.uid_public_key is not None:
            result['uid_public_key'] = self.uid_public_key
        if self.valid_after is not None:
            result['valid_after'] = self.valid_after
        if self.valid_before is not None:
            result['valid_before'] = self.valid_before
        if self.value is not None:
            result['value'] = self.value
        if self.version is not None:
            result['version'] = self.version
        if self.charge_tx_hash is not None:
            result['charge_tx_hash'] = self.charge_tx_hash
        if self.holder_user_account is not None:
            result['holder_user_account'] = self.holder_user_account
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('bind_time') is not None:
            self.bind_time = m.get('bind_time')
        if m.get('bind_tx_hash') is not None:
            self.bind_tx_hash = m.get('bind_tx_hash')
        if m.get('cal_status') is not None:
            self.cal_status = m.get('cal_status')
        if m.get('charge_time') is not None:
            self.charge_time = m.get('charge_time')
        if m.get('coupon_code') is not None:
            self.coupon_code = m.get('coupon_code')
        if m.get('coupon_ext_code') is not None:
            self.coupon_ext_code = m.get('coupon_ext_code')
        if m.get('coupon_id') is not None:
            self.coupon_id = m.get('coupon_id')
        if m.get('coupon_name') is not None:
            self.coupon_name = m.get('coupon_name')
        if m.get('create_time') is not None:
            self.create_time = m.get('create_time')
        if m.get('create_tx_hash') is not None:
            self.create_tx_hash = m.get('create_tx_hash')
        if m.get('desensitized_uid') is not None:
            self.desensitized_uid = m.get('desensitized_uid')
        if m.get('ext_info') is not None:
            self.ext_info = m.get('ext_info')
        if m.get('last_time') is not None:
            self.last_time = m.get('last_time')
        if m.get('last_tx_hash') is not None:
            self.last_tx_hash = m.get('last_tx_hash')
        if m.get('public_key') is not None:
            self.public_key = m.get('public_key')
        if m.get('query_count') is not None:
            self.query_count = m.get('query_count')
        if m.get('query_time') is not None:
            self.query_time = m.get('query_time')
        if m.get('query_tx_hash') is not None:
            self.query_tx_hash = m.get('query_tx_hash')
        if m.get('risk_status') is not None:
            self.risk_status = m.get('risk_status')
        if m.get('status') is not None:
            self.status = m.get('status')
        if m.get('uid_public_key') is not None:
            self.uid_public_key = m.get('uid_public_key')
        if m.get('valid_after') is not None:
            self.valid_after = m.get('valid_after')
        if m.get('valid_before') is not None:
            self.valid_before = m.get('valid_before')
        if m.get('value') is not None:
            self.value = m.get('value')
        if m.get('version') is not None:
            self.version = m.get('version')
        if m.get('charge_tx_hash') is not None:
            self.charge_tx_hash = m.get('charge_tx_hash')
        if m.get('holder_user_account') is not None:
            self.holder_user_account = m.get('holder_user_account')
        return self


class IPSalesInfo(TeaModel):
    def __init__(
        self,
        goods_name: str = None,
        goods_image: str = None,
        sales_channel: str = None,
        goods_url: str = None,
        price: str = None,
        amount: int = None,
        sales: str = None,
        payment: str = None,
        settlement_begin_time: int = None,
        settlement_end_time: int = None,
        memo: str = None,
        operator: str = None,
        operate_time: int = None,
        goods_info: str = None,
        goods_id: str = None,
        refund_sales: str = None,
        sales_ext_info: str = None,
        sales_user_info: str = None,
    ):
        # 终端商品名称
        self.goods_name = goods_name
        # 终端商品图片
        self.goods_image = goods_image
        # 终端销售渠道
        self.sales_channel = sales_channel
        # 终端商品链接
        self.goods_url = goods_url
        # 零售价
        self.price = price
        # 商品销售数量
        self.amount = amount
        # 销售金额
        self.sales = sales
        # 实付金额（授权交易）
        self.payment = payment
        # 统计周期开始时间（毫秒时间戳）
        self.settlement_begin_time = settlement_begin_time
        # 统计周期结束时间（毫秒时间戳）
        self.settlement_end_time = settlement_end_time
        # 备注信息
        self.memo = memo
        # 数据上传操作人
        self.operator = operator
        # 销售数据上传操作时间（毫秒时间戳）
        self.operate_time = operate_time
        # 商品信息
        self.goods_info = goods_info
        # 商品ID
        self.goods_id = goods_id
        # 退款的销售金额，有退款时填写，默认0
        self.refund_sales = refund_sales
        # 订单信息json string: 用户ID/订单状态/订单创建时间戳ms/订单支付时间戳ms等
        self.sales_ext_info = sales_ext_info
        # 用户信息json string: 姓名/手机号/地址等结构化数据
        self.sales_user_info = sales_user_info

    def validate(self):
        self.validate_required(self.goods_name, 'goods_name')
        self.validate_required(self.goods_image, 'goods_image')
        self.validate_required(self.sales_channel, 'sales_channel')
        self.validate_required(self.goods_url, 'goods_url')
        self.validate_required(self.price, 'price')
        self.validate_required(self.amount, 'amount')
        self.validate_required(self.sales, 'sales')
        self.validate_required(self.payment, 'payment')
        self.validate_required(self.settlement_begin_time, 'settlement_begin_time')
        self.validate_required(self.settlement_end_time, 'settlement_end_time')
        self.validate_required(self.memo, 'memo')
        self.validate_required(self.operator, 'operator')
        self.validate_required(self.operate_time, 'operate_time')

    def to_map(self):
        result = dict()
        if self.goods_name is not None:
            result['goods_name'] = self.goods_name
        if self.goods_image is not None:
            result['goods_image'] = self.goods_image
        if self.sales_channel is not None:
            result['sales_channel'] = self.sales_channel
        if self.goods_url is not None:
            result['goods_url'] = self.goods_url
        if self.price is not None:
            result['price'] = self.price
        if self.amount is not None:
            result['amount'] = self.amount
        if self.sales is not None:
            result['sales'] = self.sales
        if self.payment is not None:
            result['payment'] = self.payment
        if self.settlement_begin_time is not None:
            result['settlement_begin_time'] = self.settlement_begin_time
        if self.settlement_end_time is not None:
            result['settlement_end_time'] = self.settlement_end_time
        if self.memo is not None:
            result['memo'] = self.memo
        if self.operator is not None:
            result['operator'] = self.operator
        if self.operate_time is not None:
            result['operate_time'] = self.operate_time
        if self.goods_info is not None:
            result['goods_info'] = self.goods_info
        if self.goods_id is not None:
            result['goods_id'] = self.goods_id
        if self.refund_sales is not None:
            result['refund_sales'] = self.refund_sales
        if self.sales_ext_info is not None:
            result['sales_ext_info'] = self.sales_ext_info
        if self.sales_user_info is not None:
            result['sales_user_info'] = self.sales_user_info
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('goods_name') is not None:
            self.goods_name = m.get('goods_name')
        if m.get('goods_image') is not None:
            self.goods_image = m.get('goods_image')
        if m.get('sales_channel') is not None:
            self.sales_channel = m.get('sales_channel')
        if m.get('goods_url') is not None:
            self.goods_url = m.get('goods_url')
        if m.get('price') is not None:
            self.price = m.get('price')
        if m.get('amount') is not None:
            self.amount = m.get('amount')
        if m.get('sales') is not None:
            self.sales = m.get('sales')
        if m.get('payment') is not None:
            self.payment = m.get('payment')
        if m.get('settlement_begin_time') is not None:
            self.settlement_begin_time = m.get('settlement_begin_time')
        if m.get('settlement_end_time') is not None:
            self.settlement_end_time = m.get('settlement_end_time')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('operator') is not None:
            self.operator = m.get('operator')
        if m.get('operate_time') is not None:
            self.operate_time = m.get('operate_time')
        if m.get('goods_info') is not None:
            self.goods_info = m.get('goods_info')
        if m.get('goods_id') is not None:
            self.goods_id = m.get('goods_id')
        if m.get('refund_sales') is not None:
            self.refund_sales = m.get('refund_sales')
        if m.get('sales_ext_info') is not None:
            self.sales_ext_info = m.get('sales_ext_info')
        if m.get('sales_user_info') is not None:
            self.sales_user_info = m.get('sales_user_info')
        return self


class TokenData(TeaModel):
    def __init__(
        self,
        token_number: int = None,
        debit_token: int = None,
        credit_token: int = None,
        account_id: str = None,
    ):
        # 拥有的token数量
        self.token_number = token_number
        # 来源为debit的token数量
        self.debit_token = debit_token
        # 来源为debit的token数量
        self.credit_token = credit_token
        # token发行者account
        self.account_id = account_id

    def validate(self):
        self.validate_required(self.token_number, 'token_number')
        self.validate_required(self.debit_token, 'debit_token')
        self.validate_required(self.credit_token, 'credit_token')
        self.validate_required(self.account_id, 'account_id')

    def to_map(self):
        result = dict()
        if self.token_number is not None:
            result['token_number'] = self.token_number
        if self.debit_token is not None:
            result['debit_token'] = self.debit_token
        if self.credit_token is not None:
            result['credit_token'] = self.credit_token
        if self.account_id is not None:
            result['account_id'] = self.account_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('token_number') is not None:
            self.token_number = m.get('token_number')
        if m.get('debit_token') is not None:
            self.debit_token = m.get('debit_token')
        if m.get('credit_token') is not None:
            self.credit_token = m.get('credit_token')
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        return self


class IpChannelInfo(TeaModel):
    def __init__(
        self,
        channel_name: str = None,
        authorization_mode: int = None,
        pay_mode: int = None,
        ip_level: int = None,
        status: int = None,
        trade_need_confirm: bool = None,
    ):
        # 渠道名字
        self.channel_name = channel_name
        # 授权模式 商品授权 0普通授权/1独家授权  本期只有0
        self.authorization_mode = authorization_mode
        # 计费模式 0:按量 1:按金额
        self.pay_mode = pay_mode
        # ip等级 （5位数字） 对应a，0:经典IP/1:流量IP/2:设计IP
        self.ip_level = ip_level
        # 商品状态（0:待上架，1:上架，2:下架）
        self.status = status
        # 交易是否需要确认
        self.trade_need_confirm = trade_need_confirm

    def validate(self):
        self.validate_required(self.channel_name, 'channel_name')
        self.validate_required(self.authorization_mode, 'authorization_mode')
        self.validate_required(self.pay_mode, 'pay_mode')
        self.validate_required(self.ip_level, 'ip_level')
        self.validate_required(self.status, 'status')

    def to_map(self):
        result = dict()
        if self.channel_name is not None:
            result['channel_name'] = self.channel_name
        if self.authorization_mode is not None:
            result['authorization_mode'] = self.authorization_mode
        if self.pay_mode is not None:
            result['pay_mode'] = self.pay_mode
        if self.ip_level is not None:
            result['ip_level'] = self.ip_level
        if self.status is not None:
            result['status'] = self.status
        if self.trade_need_confirm is not None:
            result['trade_need_confirm'] = self.trade_need_confirm
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('channel_name') is not None:
            self.channel_name = m.get('channel_name')
        if m.get('authorization_mode') is not None:
            self.authorization_mode = m.get('authorization_mode')
        if m.get('pay_mode') is not None:
            self.pay_mode = m.get('pay_mode')
        if m.get('ip_level') is not None:
            self.ip_level = m.get('ip_level')
        if m.get('status') is not None:
            self.status = m.get('status')
        if m.get('trade_need_confirm') is not None:
            self.trade_need_confirm = m.get('trade_need_confirm')
        return self


class SuperviseApprove(TeaModel):
    def __init__(
        self,
        order_id: str = None,
        stage: int = None,
        ext_info: str = None,
        approval_status: int = None,
        approval_comments: str = None,
        tx_hash: str = None,
        ip_id: str = None,
        seller_account_id: str = None,
        buyer_account_id: str = None,
        approval_ext_info: str = None,
    ):
        # 关联的订单id
        self.order_id = order_id
        # 当前的阶段
        self.stage = stage
        # json组织，用于存储监修报审的具体信息
        self.ext_info = ext_info
        # 当前阶段的审批状态   0:待审批，1:审批通过 2:审批拒绝
        self.approval_status = approval_status
        # 审批备注
        self.approval_comments = approval_comments
        # 上链的交易hash
        self.tx_hash = tx_hash
        # 关联的订单交易的ip id
        self.ip_id = ip_id
        # 关联交易的卖家id
        self.seller_account_id = seller_account_id
        # 关联交易的买家id
        self.buyer_account_id = buyer_account_id
        # 审批额外信息
        self.approval_ext_info = approval_ext_info

    def validate(self):
        self.validate_required(self.order_id, 'order_id')
        self.validate_required(self.stage, 'stage')
        self.validate_required(self.ext_info, 'ext_info')
        self.validate_required(self.approval_status, 'approval_status')
        self.validate_required(self.tx_hash, 'tx_hash')
        self.validate_required(self.ip_id, 'ip_id')
        self.validate_required(self.seller_account_id, 'seller_account_id')
        self.validate_required(self.buyer_account_id, 'buyer_account_id')

    def to_map(self):
        result = dict()
        if self.order_id is not None:
            result['order_id'] = self.order_id
        if self.stage is not None:
            result['stage'] = self.stage
        if self.ext_info is not None:
            result['ext_info'] = self.ext_info
        if self.approval_status is not None:
            result['approval_status'] = self.approval_status
        if self.approval_comments is not None:
            result['approval_comments'] = self.approval_comments
        if self.tx_hash is not None:
            result['tx_hash'] = self.tx_hash
        if self.ip_id is not None:
            result['ip_id'] = self.ip_id
        if self.seller_account_id is not None:
            result['seller_account_id'] = self.seller_account_id
        if self.buyer_account_id is not None:
            result['buyer_account_id'] = self.buyer_account_id
        if self.approval_ext_info is not None:
            result['approval_ext_info'] = self.approval_ext_info
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('order_id') is not None:
            self.order_id = m.get('order_id')
        if m.get('stage') is not None:
            self.stage = m.get('stage')
        if m.get('ext_info') is not None:
            self.ext_info = m.get('ext_info')
        if m.get('approval_status') is not None:
            self.approval_status = m.get('approval_status')
        if m.get('approval_comments') is not None:
            self.approval_comments = m.get('approval_comments')
        if m.get('tx_hash') is not None:
            self.tx_hash = m.get('tx_hash')
        if m.get('ip_id') is not None:
            self.ip_id = m.get('ip_id')
        if m.get('seller_account_id') is not None:
            self.seller_account_id = m.get('seller_account_id')
        if m.get('buyer_account_id') is not None:
            self.buyer_account_id = m.get('buyer_account_id')
        if m.get('approval_ext_info') is not None:
            self.approval_ext_info = m.get('approval_ext_info')
        return self


class IpEmphasisInfo(TeaModel):
    def __init__(
        self,
        ip_id: str = None,
        description: str = None,
        ip_type: str = None,
        audience_group: str = None,
        image: str = None,
        status: int = None,
        account_id: str = None,
        create_time: str = None,
        ip_name: str = None,
        account_name: str = None,
        pv: int = None,
        last_state_change_time: int = None,
        creater_channel: str = None,
    ):
        # ip的链上id
        self.ip_id = ip_id
        # ip的描述信息
        self.description = description
        # ip类型
        self.ip_type = ip_type
        # 受众群体（6位数字） 对应c
        self.audience_group = audience_group
        # 主图
        self.image = image
        # 上架状态
        self.status = status
        # 归属的账户id
        self.account_id = account_id
        # 创建日期
        self.create_time = create_time
        # ip名字
        self.ip_name = ip_name
        # 商户名称
        self.account_name = account_name
        # 浏览量
        self.pv = pv
        # 最近一次上下架时间
        self.last_state_change_time = last_state_change_time
        # ip的创建渠道，按照查询参数返回
        self.creater_channel = creater_channel

    def validate(self):
        self.validate_required(self.ip_id, 'ip_id')
        self.validate_required(self.description, 'description')
        self.validate_required(self.ip_type, 'ip_type')
        self.validate_required(self.audience_group, 'audience_group')
        self.validate_required(self.image, 'image')
        self.validate_required(self.status, 'status')
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.create_time, 'create_time')
        if self.create_time is not None:
            self.validate_pattern(self.create_time, 'create_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}([Z]|([\\.]\\d{1,9})?[\\+]\\d{2}[\\:]?\\d{2})')
        self.validate_required(self.ip_name, 'ip_name')

    def to_map(self):
        result = dict()
        if self.ip_id is not None:
            result['ip_id'] = self.ip_id
        if self.description is not None:
            result['description'] = self.description
        if self.ip_type is not None:
            result['ip_type'] = self.ip_type
        if self.audience_group is not None:
            result['audience_group'] = self.audience_group
        if self.image is not None:
            result['image'] = self.image
        if self.status is not None:
            result['status'] = self.status
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.create_time is not None:
            result['create_time'] = self.create_time
        if self.ip_name is not None:
            result['ip_name'] = self.ip_name
        if self.account_name is not None:
            result['account_name'] = self.account_name
        if self.pv is not None:
            result['pv'] = self.pv
        if self.last_state_change_time is not None:
            result['last_state_change_time'] = self.last_state_change_time
        if self.creater_channel is not None:
            result['creater_channel'] = self.creater_channel
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('ip_id') is not None:
            self.ip_id = m.get('ip_id')
        if m.get('description') is not None:
            self.description = m.get('description')
        if m.get('ip_type') is not None:
            self.ip_type = m.get('ip_type')
        if m.get('audience_group') is not None:
            self.audience_group = m.get('audience_group')
        if m.get('image') is not None:
            self.image = m.get('image')
        if m.get('status') is not None:
            self.status = m.get('status')
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('create_time') is not None:
            self.create_time = m.get('create_time')
        if m.get('ip_name') is not None:
            self.ip_name = m.get('ip_name')
        if m.get('account_name') is not None:
            self.account_name = m.get('account_name')
        if m.get('pv') is not None:
            self.pv = m.get('pv')
        if m.get('last_state_change_time') is not None:
            self.last_state_change_time = m.get('last_state_change_time')
        if m.get('creater_channel') is not None:
            self.creater_channel = m.get('creater_channel')
        return self


class BlockInstruction(TeaModel):
    def __init__(
        self,
        order_id: str = None,
        instruction_type: int = None,
        buyer_account_id: str = None,
        seller_account_id: str = None,
        platform_id: str = None,
        goods_id: str = None,
        display_name: str = None,
        seller_price: str = None,
        display_price: str = None,
        memo: str = None,
        remark: str = None,
        status: int = None,
        refund_status: int = None,
        create_timestamp: int = None,
        pay_timestamp: int = None,
        extra_data: List[MetaDataDO] = None,
        token_instructions: List[TokenInstructionDO] = None,
        related_order_id: str = None,
        commission_token: str = None,
        seller_receive_token: str = None,
        pay_commission_type: int = None,
        buyer_phone: str = None,
        buyer_name: str = None,
        buyer_id_number: str = None,
        buyer_id_type: str = None,
        buye_ip: str = None,
        origin_create_time: int = None,
        origin_order_id: str = None,
    ):
        # 商品兑换单/订单编号
        self.order_id = order_id
        # 交易类型
        self.instruction_type = instruction_type
        # 买家的链上账户Id
        self.buyer_account_id = buyer_account_id
        # 卖家的链上账户Id
        self.seller_account_id = seller_account_id
        # 平台机构ID
        self.platform_id = platform_id
        # 商品ID
        self.goods_id = goods_id
        # 商品名称
        self.display_name = display_name
        # 实际售价(元)
        self.seller_price = seller_price
        # 商品面值(元)
        self.display_price = display_price
        # 备注信息
        self.memo = memo
        # 附言
        self.remark = remark
        # 兑换单状态
        self.status = status
        # 退款状态
        self.refund_status = refund_status
        # 交易创建时间
        self.create_timestamp = create_timestamp
        # 支付时间
        self.pay_timestamp = pay_timestamp
        # 交易附属信息
        self.extra_data = extra_data
        # 交易token来源信息
        self.token_instructions = token_instructions
        # 关联交易ID
        self.related_order_id = related_order_id
        # 手续费token数量
        self.commission_token = commission_token
        # 卖家收到的token数量
        self.seller_receive_token = seller_receive_token
        # 支付类型：买家支付，卖家支付
        self.pay_commission_type = pay_commission_type
        # 买家手机号
        self.buyer_phone = buyer_phone
        # 买家名称
        self.buyer_name = buyer_name
        # 买家身份信息
        self.buyer_id_number = buyer_id_number
        # 买家身份信息类型
        self.buyer_id_type = buyer_id_type
        # 买家IP
        self.buye_ip = buye_ip
        # 订单原始创建时间，外部传入
        self.origin_create_time = origin_create_time
        # 订单原始订单ID，外部传入
        self.origin_order_id = origin_order_id

    def validate(self):
        self.validate_required(self.order_id, 'order_id')
        self.validate_required(self.instruction_type, 'instruction_type')
        self.validate_required(self.buyer_account_id, 'buyer_account_id')
        self.validate_required(self.seller_account_id, 'seller_account_id')
        self.validate_required(self.platform_id, 'platform_id')
        self.validate_required(self.goods_id, 'goods_id')
        self.validate_required(self.display_name, 'display_name')
        self.validate_required(self.seller_price, 'seller_price')
        self.validate_required(self.display_price, 'display_price')
        self.validate_required(self.memo, 'memo')
        self.validate_required(self.remark, 'remark')
        self.validate_required(self.status, 'status')
        self.validate_required(self.refund_status, 'refund_status')
        self.validate_required(self.create_timestamp, 'create_timestamp')
        self.validate_required(self.pay_timestamp, 'pay_timestamp')
        self.validate_required(self.extra_data, 'extra_data')
        if self.extra_data:
            for k in self.extra_data:
                if k:
                    k.validate()
        self.validate_required(self.token_instructions, 'token_instructions')
        if self.token_instructions:
            for k in self.token_instructions:
                if k:
                    k.validate()
        self.validate_required(self.related_order_id, 'related_order_id')
        self.validate_required(self.commission_token, 'commission_token')
        self.validate_required(self.seller_receive_token, 'seller_receive_token')
        self.validate_required(self.pay_commission_type, 'pay_commission_type')
        self.validate_required(self.buyer_phone, 'buyer_phone')
        self.validate_required(self.buyer_name, 'buyer_name')
        self.validate_required(self.buyer_id_number, 'buyer_id_number')
        self.validate_required(self.buyer_id_type, 'buyer_id_type')
        self.validate_required(self.buye_ip, 'buye_ip')
        self.validate_required(self.origin_create_time, 'origin_create_time')
        self.validate_required(self.origin_order_id, 'origin_order_id')

    def to_map(self):
        result = dict()
        if self.order_id is not None:
            result['order_id'] = self.order_id
        if self.instruction_type is not None:
            result['instruction_type'] = self.instruction_type
        if self.buyer_account_id is not None:
            result['buyer_account_id'] = self.buyer_account_id
        if self.seller_account_id is not None:
            result['seller_account_id'] = self.seller_account_id
        if self.platform_id is not None:
            result['platform_id'] = self.platform_id
        if self.goods_id is not None:
            result['goods_id'] = self.goods_id
        if self.display_name is not None:
            result['display_name'] = self.display_name
        if self.seller_price is not None:
            result['seller_price'] = self.seller_price
        if self.display_price is not None:
            result['display_price'] = self.display_price
        if self.memo is not None:
            result['memo'] = self.memo
        if self.remark is not None:
            result['remark'] = self.remark
        if self.status is not None:
            result['status'] = self.status
        if self.refund_status is not None:
            result['refund_status'] = self.refund_status
        if self.create_timestamp is not None:
            result['create_timestamp'] = self.create_timestamp
        if self.pay_timestamp is not None:
            result['pay_timestamp'] = self.pay_timestamp
        result['extra_data'] = []
        if self.extra_data is not None:
            for k in self.extra_data:
                result['extra_data'].append(k.to_map() if k else None)
        result['token_instructions'] = []
        if self.token_instructions is not None:
            for k in self.token_instructions:
                result['token_instructions'].append(k.to_map() if k else None)
        if self.related_order_id is not None:
            result['related_order_id'] = self.related_order_id
        if self.commission_token is not None:
            result['commission_token'] = self.commission_token
        if self.seller_receive_token is not None:
            result['seller_receive_token'] = self.seller_receive_token
        if self.pay_commission_type is not None:
            result['pay_commission_type'] = self.pay_commission_type
        if self.buyer_phone is not None:
            result['buyer_phone'] = self.buyer_phone
        if self.buyer_name is not None:
            result['buyer_name'] = self.buyer_name
        if self.buyer_id_number is not None:
            result['buyer_id_number'] = self.buyer_id_number
        if self.buyer_id_type is not None:
            result['buyer_id_type'] = self.buyer_id_type
        if self.buye_ip is not None:
            result['buye_ip'] = self.buye_ip
        if self.origin_create_time is not None:
            result['origin_create_time'] = self.origin_create_time
        if self.origin_order_id is not None:
            result['origin_order_id'] = self.origin_order_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('order_id') is not None:
            self.order_id = m.get('order_id')
        if m.get('instruction_type') is not None:
            self.instruction_type = m.get('instruction_type')
        if m.get('buyer_account_id') is not None:
            self.buyer_account_id = m.get('buyer_account_id')
        if m.get('seller_account_id') is not None:
            self.seller_account_id = m.get('seller_account_id')
        if m.get('platform_id') is not None:
            self.platform_id = m.get('platform_id')
        if m.get('goods_id') is not None:
            self.goods_id = m.get('goods_id')
        if m.get('display_name') is not None:
            self.display_name = m.get('display_name')
        if m.get('seller_price') is not None:
            self.seller_price = m.get('seller_price')
        if m.get('display_price') is not None:
            self.display_price = m.get('display_price')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('remark') is not None:
            self.remark = m.get('remark')
        if m.get('status') is not None:
            self.status = m.get('status')
        if m.get('refund_status') is not None:
            self.refund_status = m.get('refund_status')
        if m.get('create_timestamp') is not None:
            self.create_timestamp = m.get('create_timestamp')
        if m.get('pay_timestamp') is not None:
            self.pay_timestamp = m.get('pay_timestamp')
        self.extra_data = []
        if m.get('extra_data') is not None:
            for k in m.get('extra_data'):
                temp_model = MetaDataDO()
                self.extra_data.append(temp_model.from_map(k))
        self.token_instructions = []
        if m.get('token_instructions') is not None:
            for k in m.get('token_instructions'):
                temp_model = TokenInstructionDO()
                self.token_instructions.append(temp_model.from_map(k))
        if m.get('related_order_id') is not None:
            self.related_order_id = m.get('related_order_id')
        if m.get('commission_token') is not None:
            self.commission_token = m.get('commission_token')
        if m.get('seller_receive_token') is not None:
            self.seller_receive_token = m.get('seller_receive_token')
        if m.get('pay_commission_type') is not None:
            self.pay_commission_type = m.get('pay_commission_type')
        if m.get('buyer_phone') is not None:
            self.buyer_phone = m.get('buyer_phone')
        if m.get('buyer_name') is not None:
            self.buyer_name = m.get('buyer_name')
        if m.get('buyer_id_number') is not None:
            self.buyer_id_number = m.get('buyer_id_number')
        if m.get('buyer_id_type') is not None:
            self.buyer_id_type = m.get('buyer_id_type')
        if m.get('buye_ip') is not None:
            self.buye_ip = m.get('buye_ip')
        if m.get('origin_create_time') is not None:
            self.origin_create_time = m.get('origin_create_time')
        if m.get('origin_order_id') is not None:
            self.origin_order_id = m.get('origin_order_id')
        return self


class APIWhiteListInfo(TeaModel):
    def __init__(
        self,
        tenant_id: str = None,
        chain_id: str = None,
        level: int = None,
        update_time: str = None,
        extension: str = None,
    ):
        # 租户ID
        self.tenant_id = tenant_id
        # 链ID
        self.chain_id = chain_id
        # 权限级别，暂时不用
        self.level = level
        # 更新时间
        self.update_time = update_time
        # 扩展字段
        self.extension = extension

    def validate(self):
        self.validate_required(self.tenant_id, 'tenant_id')
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.level, 'level')
        self.validate_required(self.update_time, 'update_time')
        self.validate_required(self.extension, 'extension')

    def to_map(self):
        result = dict()
        if self.tenant_id is not None:
            result['tenant_id'] = self.tenant_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.level is not None:
            result['level'] = self.level
        if self.update_time is not None:
            result['update_time'] = self.update_time
        if self.extension is not None:
            result['extension'] = self.extension
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('tenant_id') is not None:
            self.tenant_id = m.get('tenant_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('level') is not None:
            self.level = m.get('level')
        if m.get('update_time') is not None:
            self.update_time = m.get('update_time')
        if m.get('extension') is not None:
            self.extension = m.get('extension')
        return self


class EInstruction(TeaModel):
    def __init__(
        self,
        asset_id: str = None,
        asset_rate: str = None,
        deduct_asset_amount: str = None,
        deduct_credit_amount: str = None,
        deduct_debit_amount: str = None,
        deduct_tenant_id: str = None,
        equity_id: str = None,
        equity_name: str = None,
        equity_price: str = None,
        equity_value: str = None,
        memo: str = None,
        opt_tenant_id: str = None,
        out_tx_id: str = None,
        status: int = None,
        tenant_id: str = None,
        time_stamp: int = None,
        type: int = None,
        user_id: str = None,
        instruction_version: int = None,
        commission_tenant_id: str = None,
        instruction_commission: str = None,
        deduct_debit_commission: str = None,
        deduct_credit_commission: str = None,
        deduct_asset_commission: str = None,
        commission_rate: str = None,
        commission_id: str = None,
        commission_sub_id: str = None,
        commission_status: int = None,
        commission_charged: int = None,
    ):
        # 资产ID
        self.asset_id = asset_id
        # 资产的汇率
        self.asset_rate = asset_rate
        # 资产扣减数量(单位:个)
        self.deduct_asset_amount = deduct_asset_amount
        # 扣减商户备付金授信额(单位:元)
        self.deduct_credit_amount = deduct_credit_amount
        # 扣减商户备付金余额(单位:元)
        self.deduct_debit_amount = deduct_debit_amount
        # 被扣减备付金的租户ID
        self.deduct_tenant_id = deduct_tenant_id
        # 权益ID
        self.equity_id = equity_id
        # 权益名称
        self.equity_name = equity_name
        # 权益对用户价格(单位:元)
        self.equity_price = equity_price
        # 权益面值(单位:元)
        self.equity_value = equity_value
        # 附言Deliver/Complete/OutOfStore/WriteOff)
        self.memo = memo
        # 发起操作的租户ID
        self.opt_tenant_id = opt_tenant_id
        # 业务交易ID
        self.out_tx_id = out_tx_id
        # 对换单流水状态：
        # 0        // 权益兑换单创建
        # 1        // 权益兑换单接单
        # 2        // 权益兑换单发货
        # 3        // 权益兑换单确认收货
        # 4        // 权益兑换单缺货
        # 5        // 权益兑换单核销
        self.status = status
        # 权益归属租户ID
        self.tenant_id = tenant_id
        # 交易时间戳
        self.time_stamp = time_stamp
        # 兑换类型(商户身份/用户身份)
        self.type = type
        # 用户身份兑换/商户兑换的受益用户
        self.user_id = user_id
        # 版本（之前版本为0，不收取手续费，之后版本为1，收取手续费）
        self.instruction_version = instruction_version
        # 收取手续费的金融云租户ID
        self.commission_tenant_id = commission_tenant_id
        # 手续费(单位:元)
        self.instruction_commission = instruction_commission
        # 手续费扣减商户备付金余额(单位:元)
        self.deduct_debit_commission = deduct_debit_commission
        # 手续费扣减商户备付金授信额(单位:元)
        self.deduct_credit_commission = deduct_credit_commission
        # 资产手续费扣减数量(单位:个)
        self.deduct_asset_commission = deduct_asset_commission
        # 手续费率
        self.commission_rate = commission_rate
        # 手续费id
        self.commission_id = commission_id
        # 手续费子id
        self.commission_sub_id = commission_sub_id
        # 手续费状态（0:未提现，1:已提现）
        self.commission_status = commission_status
        # 是否收取手续费
        self.commission_charged = commission_charged

    def validate(self):
        self.validate_required(self.asset_id, 'asset_id')
        self.validate_required(self.asset_rate, 'asset_rate')
        self.validate_required(self.deduct_asset_amount, 'deduct_asset_amount')
        self.validate_required(self.deduct_credit_amount, 'deduct_credit_amount')
        self.validate_required(self.deduct_debit_amount, 'deduct_debit_amount')
        self.validate_required(self.deduct_tenant_id, 'deduct_tenant_id')
        self.validate_required(self.equity_id, 'equity_id')
        self.validate_required(self.equity_name, 'equity_name')
        self.validate_required(self.equity_price, 'equity_price')
        self.validate_required(self.equity_value, 'equity_value')
        self.validate_required(self.memo, 'memo')
        self.validate_required(self.opt_tenant_id, 'opt_tenant_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')
        self.validate_required(self.status, 'status')
        self.validate_required(self.tenant_id, 'tenant_id')
        self.validate_required(self.time_stamp, 'time_stamp')
        self.validate_required(self.type, 'type')
        self.validate_required(self.user_id, 'user_id')
        self.validate_required(self.instruction_version, 'instruction_version')
        self.validate_required(self.commission_tenant_id, 'commission_tenant_id')
        self.validate_required(self.instruction_commission, 'instruction_commission')
        self.validate_required(self.deduct_debit_commission, 'deduct_debit_commission')
        self.validate_required(self.deduct_credit_commission, 'deduct_credit_commission')
        self.validate_required(self.deduct_asset_commission, 'deduct_asset_commission')
        self.validate_required(self.commission_rate, 'commission_rate')
        self.validate_required(self.commission_id, 'commission_id')
        self.validate_required(self.commission_sub_id, 'commission_sub_id')
        self.validate_required(self.commission_status, 'commission_status')
        self.validate_required(self.commission_charged, 'commission_charged')

    def to_map(self):
        result = dict()
        if self.asset_id is not None:
            result['asset_id'] = self.asset_id
        if self.asset_rate is not None:
            result['asset_rate'] = self.asset_rate
        if self.deduct_asset_amount is not None:
            result['deduct_asset_amount'] = self.deduct_asset_amount
        if self.deduct_credit_amount is not None:
            result['deduct_credit_amount'] = self.deduct_credit_amount
        if self.deduct_debit_amount is not None:
            result['deduct_debit_amount'] = self.deduct_debit_amount
        if self.deduct_tenant_id is not None:
            result['deduct_tenant_id'] = self.deduct_tenant_id
        if self.equity_id is not None:
            result['equity_id'] = self.equity_id
        if self.equity_name is not None:
            result['equity_name'] = self.equity_name
        if self.equity_price is not None:
            result['equity_price'] = self.equity_price
        if self.equity_value is not None:
            result['equity_value'] = self.equity_value
        if self.memo is not None:
            result['memo'] = self.memo
        if self.opt_tenant_id is not None:
            result['opt_tenant_id'] = self.opt_tenant_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        if self.status is not None:
            result['status'] = self.status
        if self.tenant_id is not None:
            result['tenant_id'] = self.tenant_id
        if self.time_stamp is not None:
            result['time_stamp'] = self.time_stamp
        if self.type is not None:
            result['type'] = self.type
        if self.user_id is not None:
            result['user_id'] = self.user_id
        if self.instruction_version is not None:
            result['instruction_version'] = self.instruction_version
        if self.commission_tenant_id is not None:
            result['commission_tenant_id'] = self.commission_tenant_id
        if self.instruction_commission is not None:
            result['instruction_commission'] = self.instruction_commission
        if self.deduct_debit_commission is not None:
            result['deduct_debit_commission'] = self.deduct_debit_commission
        if self.deduct_credit_commission is not None:
            result['deduct_credit_commission'] = self.deduct_credit_commission
        if self.deduct_asset_commission is not None:
            result['deduct_asset_commission'] = self.deduct_asset_commission
        if self.commission_rate is not None:
            result['commission_rate'] = self.commission_rate
        if self.commission_id is not None:
            result['commission_id'] = self.commission_id
        if self.commission_sub_id is not None:
            result['commission_sub_id'] = self.commission_sub_id
        if self.commission_status is not None:
            result['commission_status'] = self.commission_status
        if self.commission_charged is not None:
            result['commission_charged'] = self.commission_charged
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('asset_id') is not None:
            self.asset_id = m.get('asset_id')
        if m.get('asset_rate') is not None:
            self.asset_rate = m.get('asset_rate')
        if m.get('deduct_asset_amount') is not None:
            self.deduct_asset_amount = m.get('deduct_asset_amount')
        if m.get('deduct_credit_amount') is not None:
            self.deduct_credit_amount = m.get('deduct_credit_amount')
        if m.get('deduct_debit_amount') is not None:
            self.deduct_debit_amount = m.get('deduct_debit_amount')
        if m.get('deduct_tenant_id') is not None:
            self.deduct_tenant_id = m.get('deduct_tenant_id')
        if m.get('equity_id') is not None:
            self.equity_id = m.get('equity_id')
        if m.get('equity_name') is not None:
            self.equity_name = m.get('equity_name')
        if m.get('equity_price') is not None:
            self.equity_price = m.get('equity_price')
        if m.get('equity_value') is not None:
            self.equity_value = m.get('equity_value')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('opt_tenant_id') is not None:
            self.opt_tenant_id = m.get('opt_tenant_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        if m.get('status') is not None:
            self.status = m.get('status')
        if m.get('tenant_id') is not None:
            self.tenant_id = m.get('tenant_id')
        if m.get('time_stamp') is not None:
            self.time_stamp = m.get('time_stamp')
        if m.get('type') is not None:
            self.type = m.get('type')
        if m.get('user_id') is not None:
            self.user_id = m.get('user_id')
        if m.get('instruction_version') is not None:
            self.instruction_version = m.get('instruction_version')
        if m.get('commission_tenant_id') is not None:
            self.commission_tenant_id = m.get('commission_tenant_id')
        if m.get('instruction_commission') is not None:
            self.instruction_commission = m.get('instruction_commission')
        if m.get('deduct_debit_commission') is not None:
            self.deduct_debit_commission = m.get('deduct_debit_commission')
        if m.get('deduct_credit_commission') is not None:
            self.deduct_credit_commission = m.get('deduct_credit_commission')
        if m.get('deduct_asset_commission') is not None:
            self.deduct_asset_commission = m.get('deduct_asset_commission')
        if m.get('commission_rate') is not None:
            self.commission_rate = m.get('commission_rate')
        if m.get('commission_id') is not None:
            self.commission_id = m.get('commission_id')
        if m.get('commission_sub_id') is not None:
            self.commission_sub_id = m.get('commission_sub_id')
        if m.get('commission_status') is not None:
            self.commission_status = m.get('commission_status')
        if m.get('commission_charged') is not None:
            self.commission_charged = m.get('commission_charged')
        return self


class IpBasicInfoWithChannelInfo(TeaModel):
    def __init__(
        self,
        ip_basic_info: IpBasicInfo = None,
        ip_channal_infos: List[IpChannelWithSku] = None,
    ):
        # ip的基础信息
        self.ip_basic_info = ip_basic_info
        # ip的渠道信息和sku信息
        self.ip_channal_infos = ip_channal_infos

    def validate(self):
        self.validate_required(self.ip_basic_info, 'ip_basic_info')
        if self.ip_basic_info:
            self.ip_basic_info.validate()
        self.validate_required(self.ip_channal_infos, 'ip_channal_infos')
        if self.ip_channal_infos:
            for k in self.ip_channal_infos:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.ip_basic_info is not None:
            result['ip_basic_info'] = self.ip_basic_info.to_map()
        result['ip_channal_infos'] = []
        if self.ip_channal_infos is not None:
            for k in self.ip_channal_infos:
                result['ip_channal_infos'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('ip_basic_info') is not None:
            temp_model = IpBasicInfo()
            self.ip_basic_info = temp_model.from_map(m['ip_basic_info'])
        self.ip_channal_infos = []
        if m.get('ip_channal_infos') is not None:
            for k in m.get('ip_channal_infos'):
                temp_model = IpChannelWithSku()
                self.ip_channal_infos.append(temp_model.from_map(k))
        return self


class IpAllInfo(TeaModel):
    def __init__(
        self,
        ip_basic_info: IpBasicInfo = None,
        ip_channal_info: List[IpChannelWithSku] = None,
        is_update: bool = None,
    ):
        # ip的基础信息
        self.ip_basic_info = ip_basic_info
        # ip的渠道信息带上sku信息
        self.ip_channal_info = ip_channal_info
        # 是否有更新数据
        self.is_update = is_update

    def validate(self):
        self.validate_required(self.ip_basic_info, 'ip_basic_info')
        if self.ip_basic_info:
            self.ip_basic_info.validate()
        self.validate_required(self.ip_channal_info, 'ip_channal_info')
        if self.ip_channal_info:
            for k in self.ip_channal_info:
                if k:
                    k.validate()
        self.validate_required(self.is_update, 'is_update')

    def to_map(self):
        result = dict()
        if self.ip_basic_info is not None:
            result['ip_basic_info'] = self.ip_basic_info.to_map()
        result['ip_channal_info'] = []
        if self.ip_channal_info is not None:
            for k in self.ip_channal_info:
                result['ip_channal_info'].append(k.to_map() if k else None)
        if self.is_update is not None:
            result['is_update'] = self.is_update
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('ip_basic_info') is not None:
            temp_model = IpBasicInfo()
            self.ip_basic_info = temp_model.from_map(m['ip_basic_info'])
        self.ip_channal_info = []
        if m.get('ip_channal_info') is not None:
            for k in m.get('ip_channal_info'):
                temp_model = IpChannelWithSku()
                self.ip_channal_info.append(temp_model.from_map(k))
        if m.get('is_update') is not None:
            self.is_update = m.get('is_update')
        return self


class Equity(TeaModel):
    def __init__(
        self,
        admin_id: str = None,
        auth_type: int = None,
        currency: str = None,
        default_price: str = None,
        description: str = None,
        desc_images: str = None,
        equity_ext_info: EquityExtInfo = None,
        equity_id: str = None,
        equity_name: str = None,
        equity_type: str = None,
        images: str = None,
        is_public: bool = None,
        limit_per_merchant_and_day: int = None,
        limit_per_merchant_and_month: int = None,
        limit_per_user_and_day: int = None,
        limit_per_user_and_month: int = None,
        memo: str = None,
        status: int = None,
        tenant_id: str = None,
        total_count: str = None,
        use_valid_not_after: int = None,
        use_valid_not_before: int = None,
        valid_not_after: int = None,
        valid_not_before: int = None,
        value: str = None,
        commission_accepted: int = None,
    ):
        # 权益管理员ID
        self.admin_id = admin_id
        # 权益授权类型
        self.auth_type = auth_type
        # 权益锚定币种
        self.currency = currency
        # 权益默认价格
        self.default_price = default_price
        # 权益描述
        self.description = description
        # 权益描述图片OSS地址 分号分隔
        self.desc_images = desc_images
        # 权益附属信息
        self.equity_ext_info = equity_ext_info
        # 权益ID
        self.equity_id = equity_id
        # 权益名称
        self.equity_name = equity_name
        # 商品类型，详见数字商品公约https://tech.antfin.com/docs/2/163896
        self.equity_type = equity_type
        # 权益主图片OSS地址 分号;分隔
        self.images = images
        # 是否为公开权益
        self.is_public = is_public
        # 商户每日兑换上限
        self.limit_per_merchant_and_day = limit_per_merchant_and_day
        # 商户每月兑换上限
        self.limit_per_merchant_and_month = limit_per_merchant_and_month
        # 用户每日兑换上限
        self.limit_per_user_and_day = limit_per_user_and_day
        # 用户每月兑换上限
        self.limit_per_user_and_month = limit_per_user_and_month
        # 附言
        self.memo = memo
        # 权益状态
        self.status = status
        # 租户ID
        self.tenant_id = tenant_id
        # 权益库存
        self.total_count = total_count
        # 权益使用有效期右闭区间
        self.use_valid_not_after = use_valid_not_after
        # 权益使用有效期左闭区间
        self.use_valid_not_before = use_valid_not_before
        # 权益兑换有效期右闭区间
        self.valid_not_after = valid_not_after
        # 权益兑换有效期左闭区间
        self.valid_not_before = valid_not_before
        # 权益面值
        self.value = value
        # 是否计算手续费（0: 更新手续费版本前不在合约计算手续费，1: 在合约计算手续费）
        self.commission_accepted = commission_accepted

    def validate(self):
        self.validate_required(self.admin_id, 'admin_id')
        self.validate_required(self.auth_type, 'auth_type')
        self.validate_required(self.currency, 'currency')
        self.validate_required(self.default_price, 'default_price')
        self.validate_required(self.description, 'description')
        self.validate_required(self.desc_images, 'desc_images')
        self.validate_required(self.equity_ext_info, 'equity_ext_info')
        if self.equity_ext_info:
            self.equity_ext_info.validate()
        self.validate_required(self.equity_id, 'equity_id')
        self.validate_required(self.equity_name, 'equity_name')
        self.validate_required(self.equity_type, 'equity_type')
        self.validate_required(self.images, 'images')
        self.validate_required(self.is_public, 'is_public')
        self.validate_required(self.limit_per_merchant_and_day, 'limit_per_merchant_and_day')
        self.validate_required(self.limit_per_merchant_and_month, 'limit_per_merchant_and_month')
        self.validate_required(self.limit_per_user_and_day, 'limit_per_user_and_day')
        self.validate_required(self.limit_per_user_and_month, 'limit_per_user_and_month')
        self.validate_required(self.memo, 'memo')
        self.validate_required(self.status, 'status')
        self.validate_required(self.tenant_id, 'tenant_id')
        self.validate_required(self.total_count, 'total_count')
        self.validate_required(self.use_valid_not_after, 'use_valid_not_after')
        self.validate_required(self.use_valid_not_before, 'use_valid_not_before')
        self.validate_required(self.valid_not_after, 'valid_not_after')
        self.validate_required(self.valid_not_before, 'valid_not_before')
        self.validate_required(self.value, 'value')
        self.validate_required(self.commission_accepted, 'commission_accepted')

    def to_map(self):
        result = dict()
        if self.admin_id is not None:
            result['admin_id'] = self.admin_id
        if self.auth_type is not None:
            result['auth_type'] = self.auth_type
        if self.currency is not None:
            result['currency'] = self.currency
        if self.default_price is not None:
            result['default_price'] = self.default_price
        if self.description is not None:
            result['description'] = self.description
        if self.desc_images is not None:
            result['desc_images'] = self.desc_images
        if self.equity_ext_info is not None:
            result['equity_ext_info'] = self.equity_ext_info.to_map()
        if self.equity_id is not None:
            result['equity_id'] = self.equity_id
        if self.equity_name is not None:
            result['equity_name'] = self.equity_name
        if self.equity_type is not None:
            result['equity_type'] = self.equity_type
        if self.images is not None:
            result['images'] = self.images
        if self.is_public is not None:
            result['is_public'] = self.is_public
        if self.limit_per_merchant_and_day is not None:
            result['limit_per_merchant_and_day'] = self.limit_per_merchant_and_day
        if self.limit_per_merchant_and_month is not None:
            result['limit_per_merchant_and_month'] = self.limit_per_merchant_and_month
        if self.limit_per_user_and_day is not None:
            result['limit_per_user_and_day'] = self.limit_per_user_and_day
        if self.limit_per_user_and_month is not None:
            result['limit_per_user_and_month'] = self.limit_per_user_and_month
        if self.memo is not None:
            result['memo'] = self.memo
        if self.status is not None:
            result['status'] = self.status
        if self.tenant_id is not None:
            result['tenant_id'] = self.tenant_id
        if self.total_count is not None:
            result['total_count'] = self.total_count
        if self.use_valid_not_after is not None:
            result['use_valid_not_after'] = self.use_valid_not_after
        if self.use_valid_not_before is not None:
            result['use_valid_not_before'] = self.use_valid_not_before
        if self.valid_not_after is not None:
            result['valid_not_after'] = self.valid_not_after
        if self.valid_not_before is not None:
            result['valid_not_before'] = self.valid_not_before
        if self.value is not None:
            result['value'] = self.value
        if self.commission_accepted is not None:
            result['commission_accepted'] = self.commission_accepted
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('admin_id') is not None:
            self.admin_id = m.get('admin_id')
        if m.get('auth_type') is not None:
            self.auth_type = m.get('auth_type')
        if m.get('currency') is not None:
            self.currency = m.get('currency')
        if m.get('default_price') is not None:
            self.default_price = m.get('default_price')
        if m.get('description') is not None:
            self.description = m.get('description')
        if m.get('desc_images') is not None:
            self.desc_images = m.get('desc_images')
        if m.get('equity_ext_info') is not None:
            temp_model = EquityExtInfo()
            self.equity_ext_info = temp_model.from_map(m['equity_ext_info'])
        if m.get('equity_id') is not None:
            self.equity_id = m.get('equity_id')
        if m.get('equity_name') is not None:
            self.equity_name = m.get('equity_name')
        if m.get('equity_type') is not None:
            self.equity_type = m.get('equity_type')
        if m.get('images') is not None:
            self.images = m.get('images')
        if m.get('is_public') is not None:
            self.is_public = m.get('is_public')
        if m.get('limit_per_merchant_and_day') is not None:
            self.limit_per_merchant_and_day = m.get('limit_per_merchant_and_day')
        if m.get('limit_per_merchant_and_month') is not None:
            self.limit_per_merchant_and_month = m.get('limit_per_merchant_and_month')
        if m.get('limit_per_user_and_day') is not None:
            self.limit_per_user_and_day = m.get('limit_per_user_and_day')
        if m.get('limit_per_user_and_month') is not None:
            self.limit_per_user_and_month = m.get('limit_per_user_and_month')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('status') is not None:
            self.status = m.get('status')
        if m.get('tenant_id') is not None:
            self.tenant_id = m.get('tenant_id')
        if m.get('total_count') is not None:
            self.total_count = m.get('total_count')
        if m.get('use_valid_not_after') is not None:
            self.use_valid_not_after = m.get('use_valid_not_after')
        if m.get('use_valid_not_before') is not None:
            self.use_valid_not_before = m.get('use_valid_not_before')
        if m.get('valid_not_after') is not None:
            self.valid_not_after = m.get('valid_not_after')
        if m.get('valid_not_before') is not None:
            self.valid_not_before = m.get('valid_not_before')
        if m.get('value') is not None:
            self.value = m.get('value')
        if m.get('commission_accepted') is not None:
            self.commission_accepted = m.get('commission_accepted')
        return self


class ConsumeCardAccount(TeaModel):
    def __init__(
        self,
        authorization_address: str = None,
        certification_id: str = None,
        description: str = None,
        did: str = None,
        auth_consumer: bool = None,
        auth_provider: bool = None,
        id_number: str = None,
        id_type: int = None,
        phone_number: str = None,
        status: int = None,
        token_issuer: bool = None,
        type: int = None,
        user_id: str = None,
        user_name: str = None,
        withdraw_bank_card_id: str = None,
        image: str = None,
        email: str = None,
    ):
        # 授权函地址
        self.authorization_address = authorization_address
        # 认证方id
        self.certification_id = certification_id
        # 描述
        self.description = description
        # 分布式身份ID
        self.did = did
        # 是否有权限采购商品
        self.auth_consumer = auth_consumer
        # 是否有权限发行商品
        self.auth_provider = auth_provider
        # 个人用户的身份证号码/机构的企业编号
        self.id_number = id_number
        # 证件类型：0 身份证, 1 护照, 2 军官证, 3 回乡证, 4 港澳证件, 5 营业执照, 6 港澳居民来往内地通行证, 7 台湾居民来往内地通行证, 8 港澳居民居住证, 9 台湾居民居住证, 10事业单位登记证书, 11 社会团体登记证书, 12 民办非企业单位证书, 13 党政机关批准设计文件, 14 全国组织机构代码证书, 15 其他证件
        self.id_type = id_type
        # 个人用户的手机号码/机构用户的联系电话或邮箱(必填)
        self.phone_number = phone_number
        # 商户状态
        self.status = status
        # 是否可以发行资产
        self.token_issuer = token_issuer
        # 账户创建类型（0:用户，1:商户）
        self.type = type
        # 账户ID
        self.user_id = user_id
        # 账户名称
        self.user_name = user_name
        # 提现银行卡
        self.withdraw_bank_card_id = withdraw_bank_card_id
        # 账户影响信息
        self.image = image
        # 账户邮箱
        self.email = email

    def validate(self):
        self.validate_required(self.authorization_address, 'authorization_address')
        self.validate_required(self.certification_id, 'certification_id')
        self.validate_required(self.description, 'description')
        self.validate_required(self.did, 'did')
        self.validate_required(self.auth_consumer, 'auth_consumer')
        self.validate_required(self.auth_provider, 'auth_provider')
        self.validate_required(self.id_number, 'id_number')
        self.validate_required(self.id_type, 'id_type')
        self.validate_required(self.phone_number, 'phone_number')
        self.validate_required(self.status, 'status')
        self.validate_required(self.token_issuer, 'token_issuer')
        self.validate_required(self.type, 'type')
        self.validate_required(self.user_id, 'user_id')
        self.validate_required(self.user_name, 'user_name')
        self.validate_required(self.withdraw_bank_card_id, 'withdraw_bank_card_id')
        self.validate_required(self.image, 'image')
        self.validate_required(self.email, 'email')

    def to_map(self):
        result = dict()
        if self.authorization_address is not None:
            result['authorization_address'] = self.authorization_address
        if self.certification_id is not None:
            result['certification_id'] = self.certification_id
        if self.description is not None:
            result['description'] = self.description
        if self.did is not None:
            result['did'] = self.did
        if self.auth_consumer is not None:
            result['auth_consumer'] = self.auth_consumer
        if self.auth_provider is not None:
            result['auth_provider'] = self.auth_provider
        if self.id_number is not None:
            result['id_number'] = self.id_number
        if self.id_type is not None:
            result['id_type'] = self.id_type
        if self.phone_number is not None:
            result['phone_number'] = self.phone_number
        if self.status is not None:
            result['status'] = self.status
        if self.token_issuer is not None:
            result['token_issuer'] = self.token_issuer
        if self.type is not None:
            result['type'] = self.type
        if self.user_id is not None:
            result['user_id'] = self.user_id
        if self.user_name is not None:
            result['user_name'] = self.user_name
        if self.withdraw_bank_card_id is not None:
            result['withdraw_bank_card_id'] = self.withdraw_bank_card_id
        if self.image is not None:
            result['image'] = self.image
        if self.email is not None:
            result['email'] = self.email
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('authorization_address') is not None:
            self.authorization_address = m.get('authorization_address')
        if m.get('certification_id') is not None:
            self.certification_id = m.get('certification_id')
        if m.get('description') is not None:
            self.description = m.get('description')
        if m.get('did') is not None:
            self.did = m.get('did')
        if m.get('auth_consumer') is not None:
            self.auth_consumer = m.get('auth_consumer')
        if m.get('auth_provider') is not None:
            self.auth_provider = m.get('auth_provider')
        if m.get('id_number') is not None:
            self.id_number = m.get('id_number')
        if m.get('id_type') is not None:
            self.id_type = m.get('id_type')
        if m.get('phone_number') is not None:
            self.phone_number = m.get('phone_number')
        if m.get('status') is not None:
            self.status = m.get('status')
        if m.get('token_issuer') is not None:
            self.token_issuer = m.get('token_issuer')
        if m.get('type') is not None:
            self.type = m.get('type')
        if m.get('user_id') is not None:
            self.user_id = m.get('user_id')
        if m.get('user_name') is not None:
            self.user_name = m.get('user_name')
        if m.get('withdraw_bank_card_id') is not None:
            self.withdraw_bank_card_id = m.get('withdraw_bank_card_id')
        if m.get('image') is not None:
            self.image = m.get('image')
        if m.get('email') is not None:
            self.email = m.get('email')
        return self


class CouponCreate(TeaModel):
    def __init__(
        self,
        collection_id: str = None,
        value: str = None,
        coupon_name: str = None,
        desensitized_uid: str = None,
        ext_info: str = None,
        holder_user_account: str = None,
        public_key: str = None,
        time_zone: str = None,
        uid_public_key: str = None,
        valid_after: int = None,
        valid_before: int = None,
    ):
        # 电子券批次ID
        self.collection_id = collection_id
        # 电子券价值
        self.value = value
        # 电子券名称
        self.coupon_name = coupon_name
        # 用户脱敏ID
        self.desensitized_uid = desensitized_uid
        # 扩展信息
        self.ext_info = ext_info
        # 持有者ID
        self.holder_user_account = holder_user_account
        # 电子券公钥
        self.public_key = public_key
        # 时区（暂时固定为GMT+8）
        self.time_zone = time_zone
        # 用户公钥
        self.uid_public_key = uid_public_key
        # 有效开始时间
        self.valid_after = valid_after
        # 有效结束时间
        self.valid_before = valid_before

    def validate(self):
        self.validate_required(self.collection_id, 'collection_id')
        self.validate_required(self.value, 'value')
        self.validate_required(self.coupon_name, 'coupon_name')
        self.validate_required(self.ext_info, 'ext_info')
        self.validate_required(self.public_key, 'public_key')
        self.validate_required(self.time_zone, 'time_zone')
        self.validate_required(self.valid_after, 'valid_after')
        self.validate_required(self.valid_before, 'valid_before')

    def to_map(self):
        result = dict()
        if self.collection_id is not None:
            result['collection_id'] = self.collection_id
        if self.value is not None:
            result['value'] = self.value
        if self.coupon_name is not None:
            result['coupon_name'] = self.coupon_name
        if self.desensitized_uid is not None:
            result['desensitized_uid'] = self.desensitized_uid
        if self.ext_info is not None:
            result['ext_info'] = self.ext_info
        if self.holder_user_account is not None:
            result['holder_user_account'] = self.holder_user_account
        if self.public_key is not None:
            result['public_key'] = self.public_key
        if self.time_zone is not None:
            result['time_zone'] = self.time_zone
        if self.uid_public_key is not None:
            result['uid_public_key'] = self.uid_public_key
        if self.valid_after is not None:
            result['valid_after'] = self.valid_after
        if self.valid_before is not None:
            result['valid_before'] = self.valid_before
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('collection_id') is not None:
            self.collection_id = m.get('collection_id')
        if m.get('value') is not None:
            self.value = m.get('value')
        if m.get('coupon_name') is not None:
            self.coupon_name = m.get('coupon_name')
        if m.get('desensitized_uid') is not None:
            self.desensitized_uid = m.get('desensitized_uid')
        if m.get('ext_info') is not None:
            self.ext_info = m.get('ext_info')
        if m.get('holder_user_account') is not None:
            self.holder_user_account = m.get('holder_user_account')
        if m.get('public_key') is not None:
            self.public_key = m.get('public_key')
        if m.get('time_zone') is not None:
            self.time_zone = m.get('time_zone')
        if m.get('uid_public_key') is not None:
            self.uid_public_key = m.get('uid_public_key')
        if m.get('valid_after') is not None:
            self.valid_after = m.get('valid_after')
        if m.get('valid_before') is not None:
            self.valid_before = m.get('valid_before')
        return self


class Asset(TeaModel):
    def __init__(
        self,
        admin_id: str = None,
        asset_ext_info: AssetExtInfo = None,
        asset_id: str = None,
        asset_name: str = None,
        asset_rate: str = None,
        currency: str = None,
        issue_account_balance: str = None,
        overdue_recovery_account_balance: str = None,
        receive_payment_account_balance: str = None,
        relay_account_balance: str = None,
        status: int = None,
        tenant_id: str = None,
        total_issue_balance: str = None,
    ):
        # 资产管理员ID
        self.admin_id = admin_id
        # 资产附属信息
        self.asset_ext_info = asset_ext_info
        # 资产ID
        self.asset_id = asset_id
        # 资产名称
        self.asset_name = asset_name
        # 资产汇率
        self.asset_rate = asset_rate
        # 币种
        self.currency = currency
        # 发行账户余额
        self.issue_account_balance = issue_account_balance
        # 过期回收账户余额
        self.overdue_recovery_account_balance = overdue_recovery_account_balance
        # 支付收款账户余额
        self.receive_payment_account_balance = receive_payment_account_balance
        # 中继账户余额
        self.relay_account_balance = relay_account_balance
        # 资产状态
        self.status = status
        # 租户ID
        self.tenant_id = tenant_id
        # 资产总发行量
        self.total_issue_balance = total_issue_balance

    def validate(self):
        self.validate_required(self.admin_id, 'admin_id')
        self.validate_required(self.asset_ext_info, 'asset_ext_info')
        if self.asset_ext_info:
            self.asset_ext_info.validate()
        self.validate_required(self.asset_id, 'asset_id')
        self.validate_required(self.asset_name, 'asset_name')
        self.validate_required(self.asset_rate, 'asset_rate')
        self.validate_required(self.currency, 'currency')
        self.validate_required(self.issue_account_balance, 'issue_account_balance')
        self.validate_required(self.overdue_recovery_account_balance, 'overdue_recovery_account_balance')
        self.validate_required(self.receive_payment_account_balance, 'receive_payment_account_balance')
        self.validate_required(self.relay_account_balance, 'relay_account_balance')
        self.validate_required(self.status, 'status')
        self.validate_required(self.tenant_id, 'tenant_id')
        self.validate_required(self.total_issue_balance, 'total_issue_balance')

    def to_map(self):
        result = dict()
        if self.admin_id is not None:
            result['admin_id'] = self.admin_id
        if self.asset_ext_info is not None:
            result['asset_ext_info'] = self.asset_ext_info.to_map()
        if self.asset_id is not None:
            result['asset_id'] = self.asset_id
        if self.asset_name is not None:
            result['asset_name'] = self.asset_name
        if self.asset_rate is not None:
            result['asset_rate'] = self.asset_rate
        if self.currency is not None:
            result['currency'] = self.currency
        if self.issue_account_balance is not None:
            result['issue_account_balance'] = self.issue_account_balance
        if self.overdue_recovery_account_balance is not None:
            result['overdue_recovery_account_balance'] = self.overdue_recovery_account_balance
        if self.receive_payment_account_balance is not None:
            result['receive_payment_account_balance'] = self.receive_payment_account_balance
        if self.relay_account_balance is not None:
            result['relay_account_balance'] = self.relay_account_balance
        if self.status is not None:
            result['status'] = self.status
        if self.tenant_id is not None:
            result['tenant_id'] = self.tenant_id
        if self.total_issue_balance is not None:
            result['total_issue_balance'] = self.total_issue_balance
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('admin_id') is not None:
            self.admin_id = m.get('admin_id')
        if m.get('asset_ext_info') is not None:
            temp_model = AssetExtInfo()
            self.asset_ext_info = temp_model.from_map(m['asset_ext_info'])
        if m.get('asset_id') is not None:
            self.asset_id = m.get('asset_id')
        if m.get('asset_name') is not None:
            self.asset_name = m.get('asset_name')
        if m.get('asset_rate') is not None:
            self.asset_rate = m.get('asset_rate')
        if m.get('currency') is not None:
            self.currency = m.get('currency')
        if m.get('issue_account_balance') is not None:
            self.issue_account_balance = m.get('issue_account_balance')
        if m.get('overdue_recovery_account_balance') is not None:
            self.overdue_recovery_account_balance = m.get('overdue_recovery_account_balance')
        if m.get('receive_payment_account_balance') is not None:
            self.receive_payment_account_balance = m.get('receive_payment_account_balance')
        if m.get('relay_account_balance') is not None:
            self.relay_account_balance = m.get('relay_account_balance')
        if m.get('status') is not None:
            self.status = m.get('status')
        if m.get('tenant_id') is not None:
            self.tenant_id = m.get('tenant_id')
        if m.get('total_issue_balance') is not None:
            self.total_issue_balance = m.get('total_issue_balance')
        return self


class OpenedEquity(TeaModel):
    def __init__(
        self,
        admin_id: str = None,
        auth_type: str = None,
        currency: str = None,
        default_price: str = None,
        description: str = None,
        desc_images: str = None,
        equity_d: str = None,
        equity_name: str = None,
        equity_type: int = None,
        images: str = None,
        is_public: bool = None,
        limit_per_merchant_and_day: int = None,
        limit_per_merchant_and_month: int = None,
        limit_per_user_and_day: int = None,
        limit_per_user_and_month: int = None,
        memo: str = None,
        open_to_tenant_id: str = None,
        status: int = None,
        tenant_id: str = None,
        tenant_price: str = None,
        total_count: str = None,
        use_valid_not_after: int = None,
        use_valid_not_before: int = None,
        valid_not_after: int = None,
        valid_not_before: int = None,
        value: str = None,
    ):
        # 商户管理员ID
        self.admin_id = admin_id
        # 授权类型
        self.auth_type = auth_type
        # 币种
        self.currency = currency
        # 默认价格
        self.default_price = default_price
        # 权益详情
        self.description = description
        # 权益详情图片
        self.desc_images = desc_images
        # 权益ID
        self.equity_d = equity_d
        # 权益名称
        self.equity_name = equity_name
        # 权益类型
        self.equity_type = equity_type
        # 权益主图片
        self.images = images
        # 是否是公开权益
        self.is_public = is_public
        # 每日商户对换限制
        self.limit_per_merchant_and_day = limit_per_merchant_and_day
        # 每月商户对换限制
        self.limit_per_merchant_and_month = limit_per_merchant_and_month
        # 每日用户对换限制
        self.limit_per_user_and_day = limit_per_user_and_day
        # 每月用户对换限制
        self.limit_per_user_and_month = limit_per_user_and_month
        # 权益附言
        self.memo = memo
        # 被授权的租户ID
        self.open_to_tenant_id = open_to_tenant_id
        # 权益状态
        self.status = status
        # 租户ID
        self.tenant_id = tenant_id
        # 授权价格
        self.tenant_price = tenant_price
        # 库存
        self.total_count = total_count
        # 可用右区间
        self.use_valid_not_after = use_valid_not_after
        # 可用左区间
        self.use_valid_not_before = use_valid_not_before
        # 有效右区间
        self.valid_not_after = valid_not_after
        # 有效左时间
        self.valid_not_before = valid_not_before
        # 价值
        self.value = value

    def validate(self):
        self.validate_required(self.admin_id, 'admin_id')
        self.validate_required(self.auth_type, 'auth_type')
        self.validate_required(self.currency, 'currency')
        self.validate_required(self.default_price, 'default_price')
        self.validate_required(self.description, 'description')
        self.validate_required(self.desc_images, 'desc_images')
        self.validate_required(self.equity_d, 'equity_d')
        self.validate_required(self.equity_name, 'equity_name')
        self.validate_required(self.equity_type, 'equity_type')
        self.validate_required(self.images, 'images')
        self.validate_required(self.is_public, 'is_public')
        self.validate_required(self.limit_per_merchant_and_day, 'limit_per_merchant_and_day')
        self.validate_required(self.limit_per_merchant_and_month, 'limit_per_merchant_and_month')
        self.validate_required(self.limit_per_user_and_day, 'limit_per_user_and_day')
        self.validate_required(self.limit_per_user_and_month, 'limit_per_user_and_month')
        self.validate_required(self.memo, 'memo')
        self.validate_required(self.open_to_tenant_id, 'open_to_tenant_id')
        self.validate_required(self.status, 'status')
        self.validate_required(self.tenant_id, 'tenant_id')
        self.validate_required(self.tenant_price, 'tenant_price')
        self.validate_required(self.total_count, 'total_count')
        self.validate_required(self.use_valid_not_after, 'use_valid_not_after')
        self.validate_required(self.use_valid_not_before, 'use_valid_not_before')
        self.validate_required(self.valid_not_after, 'valid_not_after')
        self.validate_required(self.valid_not_before, 'valid_not_before')
        self.validate_required(self.value, 'value')

    def to_map(self):
        result = dict()
        if self.admin_id is not None:
            result['admin_id'] = self.admin_id
        if self.auth_type is not None:
            result['auth_type'] = self.auth_type
        if self.currency is not None:
            result['currency'] = self.currency
        if self.default_price is not None:
            result['default_price'] = self.default_price
        if self.description is not None:
            result['description'] = self.description
        if self.desc_images is not None:
            result['desc_images'] = self.desc_images
        if self.equity_d is not None:
            result['equity_d'] = self.equity_d
        if self.equity_name is not None:
            result['equity_name'] = self.equity_name
        if self.equity_type is not None:
            result['equity_type'] = self.equity_type
        if self.images is not None:
            result['images'] = self.images
        if self.is_public is not None:
            result['is_public'] = self.is_public
        if self.limit_per_merchant_and_day is not None:
            result['limit_per_merchant_and_day'] = self.limit_per_merchant_and_day
        if self.limit_per_merchant_and_month is not None:
            result['limit_per_merchant_and_month'] = self.limit_per_merchant_and_month
        if self.limit_per_user_and_day is not None:
            result['limit_per_user_and_day'] = self.limit_per_user_and_day
        if self.limit_per_user_and_month is not None:
            result['limit_per_user_and_month'] = self.limit_per_user_and_month
        if self.memo is not None:
            result['memo'] = self.memo
        if self.open_to_tenant_id is not None:
            result['open_to_tenant_id'] = self.open_to_tenant_id
        if self.status is not None:
            result['status'] = self.status
        if self.tenant_id is not None:
            result['tenant_id'] = self.tenant_id
        if self.tenant_price is not None:
            result['tenant_price'] = self.tenant_price
        if self.total_count is not None:
            result['total_count'] = self.total_count
        if self.use_valid_not_after is not None:
            result['use_valid_not_after'] = self.use_valid_not_after
        if self.use_valid_not_before is not None:
            result['use_valid_not_before'] = self.use_valid_not_before
        if self.valid_not_after is not None:
            result['valid_not_after'] = self.valid_not_after
        if self.valid_not_before is not None:
            result['valid_not_before'] = self.valid_not_before
        if self.value is not None:
            result['value'] = self.value
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('admin_id') is not None:
            self.admin_id = m.get('admin_id')
        if m.get('auth_type') is not None:
            self.auth_type = m.get('auth_type')
        if m.get('currency') is not None:
            self.currency = m.get('currency')
        if m.get('default_price') is not None:
            self.default_price = m.get('default_price')
        if m.get('description') is not None:
            self.description = m.get('description')
        if m.get('desc_images') is not None:
            self.desc_images = m.get('desc_images')
        if m.get('equity_d') is not None:
            self.equity_d = m.get('equity_d')
        if m.get('equity_name') is not None:
            self.equity_name = m.get('equity_name')
        if m.get('equity_type') is not None:
            self.equity_type = m.get('equity_type')
        if m.get('images') is not None:
            self.images = m.get('images')
        if m.get('is_public') is not None:
            self.is_public = m.get('is_public')
        if m.get('limit_per_merchant_and_day') is not None:
            self.limit_per_merchant_and_day = m.get('limit_per_merchant_and_day')
        if m.get('limit_per_merchant_and_month') is not None:
            self.limit_per_merchant_and_month = m.get('limit_per_merchant_and_month')
        if m.get('limit_per_user_and_day') is not None:
            self.limit_per_user_and_day = m.get('limit_per_user_and_day')
        if m.get('limit_per_user_and_month') is not None:
            self.limit_per_user_and_month = m.get('limit_per_user_and_month')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('open_to_tenant_id') is not None:
            self.open_to_tenant_id = m.get('open_to_tenant_id')
        if m.get('status') is not None:
            self.status = m.get('status')
        if m.get('tenant_id') is not None:
            self.tenant_id = m.get('tenant_id')
        if m.get('tenant_price') is not None:
            self.tenant_price = m.get('tenant_price')
        if m.get('total_count') is not None:
            self.total_count = m.get('total_count')
        if m.get('use_valid_not_after') is not None:
            self.use_valid_not_after = m.get('use_valid_not_after')
        if m.get('use_valid_not_before') is not None:
            self.use_valid_not_before = m.get('use_valid_not_before')
        if m.get('valid_not_after') is not None:
            self.valid_not_after = m.get('valid_not_after')
        if m.get('valid_not_before') is not None:
            self.valid_not_before = m.get('valid_not_before')
        if m.get('value') is not None:
            self.value = m.get('value')
        return self


class DelegateRelationInfo(TeaModel):
    def __init__(
        self,
        tenant_id: str = None,
        delegated_tenant_id: str = None,
        update_time: str = None,
        status: bool = None,
        extension: str = None,
    ):
        # 被授权的租户ID
        self.tenant_id = tenant_id
        # 被代理的租户ID
        self.delegated_tenant_id = delegated_tenant_id
        # 更新时间
        self.update_time = update_time
        # 状态
        self.status = status
        # 扩展字段
        self.extension = extension

    def validate(self):
        self.validate_required(self.tenant_id, 'tenant_id')
        self.validate_required(self.delegated_tenant_id, 'delegated_tenant_id')
        self.validate_required(self.update_time, 'update_time')
        self.validate_required(self.status, 'status')
        self.validate_required(self.extension, 'extension')

    def to_map(self):
        result = dict()
        if self.tenant_id is not None:
            result['tenant_id'] = self.tenant_id
        if self.delegated_tenant_id is not None:
            result['delegated_tenant_id'] = self.delegated_tenant_id
        if self.update_time is not None:
            result['update_time'] = self.update_time
        if self.status is not None:
            result['status'] = self.status
        if self.extension is not None:
            result['extension'] = self.extension
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('tenant_id') is not None:
            self.tenant_id = m.get('tenant_id')
        if m.get('delegated_tenant_id') is not None:
            self.delegated_tenant_id = m.get('delegated_tenant_id')
        if m.get('update_time') is not None:
            self.update_time = m.get('update_time')
        if m.get('status') is not None:
            self.status = m.get('status')
        if m.get('extension') is not None:
            self.extension = m.get('extension')
        return self


class IPApplyInfo(TeaModel):
    def __init__(
        self,
        account_id: str = None,
        login_name: str = None,
        alipay_login_name: str = None,
        legal_name: str = None,
        phone_number: str = None,
        role: int = None,
        status: int = None,
        external_user_id: str = None,
        external_user_name: str = None,
        apply_date: int = None,
    ):
        # 账户Id
        self.account_id = account_id
        # 用户名
        self.login_name = login_name
        # 支付宝账户
        self.alipay_login_name = alipay_login_name
        # 联系人
        self.legal_name = legal_name
        # 联系方式
        self.phone_number = phone_number
        # 角色(1: 版权方 2:商家)
        self.role = role
        # 状态
        self.status = status
        # 用户的外系统识别Id
        self.external_user_id = external_user_id
        # 外部系统用户名
        self.external_user_name = external_user_name
        # 申请时间(毫秒时间戳)
        self.apply_date = apply_date

    def validate(self):
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.login_name, 'login_name')
        self.validate_required(self.alipay_login_name, 'alipay_login_name')
        self.validate_required(self.legal_name, 'legal_name')
        self.validate_required(self.phone_number, 'phone_number')
        self.validate_required(self.role, 'role')
        self.validate_required(self.status, 'status')
        self.validate_required(self.external_user_id, 'external_user_id')
        self.validate_required(self.external_user_name, 'external_user_name')
        self.validate_required(self.apply_date, 'apply_date')

    def to_map(self):
        result = dict()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.login_name is not None:
            result['login_name'] = self.login_name
        if self.alipay_login_name is not None:
            result['alipay_login_name'] = self.alipay_login_name
        if self.legal_name is not None:
            result['legal_name'] = self.legal_name
        if self.phone_number is not None:
            result['phone_number'] = self.phone_number
        if self.role is not None:
            result['role'] = self.role
        if self.status is not None:
            result['status'] = self.status
        if self.external_user_id is not None:
            result['external_user_id'] = self.external_user_id
        if self.external_user_name is not None:
            result['external_user_name'] = self.external_user_name
        if self.apply_date is not None:
            result['apply_date'] = self.apply_date
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('login_name') is not None:
            self.login_name = m.get('login_name')
        if m.get('alipay_login_name') is not None:
            self.alipay_login_name = m.get('alipay_login_name')
        if m.get('legal_name') is not None:
            self.legal_name = m.get('legal_name')
        if m.get('phone_number') is not None:
            self.phone_number = m.get('phone_number')
        if m.get('role') is not None:
            self.role = m.get('role')
        if m.get('status') is not None:
            self.status = m.get('status')
        if m.get('external_user_id') is not None:
            self.external_user_id = m.get('external_user_id')
        if m.get('external_user_name') is not None:
            self.external_user_name = m.get('external_user_name')
        if m.get('apply_date') is not None:
            self.apply_date = m.get('apply_date')
        return self


class MerchantBudget(TeaModel):
    def __init__(
        self,
        point_lib_code: str = None,
        budget_code: str = None,
        budget_desc: str = None,
        budget_start_time: str = None,
        budget_end_time: str = None,
    ):
        # 积分库代码
        self.point_lib_code = point_lib_code
        # 预算库代码
        self.budget_code = budget_code
        # 预算库描述
        self.budget_desc = budget_desc
        # 预算库启用时间
        self.budget_start_time = budget_start_time
        # 预算库截止时间
        self.budget_end_time = budget_end_time

    def validate(self):
        self.validate_required(self.point_lib_code, 'point_lib_code')
        self.validate_required(self.budget_code, 'budget_code')
        self.validate_required(self.budget_desc, 'budget_desc')
        self.validate_required(self.budget_start_time, 'budget_start_time')
        self.validate_required(self.budget_end_time, 'budget_end_time')

    def to_map(self):
        result = dict()
        if self.point_lib_code is not None:
            result['point_lib_code'] = self.point_lib_code
        if self.budget_code is not None:
            result['budget_code'] = self.budget_code
        if self.budget_desc is not None:
            result['budget_desc'] = self.budget_desc
        if self.budget_start_time is not None:
            result['budget_start_time'] = self.budget_start_time
        if self.budget_end_time is not None:
            result['budget_end_time'] = self.budget_end_time
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('point_lib_code') is not None:
            self.point_lib_code = m.get('point_lib_code')
        if m.get('budget_code') is not None:
            self.budget_code = m.get('budget_code')
        if m.get('budget_desc') is not None:
            self.budget_desc = m.get('budget_desc')
        if m.get('budget_start_time') is not None:
            self.budget_start_time = m.get('budget_start_time')
        if m.get('budget_end_time') is not None:
            self.budget_end_time = m.get('budget_end_time')
        return self


class CounterData(TeaModel):
    def __init__(
        self,
        gmv: str = None,
        gaap: str = None,
        counter: str = None,
    ):
        # 成交总额
        self.gmv = gmv
        # 公认标准收入
        self.gaap = gaap
        # 笔数
        self.counter = counter

    def validate(self):
        self.validate_required(self.gmv, 'gmv')
        self.validate_required(self.gaap, 'gaap')
        self.validate_required(self.counter, 'counter')

    def to_map(self):
        result = dict()
        if self.gmv is not None:
            result['gmv'] = self.gmv
        if self.gaap is not None:
            result['gaap'] = self.gaap
        if self.counter is not None:
            result['counter'] = self.counter
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('gmv') is not None:
            self.gmv = m.get('gmv')
        if m.get('gaap') is not None:
            self.gaap = m.get('gaap')
        if m.get('counter') is not None:
            self.counter = m.get('counter')
        return self


class GoodsResponse(TeaModel):
    def __init__(
        self,
        account_id: str = None,
        goods_name: str = None,
        goods_type: str = None,
        description: str = None,
        total_count: int = None,
        display_price: str = None,
        default_price: str = None,
        if_public: bool = None,
        images: str = None,
        desc_images: str = None,
        status: int = None,
        valid_not_before: int = None,
        valid_not_after: int = None,
        limit_per_user_and_day: int = None,
        limit_per_user_and_month: int = None,
        memo: str = None,
        auth_type: int = None,
        category_id: str = None,
        goods_id: str = None,
    ):
        # 商品归属的账户ID
        self.account_id = account_id
        # 商品名称
        self.goods_name = goods_name
        # 商品类型
        self.goods_type = goods_type
        # 商品描述信息
        self.description = description
        # 商品库存
        self.total_count = total_count
        # 显示价格
        self.display_price = display_price
        # 默认价格
        self.default_price = default_price
        # 是否公开商品
        self.if_public = if_public
        # 商品主图片URL
        self.images = images
        # 商品描述图片，每个图片URL用:隔开
        self.desc_images = desc_images
        # 商品状态 0可用，1下线
        self.status = status
        # 商品开始时间
        self.valid_not_before = valid_not_before
        # 商品结束时间
        self.valid_not_after = valid_not_after
        # 商品每日上限
        self.limit_per_user_and_day = limit_per_user_and_day
        # 商品每月上限
        self.limit_per_user_and_month = limit_per_user_and_month
        # 商品备注信息
        self.memo = memo
        # 授权类型
        self.auth_type = auth_type
        # 商品类型
        self.category_id = category_id
        # 商品ID
        self.goods_id = goods_id

    def validate(self):
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.goods_name, 'goods_name')
        self.validate_required(self.goods_type, 'goods_type')
        self.validate_required(self.description, 'description')
        self.validate_required(self.total_count, 'total_count')
        self.validate_required(self.display_price, 'display_price')
        self.validate_required(self.default_price, 'default_price')
        self.validate_required(self.if_public, 'if_public')
        self.validate_required(self.images, 'images')
        self.validate_required(self.desc_images, 'desc_images')
        self.validate_required(self.status, 'status')
        self.validate_required(self.valid_not_before, 'valid_not_before')
        self.validate_required(self.valid_not_after, 'valid_not_after')
        self.validate_required(self.limit_per_user_and_day, 'limit_per_user_and_day')
        self.validate_required(self.limit_per_user_and_month, 'limit_per_user_and_month')
        self.validate_required(self.memo, 'memo')
        self.validate_required(self.auth_type, 'auth_type')
        self.validate_required(self.category_id, 'category_id')
        self.validate_required(self.goods_id, 'goods_id')

    def to_map(self):
        result = dict()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.goods_name is not None:
            result['goods_name'] = self.goods_name
        if self.goods_type is not None:
            result['goods_type'] = self.goods_type
        if self.description is not None:
            result['description'] = self.description
        if self.total_count is not None:
            result['total_count'] = self.total_count
        if self.display_price is not None:
            result['display_price'] = self.display_price
        if self.default_price is not None:
            result['default_price'] = self.default_price
        if self.if_public is not None:
            result['if_public'] = self.if_public
        if self.images is not None:
            result['images'] = self.images
        if self.desc_images is not None:
            result['desc_images'] = self.desc_images
        if self.status is not None:
            result['status'] = self.status
        if self.valid_not_before is not None:
            result['valid_not_before'] = self.valid_not_before
        if self.valid_not_after is not None:
            result['valid_not_after'] = self.valid_not_after
        if self.limit_per_user_and_day is not None:
            result['limit_per_user_and_day'] = self.limit_per_user_and_day
        if self.limit_per_user_and_month is not None:
            result['limit_per_user_and_month'] = self.limit_per_user_and_month
        if self.memo is not None:
            result['memo'] = self.memo
        if self.auth_type is not None:
            result['auth_type'] = self.auth_type
        if self.category_id is not None:
            result['category_id'] = self.category_id
        if self.goods_id is not None:
            result['goods_id'] = self.goods_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('goods_name') is not None:
            self.goods_name = m.get('goods_name')
        if m.get('goods_type') is not None:
            self.goods_type = m.get('goods_type')
        if m.get('description') is not None:
            self.description = m.get('description')
        if m.get('total_count') is not None:
            self.total_count = m.get('total_count')
        if m.get('display_price') is not None:
            self.display_price = m.get('display_price')
        if m.get('default_price') is not None:
            self.default_price = m.get('default_price')
        if m.get('if_public') is not None:
            self.if_public = m.get('if_public')
        if m.get('images') is not None:
            self.images = m.get('images')
        if m.get('desc_images') is not None:
            self.desc_images = m.get('desc_images')
        if m.get('status') is not None:
            self.status = m.get('status')
        if m.get('valid_not_before') is not None:
            self.valid_not_before = m.get('valid_not_before')
        if m.get('valid_not_after') is not None:
            self.valid_not_after = m.get('valid_not_after')
        if m.get('limit_per_user_and_day') is not None:
            self.limit_per_user_and_day = m.get('limit_per_user_and_day')
        if m.get('limit_per_user_and_month') is not None:
            self.limit_per_user_and_month = m.get('limit_per_user_and_month')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('auth_type') is not None:
            self.auth_type = m.get('auth_type')
        if m.get('category_id') is not None:
            self.category_id = m.get('category_id')
        if m.get('goods_id') is not None:
            self.goods_id = m.get('goods_id')
        return self


class ProductCodeInfo(TeaModel):
    def __init__(
        self,
        chain_id: str = None,
        tenant_id: str = None,
        product_code: str = None,
        account_name: str = None,
        account_id: str = None,
        memo: str = None,
    ):
        # 链ID
        self.chain_id = chain_id
        # 租户ID
        self.tenant_id = tenant_id
        # 场景码
        self.product_code = product_code
        # 租户映射链上账户名称
        self.account_name = account_name
        # 租户映射账户链上账户ID
        self.account_id = account_id
        # 备注信息
        self.memo = memo

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.tenant_id, 'tenant_id')
        self.validate_required(self.product_code, 'product_code')

    def to_map(self):
        result = dict()
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.tenant_id is not None:
            result['tenant_id'] = self.tenant_id
        if self.product_code is not None:
            result['product_code'] = self.product_code
        if self.account_name is not None:
            result['account_name'] = self.account_name
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.memo is not None:
            result['memo'] = self.memo
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('tenant_id') is not None:
            self.tenant_id = m.get('tenant_id')
        if m.get('product_code') is not None:
            self.product_code = m.get('product_code')
        if m.get('account_name') is not None:
            self.account_name = m.get('account_name')
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        return self


class WalletInfo(TeaModel):
    def __init__(
        self,
        credit_wallet: CreditWallet = None,
        debit_wallet: DebitWallet = None,
        statistical_info: StatisticalInfo = None,
    ):
        # 授信钱包信息
        self.credit_wallet = credit_wallet
        # 余额钱包信息
        self.debit_wallet = debit_wallet
        # 钱包统计信息
        self.statistical_info = statistical_info

    def validate(self):
        self.validate_required(self.credit_wallet, 'credit_wallet')
        if self.credit_wallet:
            self.credit_wallet.validate()
        self.validate_required(self.debit_wallet, 'debit_wallet')
        if self.debit_wallet:
            self.debit_wallet.validate()
        self.validate_required(self.statistical_info, 'statistical_info')
        if self.statistical_info:
            self.statistical_info.validate()

    def to_map(self):
        result = dict()
        if self.credit_wallet is not None:
            result['credit_wallet'] = self.credit_wallet.to_map()
        if self.debit_wallet is not None:
            result['debit_wallet'] = self.debit_wallet.to_map()
        if self.statistical_info is not None:
            result['statistical_info'] = self.statistical_info.to_map()
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('credit_wallet') is not None:
            temp_model = CreditWallet()
            self.credit_wallet = temp_model.from_map(m['credit_wallet'])
        if m.get('debit_wallet') is not None:
            temp_model = DebitWallet()
            self.debit_wallet = temp_model.from_map(m['debit_wallet'])
        if m.get('statistical_info') is not None:
            temp_model = StatisticalInfo()
            self.statistical_info = temp_model.from_map(m['statistical_info'])
        return self


class SalesByDay(TeaModel):
    def __init__(
        self,
        ip_order_id: str = None,
        seller_id: str = None,
        buyer_id: str = None,
        seller_name: str = None,
        buyer_name: str = None,
        date: str = None,
        statistic_begin_period: int = None,
        statistic_end_period: int = None,
        amount: int = None,
        sales: str = None,
        refund_sales: str = None,
        payment: str = None,
    ):
        # 订单ID
        self.ip_order_id = ip_order_id
        # 版权方ID
        self.seller_id = seller_id
        # 商家ID
        self.buyer_id = buyer_id
        # 版权方名称
        self.seller_name = seller_name
        # 商家名称
        self.buyer_name = buyer_name
        # 日期
        self.date = date
        # 统计周期-开始时间
        self.statistic_begin_period = statistic_begin_period
        # 统计周期-结束时间
        self.statistic_end_period = statistic_end_period
        # 商品销售数量
        self.amount = amount
        # 商品总销售额
        self.sales = sales
        # 总回退销售额
        self.refund_sales = refund_sales
        # 需支付给版权方的总费用
        self.payment = payment

    def validate(self):
        self.validate_required(self.ip_order_id, 'ip_order_id')
        self.validate_required(self.seller_id, 'seller_id')
        self.validate_required(self.buyer_id, 'buyer_id')
        self.validate_required(self.seller_name, 'seller_name')
        self.validate_required(self.buyer_name, 'buyer_name')
        self.validate_required(self.date, 'date')
        self.validate_required(self.statistic_begin_period, 'statistic_begin_period')
        self.validate_required(self.statistic_end_period, 'statistic_end_period')
        self.validate_required(self.amount, 'amount')
        self.validate_required(self.sales, 'sales')
        self.validate_required(self.refund_sales, 'refund_sales')
        self.validate_required(self.payment, 'payment')

    def to_map(self):
        result = dict()
        if self.ip_order_id is not None:
            result['ip_order_id'] = self.ip_order_id
        if self.seller_id is not None:
            result['seller_id'] = self.seller_id
        if self.buyer_id is not None:
            result['buyer_id'] = self.buyer_id
        if self.seller_name is not None:
            result['seller_name'] = self.seller_name
        if self.buyer_name is not None:
            result['buyer_name'] = self.buyer_name
        if self.date is not None:
            result['date'] = self.date
        if self.statistic_begin_period is not None:
            result['statistic_begin_period'] = self.statistic_begin_period
        if self.statistic_end_period is not None:
            result['statistic_end_period'] = self.statistic_end_period
        if self.amount is not None:
            result['amount'] = self.amount
        if self.sales is not None:
            result['sales'] = self.sales
        if self.refund_sales is not None:
            result['refund_sales'] = self.refund_sales
        if self.payment is not None:
            result['payment'] = self.payment
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('ip_order_id') is not None:
            self.ip_order_id = m.get('ip_order_id')
        if m.get('seller_id') is not None:
            self.seller_id = m.get('seller_id')
        if m.get('buyer_id') is not None:
            self.buyer_id = m.get('buyer_id')
        if m.get('seller_name') is not None:
            self.seller_name = m.get('seller_name')
        if m.get('buyer_name') is not None:
            self.buyer_name = m.get('buyer_name')
        if m.get('date') is not None:
            self.date = m.get('date')
        if m.get('statistic_begin_period') is not None:
            self.statistic_begin_period = m.get('statistic_begin_period')
        if m.get('statistic_end_period') is not None:
            self.statistic_end_period = m.get('statistic_end_period')
        if m.get('amount') is not None:
            self.amount = m.get('amount')
        if m.get('sales') is not None:
            self.sales = m.get('sales')
        if m.get('refund_sales') is not None:
            self.refund_sales = m.get('refund_sales')
        if m.get('payment') is not None:
            self.payment = m.get('payment')
        return self


class Merchant(TeaModel):
    def __init__(
        self,
        admin_id: str = None,
        description: str = None,
        did: str = None,
        fund_manager_id: str = None,
        is_asset_issuer: bool = None,
        is_equity_consumer: bool = None,
        is_equity_provider: bool = None,
        provision: Provision = None,
        status: int = None,
        tenant_id: str = None,
        profit_loss_balance: str = None,
    ):
        # 商户管理员ID
        self.admin_id = admin_id
        # 商户描述
        self.description = description
        # 商户分布式身份ID
        self.did = did
        # 资金管理员ID
        self.fund_manager_id = fund_manager_id
        # 是否可以发行资产
        self.is_asset_issuer = is_asset_issuer
        # 是否可以采购权益
        self.is_equity_consumer = is_equity_consumer
        # 是否可以发行权益
        self.is_equity_provider = is_equity_provider
        # 备付金数据
        self.provision = provision
        # 商户状态: 0可用, 1下线, 2冻结
        self.status = status
        # 租户ID
        self.tenant_id = tenant_id
        # 商户的损益账户
        self.profit_loss_balance = profit_loss_balance

    def validate(self):
        self.validate_required(self.admin_id, 'admin_id')
        self.validate_required(self.description, 'description')
        self.validate_required(self.did, 'did')
        self.validate_required(self.fund_manager_id, 'fund_manager_id')
        self.validate_required(self.is_asset_issuer, 'is_asset_issuer')
        self.validate_required(self.is_equity_consumer, 'is_equity_consumer')
        self.validate_required(self.is_equity_provider, 'is_equity_provider')
        self.validate_required(self.provision, 'provision')
        if self.provision:
            self.provision.validate()
        self.validate_required(self.status, 'status')
        self.validate_required(self.tenant_id, 'tenant_id')
        self.validate_required(self.profit_loss_balance, 'profit_loss_balance')

    def to_map(self):
        result = dict()
        if self.admin_id is not None:
            result['admin_id'] = self.admin_id
        if self.description is not None:
            result['description'] = self.description
        if self.did is not None:
            result['did'] = self.did
        if self.fund_manager_id is not None:
            result['fund_manager_id'] = self.fund_manager_id
        if self.is_asset_issuer is not None:
            result['is_asset_issuer'] = self.is_asset_issuer
        if self.is_equity_consumer is not None:
            result['is_equity_consumer'] = self.is_equity_consumer
        if self.is_equity_provider is not None:
            result['is_equity_provider'] = self.is_equity_provider
        if self.provision is not None:
            result['provision'] = self.provision.to_map()
        if self.status is not None:
            result['status'] = self.status
        if self.tenant_id is not None:
            result['tenant_id'] = self.tenant_id
        if self.profit_loss_balance is not None:
            result['profit_loss_balance'] = self.profit_loss_balance
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('admin_id') is not None:
            self.admin_id = m.get('admin_id')
        if m.get('description') is not None:
            self.description = m.get('description')
        if m.get('did') is not None:
            self.did = m.get('did')
        if m.get('fund_manager_id') is not None:
            self.fund_manager_id = m.get('fund_manager_id')
        if m.get('is_asset_issuer') is not None:
            self.is_asset_issuer = m.get('is_asset_issuer')
        if m.get('is_equity_consumer') is not None:
            self.is_equity_consumer = m.get('is_equity_consumer')
        if m.get('is_equity_provider') is not None:
            self.is_equity_provider = m.get('is_equity_provider')
        if m.get('provision') is not None:
            temp_model = Provision()
            self.provision = temp_model.from_map(m['provision'])
        if m.get('status') is not None:
            self.status = m.get('status')
        if m.get('tenant_id') is not None:
            self.tenant_id = m.get('tenant_id')
        if m.get('profit_loss_balance') is not None:
            self.profit_loss_balance = m.get('profit_loss_balance')
        return self


class IPCodeScannedInfo(TeaModel):
    def __init__(
        self,
        ip_code: str = None,
        user_id: str = None,
        user_name: str = None,
        avatar: str = None,
        phone_number: str = None,
        gps: str = None,
        timestamp: int = None,
        ip_id: str = None,
        order_id: str = None,
        goods_info_list: List[IPCodeGoodsInfo] = None,
        ad_info_list: List[IPCodeAdvertisingInfo] = None,
    ):
        # 正版码ID
        self.ip_code = ip_code
        # 用户的ID
        self.user_id = user_id
        # 用户的名称
        self.user_name = user_name
        # 用户头像地址
        self.avatar = avatar
        # 用户的手机号
        self.phone_number = phone_number
        # 用户的位置信息
        self.gps = gps
        # 处理时间(毫秒时间戳)
        self.timestamp = timestamp
        # IP ID
        self.ip_id = ip_id
        # 订单ID
        self.order_id = order_id
        # 正版码商品信息配置列表
        self.goods_info_list = goods_info_list
        # 正版码资源位配置信息列表
        self.ad_info_list = ad_info_list

    def validate(self):
        self.validate_required(self.ip_code, 'ip_code')
        self.validate_required(self.user_id, 'user_id')
        self.validate_required(self.user_name, 'user_name')
        self.validate_required(self.avatar, 'avatar')
        self.validate_required(self.timestamp, 'timestamp')
        self.validate_required(self.ip_id, 'ip_id')
        self.validate_required(self.order_id, 'order_id')
        if self.goods_info_list:
            for k in self.goods_info_list:
                if k:
                    k.validate()
        if self.ad_info_list:
            for k in self.ad_info_list:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.ip_code is not None:
            result['ip_code'] = self.ip_code
        if self.user_id is not None:
            result['user_id'] = self.user_id
        if self.user_name is not None:
            result['user_name'] = self.user_name
        if self.avatar is not None:
            result['avatar'] = self.avatar
        if self.phone_number is not None:
            result['phone_number'] = self.phone_number
        if self.gps is not None:
            result['gps'] = self.gps
        if self.timestamp is not None:
            result['timestamp'] = self.timestamp
        if self.ip_id is not None:
            result['ip_id'] = self.ip_id
        if self.order_id is not None:
            result['order_id'] = self.order_id
        result['goods_info_list'] = []
        if self.goods_info_list is not None:
            for k in self.goods_info_list:
                result['goods_info_list'].append(k.to_map() if k else None)
        result['ad_info_list'] = []
        if self.ad_info_list is not None:
            for k in self.ad_info_list:
                result['ad_info_list'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('ip_code') is not None:
            self.ip_code = m.get('ip_code')
        if m.get('user_id') is not None:
            self.user_id = m.get('user_id')
        if m.get('user_name') is not None:
            self.user_name = m.get('user_name')
        if m.get('avatar') is not None:
            self.avatar = m.get('avatar')
        if m.get('phone_number') is not None:
            self.phone_number = m.get('phone_number')
        if m.get('gps') is not None:
            self.gps = m.get('gps')
        if m.get('timestamp') is not None:
            self.timestamp = m.get('timestamp')
        if m.get('ip_id') is not None:
            self.ip_id = m.get('ip_id')
        if m.get('order_id') is not None:
            self.order_id = m.get('order_id')
        self.goods_info_list = []
        if m.get('goods_info_list') is not None:
            for k in m.get('goods_info_list'):
                temp_model = IPCodeGoodsInfo()
                self.goods_info_list.append(temp_model.from_map(k))
        self.ad_info_list = []
        if m.get('ad_info_list') is not None:
            for k in m.get('ad_info_list'):
                temp_model = IPCodeAdvertisingInfo()
                self.ad_info_list.append(temp_model.from_map(k))
        return self


class User(TeaModel):
    def __init__(
        self,
        did: str = None,
        local_id: str = None,
        pk: str = None,
        tenant_id: str = None,
        user_id: str = None,
        vc: str = None,
    ):
        # 用户分布式身份ID
        self.did = did
        # 用户的链外身份ID
        self.local_id = local_id
        # 用户公钥
        self.pk = pk
        # 租户ID
        self.tenant_id = tenant_id
        # 用户ID
        self.user_id = user_id
        # 用户VC
        self.vc = vc

    def validate(self):
        self.validate_required(self.did, 'did')
        self.validate_required(self.local_id, 'local_id')
        self.validate_required(self.pk, 'pk')
        self.validate_required(self.tenant_id, 'tenant_id')
        self.validate_required(self.user_id, 'user_id')
        self.validate_required(self.vc, 'vc')

    def to_map(self):
        result = dict()
        if self.did is not None:
            result['did'] = self.did
        if self.local_id is not None:
            result['local_id'] = self.local_id
        if self.pk is not None:
            result['pk'] = self.pk
        if self.tenant_id is not None:
            result['tenant_id'] = self.tenant_id
        if self.user_id is not None:
            result['user_id'] = self.user_id
        if self.vc is not None:
            result['vc'] = self.vc
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('did') is not None:
            self.did = m.get('did')
        if m.get('local_id') is not None:
            self.local_id = m.get('local_id')
        if m.get('pk') is not None:
            self.pk = m.get('pk')
        if m.get('tenant_id') is not None:
            self.tenant_id = m.get('tenant_id')
        if m.get('user_id') is not None:
            self.user_id = m.get('user_id')
        if m.get('vc') is not None:
            self.vc = m.get('vc')
        return self


class XNameValuePair(TeaModel):
    def __init__(
        self,
        name: str = None,
        value: str = None,
    ):
        # 键名
        self.name = name
        # 键值
        self.value = value

    def validate(self):
        self.validate_required(self.name, 'name')
        self.validate_required(self.value, 'value')

    def to_map(self):
        result = dict()
        if self.name is not None:
            result['name'] = self.name
        if self.value is not None:
            result['value'] = self.value
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('name') is not None:
            self.name = m.get('name')
        if m.get('value') is not None:
            self.value = m.get('value')
        return self


class ExecCardCreateRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        tx: Transaction = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 交易信息
        self.tx = tx

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.tx, 'tx')
        if self.tx:
            self.tx.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.tx is not None:
            result['tx'] = self.tx.to_map()
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('tx') is not None:
            temp_model = Transaction()
            self.tx = temp_model.from_map(m['tx'])
        return self


class ExecCardCreateResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        card_id: str = None,
        tx_hash: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 卡密ID
        self.card_id = card_id
        # 创建卡密的交易hash
        self.tx_hash = tx_hash

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.card_id is not None:
            result['card_id'] = self.card_id
        if self.tx_hash is not None:
            result['tx_hash'] = self.tx_hash
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('card_id') is not None:
            self.card_id = m.get('card_id')
        if m.get('tx_hash') is not None:
            self.tx_hash = m.get('tx_hash')
        return self


class ExecCardQueryRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        tx: Transaction = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 交易信息
        self.tx = tx

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.tx, 'tx')
        if self.tx:
            self.tx.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.tx is not None:
            result['tx'] = self.tx.to_map()
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('tx') is not None:
            temp_model = Transaction()
            self.tx = temp_model.from_map(m['tx'])
        return self


class ExecCardQueryResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        card: Card = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 卡密信息对象
        self.card = card

    def validate(self):
        if self.card:
            self.card.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.card is not None:
            result['card'] = self.card.to_map()
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('card') is not None:
            temp_model = Card()
            self.card = temp_model.from_map(m['card'])
        return self


class ExecCardBindnameRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        tx: Transaction = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 交易内容
        self.tx = tx

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.tx, 'tx')
        if self.tx:
            self.tx.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.tx is not None:
            result['tx'] = self.tx.to_map()
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('tx') is not None:
            temp_model = Transaction()
            self.tx = temp_model.from_map(m['tx'])
        return self


class ExecCardBindnameResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class ExecCardChargeRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        tx: Transaction = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 交易信息
        self.tx = tx

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.tx, 'tx')
        if self.tx:
            self.tx.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.tx is not None:
            result['tx'] = self.tx.to_map()
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('tx') is not None:
            temp_model = Transaction()
            self.tx = temp_model.from_map(m['tx'])
        return self


class ExecCardChargeResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class ExecCardWriteoffRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        tx: Transaction = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 交易信息
        self.tx = tx

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.tx, 'tx')
        if self.tx:
            self.tx.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.tx is not None:
            result['tx'] = self.tx.to_map()
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('tx') is not None:
            temp_model = Transaction()
            self.tx = temp_model.from_map(m['tx'])
        return self


class ExecCardWriteoffResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class ExecCardExpiredRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        tx: Transaction = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 交易信息
        self.tx = tx

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.tx, 'tx')
        if self.tx:
            self.tx.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.tx is not None:
            result['tx'] = self.tx.to_map()
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('tx') is not None:
            temp_model = Transaction()
            self.tx = temp_model.from_map(m['tx'])
        return self


class ExecCardExpiredResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class ExecCardForbiddenRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        tx: Transaction = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 交易信息
        self.tx = tx

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.tx, 'tx')
        if self.tx:
            self.tx.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.tx is not None:
            result['tx'] = self.tx.to_map()
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('tx') is not None:
            temp_model = Transaction()
            self.tx = temp_model.from_map(m['tx'])
        return self


class ExecCardForbiddenResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class ExecCardChargeresetRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        tx: Transaction = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 交易信息
        self.tx = tx

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.tx, 'tx')
        if self.tx:
            self.tx.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.tx is not None:
            result['tx'] = self.tx.to_map()
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('tx') is not None:
            temp_model = Transaction()
            self.tx = temp_model.from_map(m['tx'])
        return self


class ExecCardChargeresetResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class CreateConsumecardAccountRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        authorization_address: str = None,
        auth_consumer: bool = None,
        auth_provider: bool = None,
        biz_id: str = None,
        certification_id: str = None,
        chain_id: str = None,
        country_code: str = None,
        description: str = None,
        id_number: str = None,
        id_type: int = None,
        image: str = None,
        memo: str = None,
        email: str = None,
        phone_number: str = None,
        product_code: str = None,
        relegation_account_id: str = None,
        role_type: int = None,
        user_id: str = None,
        user_name: str = None,
        withdraw_bank_card_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 授权函地址
        self.authorization_address = authorization_address
        # 是否有采购/消费权限
        self.auth_consumer = auth_consumer
        # 是否有供应权限
        self.auth_provider = auth_provider
        # 业务系统幂等Id,防止同一笔交易重复发送(接入方传入)
        self.biz_id = biz_id
        # 认证方id(如: 支付宝的用户Id)
        self.certification_id = certification_id
        # 支持多链多合约,该参数为指明需要操作哪个智能合约环境
        self.chain_id = chain_id
        # 手机号国家编码
        self.country_code = country_code
        # 账户描述
        self.description = description
        # 个人用户的身份证号码/机构的企业编号
        self.id_number = id_number
        # 证件类型：0 身份证, 1 护照, 2 军官证, 3 回乡证, 4 港澳证件, 5 营业执照, 6 港澳居民来往内地通行证, 7 台湾居民来往内地通行证, 8 港澳居民居住证, 9 台湾居民居住证, 10事业单位登记证书, 11 社会团体登记证书, 12 民办非企业单位证书, 13 党政机关批准设计文件, 14 全国组织机构代码证书, 15 其他证件
        self.id_type = id_type
        # 开户影像信息（BASE64格式传入）
        self.image = image
        # 外部系统传入的交易备注信息(必填)
        self.memo = memo
        # 邮箱地址(机构注册必传)
        self.email = email
        # 个人用户的手机号码/机构用户的联系电话(必填)
        self.phone_number = phone_number
        # 场景码(需要申请)
        self.product_code = product_code
        # 平台归属机构的链上账户Id(账户可以归属在一个机构下)
        self.relegation_account_id = relegation_account_id
        # 角色(1 机构, 2 个人)
        self.role_type = role_type
        # 外部系统对该个人用户/机构的内部编号,用于唯一识别该用户
        self.user_id = user_id
        # 个人用户姓名/机构名称
        self.user_name = user_name
        # 提现银行卡
        self.withdraw_bank_card_id = withdraw_bank_card_id

    def validate(self):
        self.validate_required(self.auth_consumer, 'auth_consumer')
        self.validate_required(self.auth_provider, 'auth_provider')
        self.validate_required(self.biz_id, 'biz_id')
        self.validate_required(self.certification_id, 'certification_id')
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.country_code, 'country_code')
        self.validate_required(self.id_number, 'id_number')
        self.validate_required(self.id_type, 'id_type')
        self.validate_required(self.image, 'image')
        self.validate_required(self.memo, 'memo')
        self.validate_required(self.phone_number, 'phone_number')
        self.validate_required(self.product_code, 'product_code')
        self.validate_required(self.role_type, 'role_type')
        self.validate_required(self.user_id, 'user_id')
        self.validate_required(self.user_name, 'user_name')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.authorization_address is not None:
            result['authorization_address'] = self.authorization_address
        if self.auth_consumer is not None:
            result['auth_consumer'] = self.auth_consumer
        if self.auth_provider is not None:
            result['auth_provider'] = self.auth_provider
        if self.biz_id is not None:
            result['biz_id'] = self.biz_id
        if self.certification_id is not None:
            result['certification_id'] = self.certification_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.country_code is not None:
            result['country_code'] = self.country_code
        if self.description is not None:
            result['description'] = self.description
        if self.id_number is not None:
            result['id_number'] = self.id_number
        if self.id_type is not None:
            result['id_type'] = self.id_type
        if self.image is not None:
            result['image'] = self.image
        if self.memo is not None:
            result['memo'] = self.memo
        if self.email is not None:
            result['email'] = self.email
        if self.phone_number is not None:
            result['phone_number'] = self.phone_number
        if self.product_code is not None:
            result['product_code'] = self.product_code
        if self.relegation_account_id is not None:
            result['relegation_account_id'] = self.relegation_account_id
        if self.role_type is not None:
            result['role_type'] = self.role_type
        if self.user_id is not None:
            result['user_id'] = self.user_id
        if self.user_name is not None:
            result['user_name'] = self.user_name
        if self.withdraw_bank_card_id is not None:
            result['withdraw_bank_card_id'] = self.withdraw_bank_card_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('authorization_address') is not None:
            self.authorization_address = m.get('authorization_address')
        if m.get('auth_consumer') is not None:
            self.auth_consumer = m.get('auth_consumer')
        if m.get('auth_provider') is not None:
            self.auth_provider = m.get('auth_provider')
        if m.get('biz_id') is not None:
            self.biz_id = m.get('biz_id')
        if m.get('certification_id') is not None:
            self.certification_id = m.get('certification_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('country_code') is not None:
            self.country_code = m.get('country_code')
        if m.get('description') is not None:
            self.description = m.get('description')
        if m.get('id_number') is not None:
            self.id_number = m.get('id_number')
        if m.get('id_type') is not None:
            self.id_type = m.get('id_type')
        if m.get('image') is not None:
            self.image = m.get('image')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('email') is not None:
            self.email = m.get('email')
        if m.get('phone_number') is not None:
            self.phone_number = m.get('phone_number')
        if m.get('product_code') is not None:
            self.product_code = m.get('product_code')
        if m.get('relegation_account_id') is not None:
            self.relegation_account_id = m.get('relegation_account_id')
        if m.get('role_type') is not None:
            self.role_type = m.get('role_type')
        if m.get('user_id') is not None:
            self.user_id = m.get('user_id')
        if m.get('user_name') is not None:
            self.user_name = m.get('user_name')
        if m.get('withdraw_bank_card_id') is not None:
            self.withdraw_bank_card_id = m.get('withdraw_bank_card_id')
        return self


class CreateConsumecardAccountResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        account_id: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 用户/机构的链上账户Id
        self.account_id = account_id

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.account_id is not None:
            result['account_id'] = self.account_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        return self


class OfflineConsumecardAccountRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        remark: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 附言(长度不要超过500个字符)
        self.remark = remark

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.remark is not None:
            result['remark'] = self.remark
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('remark') is not None:
            self.remark = m.get('remark')
        return self


class OfflineConsumecardAccountResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class ReclaimConsumecardWalletRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        amount: str = None,
        base_request: BaseRequest = None,
        role_type: int = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 回退金额(元)
        self.amount = amount
        # 请求参数
        self.base_request = base_request
        # 角色(1 机构, 2 个人)
        self.role_type = role_type

    def validate(self):
        self.validate_required(self.amount, 'amount')
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.role_type, 'role_type')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.amount is not None:
            result['amount'] = self.amount
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.role_type is not None:
            result['role_type'] = self.role_type
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('amount') is not None:
            self.amount = m.get('amount')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('role_type') is not None:
            self.role_type = m.get('role_type')
        return self


class ReclaimConsumecardWalletResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class FreezeConsumecardAccountRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        remark: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 附言(长度不要超过500个字符)
        self.remark = remark

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.remark is not None:
            result['remark'] = self.remark
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('remark') is not None:
            self.remark = m.get('remark')
        return self


class FreezeConsumecardAccountResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class UnfreezeConsumecardAccountRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        remark: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 附言(长度不要超过500个字符)
        self.remark = remark

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.remark is not None:
            result['remark'] = self.remark
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('remark') is not None:
            self.remark = m.get('remark')
        return self


class UnfreezeConsumecardAccountResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class UpdateConsumecardRiskcontrolRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        add: bool = None,
        amount: str = None,
        base_request: BaseRequest = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 是否加值(false为减)
        self.add = add
        # 调整金额(元)
        self.amount = amount
        # 请求参数
        self.base_request = base_request

    def validate(self):
        self.validate_required(self.add, 'add')
        self.validate_required(self.amount, 'amount')
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.add is not None:
            result['add'] = self.add
        if self.amount is not None:
            result['amount'] = self.amount
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('add') is not None:
            self.add = m.get('add')
        if m.get('amount') is not None:
            self.amount = m.get('amount')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        return self


class UpdateConsumecardRiskcontrolResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class QueryConsumecardBillRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        order_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 需要查询的交易单号
        self.order_id = order_id

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.order_id, 'order_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.order_id is not None:
            result['order_id'] = self.order_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('order_id') is not None:
            self.order_id = m.get('order_id')
        return self


class QueryConsumecardBillResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        block_instruction: BlockInstruction = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 消费卡的单条交易记录数据
        self.block_instruction = block_instruction

    def validate(self):
        if self.block_instruction:
            self.block_instruction.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.block_instruction is not None:
            result['block_instruction'] = self.block_instruction.to_map()
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('block_instruction') is not None:
            temp_model = BlockInstruction()
            self.block_instruction = temp_model.from_map(m['block_instruction'])
        return self


class ChargeConsumecardWalletRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        charge_amount: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 充值金额(单位:元,精确到分)
        self.charge_amount = charge_amount

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.charge_amount, 'charge_amount')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.charge_amount is not None:
            result['charge_amount'] = self.charge_amount
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('charge_amount') is not None:
            self.charge_amount = m.get('charge_amount')
        return self


class ChargeConsumecardWalletResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class UpdateConsumecardAccountRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        authorization_address: str = None,
        auth_consumer: bool = None,
        auth_provider: bool = None,
        base_request: BaseRequest = None,
        certification_id: str = None,
        description: str = None,
        id_number: str = None,
        id_type: int = None,
        image: str = None,
        email: str = None,
        phone_number: str = None,
        user_name: str = None,
        withdraw_bank_card_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 授权函地址
        self.authorization_address = authorization_address
        # 是否有采购/消费权限
        self.auth_consumer = auth_consumer
        # 是否有供应权限
        self.auth_provider = auth_provider
        # 请求参数
        self.base_request = base_request
        # 认证方id
        self.certification_id = certification_id
        # 商户描述
        self.description = description
        # 个人用户的身份证号码/机构的企业编号
        self.id_number = id_number
        # 证件类型：0 身份证, 1 护照, 2 军官证, 3 回乡证, 4 港澳证件, 5 营业执照, 6 港澳居民来往内地通行证, 7 台湾居民来往内地通行证, 8 港澳居民居住证, 9 台湾居民居住证, 10事业单位登记证书, 11 社会团体登记证书, 12 民办非企业单位证书, 13 党政机关批准设计文件, 14 全国组织机构代码证书, 15 其他证件
        self.id_type = id_type
        # 账户映像资料
        self.image = image
        # 邮箱地址(机构注册必传)
        self.email = email
        # 个人用户的手机号码/机构用户的联系电话(必填)
        self.phone_number = phone_number
        # 个人用户姓名/机构名称
        self.user_name = user_name
        # 提现银行卡
        self.withdraw_bank_card_id = withdraw_bank_card_id

    def validate(self):
        self.validate_required(self.auth_consumer, 'auth_consumer')
        self.validate_required(self.auth_provider, 'auth_provider')
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.certification_id, 'certification_id')
        self.validate_required(self.id_number, 'id_number')
        self.validate_required(self.id_type, 'id_type')
        self.validate_required(self.image, 'image')
        self.validate_required(self.phone_number, 'phone_number')
        self.validate_required(self.user_name, 'user_name')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.authorization_address is not None:
            result['authorization_address'] = self.authorization_address
        if self.auth_consumer is not None:
            result['auth_consumer'] = self.auth_consumer
        if self.auth_provider is not None:
            result['auth_provider'] = self.auth_provider
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.certification_id is not None:
            result['certification_id'] = self.certification_id
        if self.description is not None:
            result['description'] = self.description
        if self.id_number is not None:
            result['id_number'] = self.id_number
        if self.id_type is not None:
            result['id_type'] = self.id_type
        if self.image is not None:
            result['image'] = self.image
        if self.email is not None:
            result['email'] = self.email
        if self.phone_number is not None:
            result['phone_number'] = self.phone_number
        if self.user_name is not None:
            result['user_name'] = self.user_name
        if self.withdraw_bank_card_id is not None:
            result['withdraw_bank_card_id'] = self.withdraw_bank_card_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('authorization_address') is not None:
            self.authorization_address = m.get('authorization_address')
        if m.get('auth_consumer') is not None:
            self.auth_consumer = m.get('auth_consumer')
        if m.get('auth_provider') is not None:
            self.auth_provider = m.get('auth_provider')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('certification_id') is not None:
            self.certification_id = m.get('certification_id')
        if m.get('description') is not None:
            self.description = m.get('description')
        if m.get('id_number') is not None:
            self.id_number = m.get('id_number')
        if m.get('id_type') is not None:
            self.id_type = m.get('id_type')
        if m.get('image') is not None:
            self.image = m.get('image')
        if m.get('email') is not None:
            self.email = m.get('email')
        if m.get('phone_number') is not None:
            self.phone_number = m.get('phone_number')
        if m.get('user_name') is not None:
            self.user_name = m.get('user_name')
        if m.get('withdraw_bank_card_id') is not None:
            self.withdraw_bank_card_id = m.get('withdraw_bank_card_id')
        return self


class UpdateConsumecardAccountResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class CreateConsumecardBillRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        bill_display_price: str = None,
        bill_name: str = None,
        bill_token_price: str = None,
        bill_type: str = None,
        buyer_account_id: str = None,
        buyer_id_number: str = None,
        buyer_id_type: int = None,
        buyer_ip: str = None,
        buyer_name: str = None,
        buyer_phone: str = None,
        origin_create_time: int = None,
        origin_order_id: str = None,
        remark: str = None,
        seller_account_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 账单标价(单位:元,精确到分)
        self.bill_display_price = bill_display_price
        # 账单名称
        self.bill_name = bill_name
        # 账单实际支付金额(单位:元,精确到分)
        self.bill_token_price = bill_token_price
        # 账单类型
        self.bill_type = bill_type
        # 交易发起方的链上账户Id
        self.buyer_account_id = buyer_account_id
        # 支付方证件号
        self.buyer_id_number = buyer_id_number
        # 证件类型：0 身份证, 1 护照, 2 军官证, 3 回乡证, 4 港澳证件, 5 营业执照, 6 港澳居民来往内地通行证, 7 台湾居民来往内地通行证, 8 港澳居民居住证, 9 台湾居民居住证, 10事业单位登记证书, 11 社会团体登记证书, 12 民办非企业单位证书, 13 党政机关批准设计文件, 14 全国组织机构代码证书, 15 其他证件
        self.buyer_id_type = buyer_id_type
        # 支付方发起ip
        self.buyer_ip = buyer_ip
        # 支付方姓名
        self.buyer_name = buyer_name
        # 支付方手机号
        self.buyer_phone = buyer_phone
        # 外部系统创建时间
        self.origin_create_time = origin_create_time
        # 外部系统订单号
        self.origin_order_id = origin_order_id
        # 附言（不必填）
        self.remark = remark
        # 交易接收方的链上账户Id
        self.seller_account_id = seller_account_id

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.bill_display_price, 'bill_display_price')
        self.validate_required(self.bill_name, 'bill_name')
        self.validate_required(self.bill_token_price, 'bill_token_price')
        self.validate_required(self.bill_type, 'bill_type')
        self.validate_required(self.buyer_account_id, 'buyer_account_id')
        self.validate_required(self.buyer_id_number, 'buyer_id_number')
        self.validate_required(self.buyer_id_type, 'buyer_id_type')
        self.validate_required(self.buyer_ip, 'buyer_ip')
        self.validate_required(self.buyer_name, 'buyer_name')
        self.validate_required(self.buyer_phone, 'buyer_phone')
        self.validate_required(self.origin_create_time, 'origin_create_time')
        self.validate_required(self.origin_order_id, 'origin_order_id')
        self.validate_required(self.seller_account_id, 'seller_account_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.bill_display_price is not None:
            result['bill_display_price'] = self.bill_display_price
        if self.bill_name is not None:
            result['bill_name'] = self.bill_name
        if self.bill_token_price is not None:
            result['bill_token_price'] = self.bill_token_price
        if self.bill_type is not None:
            result['bill_type'] = self.bill_type
        if self.buyer_account_id is not None:
            result['buyer_account_id'] = self.buyer_account_id
        if self.buyer_id_number is not None:
            result['buyer_id_number'] = self.buyer_id_number
        if self.buyer_id_type is not None:
            result['buyer_id_type'] = self.buyer_id_type
        if self.buyer_ip is not None:
            result['buyer_ip'] = self.buyer_ip
        if self.buyer_name is not None:
            result['buyer_name'] = self.buyer_name
        if self.buyer_phone is not None:
            result['buyer_phone'] = self.buyer_phone
        if self.origin_create_time is not None:
            result['origin_create_time'] = self.origin_create_time
        if self.origin_order_id is not None:
            result['origin_order_id'] = self.origin_order_id
        if self.remark is not None:
            result['remark'] = self.remark
        if self.seller_account_id is not None:
            result['seller_account_id'] = self.seller_account_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('bill_display_price') is not None:
            self.bill_display_price = m.get('bill_display_price')
        if m.get('bill_name') is not None:
            self.bill_name = m.get('bill_name')
        if m.get('bill_token_price') is not None:
            self.bill_token_price = m.get('bill_token_price')
        if m.get('bill_type') is not None:
            self.bill_type = m.get('bill_type')
        if m.get('buyer_account_id') is not None:
            self.buyer_account_id = m.get('buyer_account_id')
        if m.get('buyer_id_number') is not None:
            self.buyer_id_number = m.get('buyer_id_number')
        if m.get('buyer_id_type') is not None:
            self.buyer_id_type = m.get('buyer_id_type')
        if m.get('buyer_ip') is not None:
            self.buyer_ip = m.get('buyer_ip')
        if m.get('buyer_name') is not None:
            self.buyer_name = m.get('buyer_name')
        if m.get('buyer_phone') is not None:
            self.buyer_phone = m.get('buyer_phone')
        if m.get('origin_create_time') is not None:
            self.origin_create_time = m.get('origin_create_time')
        if m.get('origin_order_id') is not None:
            self.origin_order_id = m.get('origin_order_id')
        if m.get('remark') is not None:
            self.remark = m.get('remark')
        if m.get('seller_account_id') is not None:
            self.seller_account_id = m.get('seller_account_id')
        return self


class CreateConsumecardBillResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        order_id: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 账单ID
        self.order_id = order_id

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.order_id is not None:
            result['order_id'] = self.order_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('order_id') is not None:
            self.order_id = m.get('order_id')
        return self


class ConfirmConsumecardBillcreateRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        order_id: str = None,
        remark: str = None,
        success: bool = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 账单ID
        self.order_id = order_id
        # 附言(不要超过500个字符)
        self.remark = remark
        # 账单创建是否确认成功。true为成功，false为失败
        self.success = success

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.order_id, 'order_id')
        self.validate_required(self.success, 'success')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.order_id is not None:
            result['order_id'] = self.order_id
        if self.remark is not None:
            result['remark'] = self.remark
        if self.success is not None:
            result['success'] = self.success
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('order_id') is not None:
            self.order_id = m.get('order_id')
        if m.get('remark') is not None:
            self.remark = m.get('remark')
        if m.get('success') is not None:
            self.success = m.get('success')
        return self


class ConfirmConsumecardBillcreateResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class CancelConsumecardBillRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        order_id: str = None,
        remark: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 账单ID(长度不要超过256个字符)
        self.order_id = order_id
        # 附言(长度不要超过500个字符)
        self.remark = remark

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.order_id, 'order_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.order_id is not None:
            result['order_id'] = self.order_id
        if self.remark is not None:
            result['remark'] = self.remark
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('order_id') is not None:
            self.order_id = m.get('order_id')
        if m.get('remark') is not None:
            self.remark = m.get('remark')
        return self


class CancelConsumecardBillResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class ExecConsumecardBillpayRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        order_id: str = None,
        pay_price: str = None,
        remark: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 账单ID
        self.order_id = order_id
        # 需要支付的金额(单位:元,精确到分)
        self.pay_price = pay_price
        # 附言(不要超过500个字符)
        self.remark = remark

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.order_id, 'order_id')
        self.validate_required(self.pay_price, 'pay_price')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.order_id is not None:
            result['order_id'] = self.order_id
        if self.pay_price is not None:
            result['pay_price'] = self.pay_price
        if self.remark is not None:
            result['remark'] = self.remark
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('order_id') is not None:
            self.order_id = m.get('order_id')
        if m.get('pay_price') is not None:
            self.pay_price = m.get('pay_price')
        if m.get('remark') is not None:
            self.remark = m.get('remark')
        return self


class ExecConsumecardBillpayResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class ExecConsumecardOrderwriteoffRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        instruction_type: int = None,
        order_id: str = None,
        remark: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 交易类型(0: 商品兑换单, 1: 账单兑换单)
        self.instruction_type = instruction_type
        # 账单ID
        self.order_id = order_id
        # 附言(长度不要超过500个字符)
        self.remark = remark

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.instruction_type, 'instruction_type')
        self.validate_required(self.order_id, 'order_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.instruction_type is not None:
            result['instruction_type'] = self.instruction_type
        if self.order_id is not None:
            result['order_id'] = self.order_id
        if self.remark is not None:
            result['remark'] = self.remark
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('instruction_type') is not None:
            self.instruction_type = m.get('instruction_type')
        if m.get('order_id') is not None:
            self.order_id = m.get('order_id')
        if m.get('remark') is not None:
            self.remark = m.get('remark')
        return self


class ExecConsumecardOrderwriteoffResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        block_number: int = None,
        tx_hash: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 区块高度
        self.block_number = block_number
        # 交易哈希
        self.tx_hash = tx_hash

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.block_number is not None:
            result['block_number'] = self.block_number
        if self.tx_hash is not None:
            result['tx_hash'] = self.tx_hash
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('block_number') is not None:
            self.block_number = m.get('block_number')
        if m.get('tx_hash') is not None:
            self.tx_hash = m.get('tx_hash')
        return self


class ConfirmConsumecardBillrefundRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        accept: bool = None,
        base_request: BaseRequest = None,
        order_id: str = None,
        remark: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 是否接受退款申请，true同意退款，false拒绝退款
        self.accept = accept
        # 请求参数
        self.base_request = base_request
        # 账单ID
        self.order_id = order_id
        # 附言(不要超过500个字符)
        self.remark = remark

    def validate(self):
        self.validate_required(self.accept, 'accept')
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.order_id, 'order_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.accept is not None:
            result['accept'] = self.accept
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.order_id is not None:
            result['order_id'] = self.order_id
        if self.remark is not None:
            result['remark'] = self.remark
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('accept') is not None:
            self.accept = m.get('accept')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('order_id') is not None:
            self.order_id = m.get('order_id')
        if m.get('remark') is not None:
            self.remark = m.get('remark')
        return self


class ConfirmConsumecardBillrefundResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class QueryConsumecardAccountRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        remark: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 附言(长度不要超过500个字符)
        self.remark = remark

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.remark is not None:
            result['remark'] = self.remark
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('remark') is not None:
            self.remark = m.get('remark')
        return self


class QueryConsumecardAccountResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        account: ConsumeCardAccount = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 账户信息
        self.account = account

    def validate(self):
        if self.account:
            self.account.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.account is not None:
            result['account'] = self.account.to_map()
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('account') is not None:
            temp_model = ConsumeCardAccount()
            self.account = temp_model.from_map(m['account'])
        return self


class OpenConsumecardWalletRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        operate_type: int = None,
        role_type: int = None,
        wallet_type: int = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 操作类型(0 开通钱包)
        self.operate_type = operate_type
        # 角色(1 机构, 2 个人)
        self.role_type = role_type
        # 钱包类型（0:余额账户）
        self.wallet_type = wallet_type

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.operate_type, 'operate_type')
        self.validate_required(self.role_type, 'role_type')
        self.validate_required(self.wallet_type, 'wallet_type')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.operate_type is not None:
            result['operate_type'] = self.operate_type
        if self.role_type is not None:
            result['role_type'] = self.role_type
        if self.wallet_type is not None:
            result['wallet_type'] = self.wallet_type
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('operate_type') is not None:
            self.operate_type = m.get('operate_type')
        if m.get('role_type') is not None:
            self.role_type = m.get('role_type')
        if m.get('wallet_type') is not None:
            self.wallet_type = m.get('wallet_type')
        return self


class OpenConsumecardWalletResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class QueryConsumecardWalletRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        remark: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 附言(长度不要超过500个字符)
        self.remark = remark

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.remark is not None:
            result['remark'] = self.remark
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('remark') is not None:
            self.remark = m.get('remark')
        return self


class QueryConsumecardWalletResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        wallet_info: WalletInfo = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 钱包信息数据
        self.wallet_info = wallet_info

    def validate(self):
        if self.wallet_info:
            self.wallet_info.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.wallet_info is not None:
            result['wallet_info'] = self.wallet_info.to_map()
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('wallet_info') is not None:
            temp_model = WalletInfo()
            self.wallet_info = temp_model.from_map(m['wallet_info'])
        return self


class ExecConsumecardWalletchargetotokenRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        charge_amount: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 充值的金额(单位为:元,精确到小数点后2位)
        self.charge_amount = charge_amount

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.charge_amount, 'charge_amount')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.charge_amount is not None:
            result['charge_amount'] = self.charge_amount
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('charge_amount') is not None:
            self.charge_amount = m.get('charge_amount')
        return self


class ExecConsumecardWalletchargetotokenResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        block_number: int = None,
        tx_hash: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 区块高度
        self.block_number = block_number
        # 交易哈希
        self.tx_hash = tx_hash

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.block_number is not None:
            result['block_number'] = self.block_number
        if self.tx_hash is not None:
            result['tx_hash'] = self.tx_hash
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('block_number') is not None:
            self.block_number = m.get('block_number')
        if m.get('tx_hash') is not None:
            self.tx_hash = m.get('tx_hash')
        return self


class ExecConsumecardWalletredeemtokenRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        redeem_amount: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 期望要回退的金额(单位:元,精确到分)
        self.redeem_amount = redeem_amount

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.redeem_amount is not None:
            result['redeem_amount'] = self.redeem_amount
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('redeem_amount') is not None:
            self.redeem_amount = m.get('redeem_amount')
        return self


class ExecConsumecardWalletredeemtokenResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        block_number: int = None,
        tx_hash: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 区块高度
        self.block_number = block_number
        # 交易哈希
        self.tx_hash = tx_hash

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.block_number is not None:
            result['block_number'] = self.block_number
        if self.tx_hash is not None:
            result['tx_hash'] = self.tx_hash
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('block_number') is not None:
            self.block_number = m.get('block_number')
        if m.get('tx_hash') is not None:
            self.tx_hash = m.get('tx_hash')
        return self


class StartConsumecardPurchaseRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        buyer_id_number: str = None,
        buyer_id_type: int = None,
        buyer_ip: str = None,
        buyer_name: str = None,
        buyer_phone: str = None,
        goods_id: str = None,
        origin_create_time: int = None,
        origin_order_id: str = None,
        remark: str = None,
        token_price: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 支付方证件号
        self.buyer_id_number = buyer_id_number
        # 证件类型：0 身份证, 1 护照, 2 军官证, 3 回乡证, 4 港澳证件, 5 营业执照, 6 港澳居民来往内地通行证, 7 台湾居民来往内地通行证, 8 港澳居民居住证, 9 台湾居民居住证, 10事业单位登记证书, 11 社会团体登记证书, 12 民办非企业单位证书, 13 党政机关批准设计文件, 14 全国组织机构代码证书, 15 其他证件
        self.buyer_id_type = buyer_id_type
        # 支付方发起ip
        self.buyer_ip = buyer_ip
        # 支付方姓名
        self.buyer_name = buyer_name
        # 支付方手机号
        self.buyer_phone = buyer_phone
        # 商品ID
        self.goods_id = goods_id
        # 外部系统交易创建时间，毫秒时间戳
        self.origin_create_time = origin_create_time
        # 外部系统订单号
        self.origin_order_id = origin_order_id
        # 附言
        self.remark = remark
        # 期望支付的商品价格(单位:元,精确到分)
        self.token_price = token_price

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.buyer_id_number, 'buyer_id_number')
        self.validate_required(self.buyer_id_type, 'buyer_id_type')
        self.validate_required(self.buyer_ip, 'buyer_ip')
        self.validate_required(self.buyer_name, 'buyer_name')
        self.validate_required(self.buyer_phone, 'buyer_phone')
        self.validate_required(self.goods_id, 'goods_id')
        self.validate_required(self.origin_create_time, 'origin_create_time')
        self.validate_required(self.origin_order_id, 'origin_order_id')
        self.validate_required(self.remark, 'remark')
        self.validate_required(self.token_price, 'token_price')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.buyer_id_number is not None:
            result['buyer_id_number'] = self.buyer_id_number
        if self.buyer_id_type is not None:
            result['buyer_id_type'] = self.buyer_id_type
        if self.buyer_ip is not None:
            result['buyer_ip'] = self.buyer_ip
        if self.buyer_name is not None:
            result['buyer_name'] = self.buyer_name
        if self.buyer_phone is not None:
            result['buyer_phone'] = self.buyer_phone
        if self.goods_id is not None:
            result['goods_id'] = self.goods_id
        if self.origin_create_time is not None:
            result['origin_create_time'] = self.origin_create_time
        if self.origin_order_id is not None:
            result['origin_order_id'] = self.origin_order_id
        if self.remark is not None:
            result['remark'] = self.remark
        if self.token_price is not None:
            result['token_price'] = self.token_price
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('buyer_id_number') is not None:
            self.buyer_id_number = m.get('buyer_id_number')
        if m.get('buyer_id_type') is not None:
            self.buyer_id_type = m.get('buyer_id_type')
        if m.get('buyer_ip') is not None:
            self.buyer_ip = m.get('buyer_ip')
        if m.get('buyer_name') is not None:
            self.buyer_name = m.get('buyer_name')
        if m.get('buyer_phone') is not None:
            self.buyer_phone = m.get('buyer_phone')
        if m.get('goods_id') is not None:
            self.goods_id = m.get('goods_id')
        if m.get('origin_create_time') is not None:
            self.origin_create_time = m.get('origin_create_time')
        if m.get('origin_order_id') is not None:
            self.origin_order_id = m.get('origin_order_id')
        if m.get('remark') is not None:
            self.remark = m.get('remark')
        if m.get('token_price') is not None:
            self.token_price = m.get('token_price')
        return self


class StartConsumecardPurchaseResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        order_id: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 交易ID
        self.order_id = order_id

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.order_id is not None:
            result['order_id'] = self.order_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('order_id') is not None:
            self.order_id = m.get('order_id')
        return self


class CancelConsumecardBuyerpurchaseRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        order_id: str = None,
        remark: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 交易ID
        self.order_id = order_id
        # 附言
        self.remark = remark

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.order_id, 'order_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.order_id is not None:
            result['order_id'] = self.order_id
        if self.remark is not None:
            result['remark'] = self.remark
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('order_id') is not None:
            self.order_id = m.get('order_id')
        if m.get('remark') is not None:
            self.remark = m.get('remark')
        return self


class CancelConsumecardBuyerpurchaseResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class ApplyConsumecardPurchaserefundRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        order_id: str = None,
        remark: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 交易ID
        self.order_id = order_id
        # 附言(退款原因)
        self.remark = remark

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.order_id, 'order_id')
        self.validate_required(self.remark, 'remark')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.order_id is not None:
            result['order_id'] = self.order_id
        if self.remark is not None:
            result['remark'] = self.remark
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('order_id') is not None:
            self.order_id = m.get('order_id')
        if m.get('remark') is not None:
            self.remark = m.get('remark')
        return self


class ApplyConsumecardPurchaserefundResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class ApplyConsumecardPurchasereplaceRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        order_id: str = None,
        remark: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 订单ID
        self.order_id = order_id
        # 附言
        self.remark = remark

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.order_id, 'order_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.order_id is not None:
            result['order_id'] = self.order_id
        if self.remark is not None:
            result['remark'] = self.remark
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('order_id') is not None:
            self.order_id = m.get('order_id')
        if m.get('remark') is not None:
            self.remark = m.get('remark')
        return self


class ApplyConsumecardPurchasereplaceResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class ExecConsumecardPurchasereceiveRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        order_id: str = None,
        remark: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 订单ID
        self.order_id = order_id
        # 附言
        self.remark = remark

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.order_id, 'order_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.order_id is not None:
            result['order_id'] = self.order_id
        if self.remark is not None:
            result['remark'] = self.remark
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('order_id') is not None:
            self.order_id = m.get('order_id')
        if m.get('remark') is not None:
            self.remark = m.get('remark')
        return self


class ExecConsumecardPurchasereceiveResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class RefuseConsumecardPurchaseRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        order_id: str = None,
        remark: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 交易ID
        self.order_id = order_id
        # 附言
        self.remark = remark

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.order_id, 'order_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.order_id is not None:
            result['order_id'] = self.order_id
        if self.remark is not None:
            result['remark'] = self.remark
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('order_id') is not None:
            self.order_id = m.get('order_id')
        if m.get('remark') is not None:
            self.remark = m.get('remark')
        return self


class RefuseConsumecardPurchaseResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class SetConsumecardPurchaserefundRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        accept: bool = None,
        base_request: BaseRequest = None,
        order_id: str = None,
        remark: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 是否同意退款。true同意，false拒绝。
        self.accept = accept
        # 请求参数
        self.base_request = base_request
        # 交易ID
        self.order_id = order_id
        # 附言
        self.remark = remark

    def validate(self):
        self.validate_required(self.accept, 'accept')
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.order_id, 'order_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.accept is not None:
            result['accept'] = self.accept
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.order_id is not None:
            result['order_id'] = self.order_id
        if self.remark is not None:
            result['remark'] = self.remark
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('accept') is not None:
            self.accept = m.get('accept')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('order_id') is not None:
            self.order_id = m.get('order_id')
        if m.get('remark') is not None:
            self.remark = m.get('remark')
        return self


class SetConsumecardPurchaserefundResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class SetConsumecardPurchasereplaceRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        accept: bool = None,
        base_request: BaseRequest = None,
        order_id: str = None,
        remark: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 是否同意换货。true同意，false拒绝
        self.accept = accept
        # 请求参数
        self.base_request = base_request
        # 交易ID
        self.order_id = order_id
        # 附言
        self.remark = remark

    def validate(self):
        self.validate_required(self.accept, 'accept')
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.order_id, 'order_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.accept is not None:
            result['accept'] = self.accept
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.order_id is not None:
            result['order_id'] = self.order_id
        if self.remark is not None:
            result['remark'] = self.remark
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('accept') is not None:
            self.accept = m.get('accept')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('order_id') is not None:
            self.order_id = m.get('order_id')
        if m.get('remark') is not None:
            self.remark = m.get('remark')
        return self


class SetConsumecardPurchasereplaceResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class ConfirmConsumecardPurchaseRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        order_id: str = None,
        remark: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 交易ID
        self.order_id = order_id
        # 附言
        self.remark = remark

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.order_id, 'order_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.order_id is not None:
            result['order_id'] = self.order_id
        if self.remark is not None:
            result['remark'] = self.remark
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('order_id') is not None:
            self.order_id = m.get('order_id')
        if m.get('remark') is not None:
            self.remark = m.get('remark')
        return self


class ConfirmConsumecardPurchaseResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class SendConsumecardPurchaseRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        order_id: str = None,
        remark: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 交易ID
        self.order_id = order_id
        # 附言(发货信息)
        self.remark = remark

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.order_id, 'order_id')
        self.validate_required(self.remark, 'remark')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.order_id is not None:
            result['order_id'] = self.order_id
        if self.remark is not None:
            result['remark'] = self.remark
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('order_id') is not None:
            self.order_id = m.get('order_id')
        if m.get('remark') is not None:
            self.remark = m.get('remark')
        return self


class SendConsumecardPurchaseResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class ReplaceConsumecardPurchaseRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        order_id: str = None,
        remark: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 交易ID
        self.order_id = order_id
        # 附言(补发商品信息)
        self.remark = remark

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.order_id, 'order_id')
        self.validate_required(self.remark, 'remark')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.order_id is not None:
            result['order_id'] = self.order_id
        if self.remark is not None:
            result['remark'] = self.remark
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('order_id') is not None:
            self.order_id = m.get('order_id')
        if m.get('remark') is not None:
            self.remark = m.get('remark')
        return self


class ReplaceConsumecardPurchaseResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class CreateConsumecardGoodsRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        auth_type: int = None,
        base_request: BaseRequest = None,
        default_price: str = None,
        delegate_account_id: str = None,
        description: str = None,
        desc_images: str = None,
        display_price: str = None,
        goods_name: str = None,
        goods_type: str = None,
        if_public: bool = None,
        image: str = None,
        limit_per_user_and_day: int = None,
        limit_per_user_and_month: int = None,
        total_count: int = None,
        valid_not_after: int = None,
        valid_not_before: int = None,
        memo: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 商品授权类型
        self.auth_type = auth_type
        # 请求参数
        self.base_request = base_request
        # 默认价格(单位:元,精确到分)
        self.default_price = default_price
        # 代理操作的链上ID
        self.delegate_account_id = delegate_account_id
        # 商品描述
        self.description = description
        # 商品描述图片url，多个图片间用;隔开
        self.desc_images = desc_images
        # 商品标价
        self.display_price = display_price
        # 商品名称
        self.goods_name = goods_name
        # 商品类型
        self.goods_type = goods_type
        # 是否公开
        self.if_public = if_public
        # 商品主图片url
        self.image = image
        # 商品每日上限
        self.limit_per_user_and_day = limit_per_user_and_day
        # 商品每月上限
        self.limit_per_user_and_month = limit_per_user_and_month
        # 商品库存
        self.total_count = total_count
        # 商品有效结束时间(UNIX毫秒时间戳)
        self.valid_not_after = valid_not_after
        # 商品有效开始时间(UNIX毫秒时间戳)
        self.valid_not_before = valid_not_before
        # 备注信息
        self.memo = memo

    def validate(self):
        self.validate_required(self.auth_type, 'auth_type')
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.default_price, 'default_price')
        self.validate_required(self.delegate_account_id, 'delegate_account_id')
        self.validate_required(self.description, 'description')
        self.validate_required(self.desc_images, 'desc_images')
        self.validate_required(self.display_price, 'display_price')
        self.validate_required(self.goods_name, 'goods_name')
        self.validate_required(self.goods_type, 'goods_type')
        self.validate_required(self.if_public, 'if_public')
        self.validate_required(self.image, 'image')
        self.validate_required(self.limit_per_user_and_day, 'limit_per_user_and_day')
        self.validate_required(self.limit_per_user_and_month, 'limit_per_user_and_month')
        self.validate_required(self.total_count, 'total_count')
        self.validate_required(self.valid_not_after, 'valid_not_after')
        self.validate_required(self.valid_not_before, 'valid_not_before')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.auth_type is not None:
            result['auth_type'] = self.auth_type
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.default_price is not None:
            result['default_price'] = self.default_price
        if self.delegate_account_id is not None:
            result['delegate_account_id'] = self.delegate_account_id
        if self.description is not None:
            result['description'] = self.description
        if self.desc_images is not None:
            result['desc_images'] = self.desc_images
        if self.display_price is not None:
            result['display_price'] = self.display_price
        if self.goods_name is not None:
            result['goods_name'] = self.goods_name
        if self.goods_type is not None:
            result['goods_type'] = self.goods_type
        if self.if_public is not None:
            result['if_public'] = self.if_public
        if self.image is not None:
            result['image'] = self.image
        if self.limit_per_user_and_day is not None:
            result['limit_per_user_and_day'] = self.limit_per_user_and_day
        if self.limit_per_user_and_month is not None:
            result['limit_per_user_and_month'] = self.limit_per_user_and_month
        if self.total_count is not None:
            result['total_count'] = self.total_count
        if self.valid_not_after is not None:
            result['valid_not_after'] = self.valid_not_after
        if self.valid_not_before is not None:
            result['valid_not_before'] = self.valid_not_before
        if self.memo is not None:
            result['memo'] = self.memo
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('auth_type') is not None:
            self.auth_type = m.get('auth_type')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('default_price') is not None:
            self.default_price = m.get('default_price')
        if m.get('delegate_account_id') is not None:
            self.delegate_account_id = m.get('delegate_account_id')
        if m.get('description') is not None:
            self.description = m.get('description')
        if m.get('desc_images') is not None:
            self.desc_images = m.get('desc_images')
        if m.get('display_price') is not None:
            self.display_price = m.get('display_price')
        if m.get('goods_name') is not None:
            self.goods_name = m.get('goods_name')
        if m.get('goods_type') is not None:
            self.goods_type = m.get('goods_type')
        if m.get('if_public') is not None:
            self.if_public = m.get('if_public')
        if m.get('image') is not None:
            self.image = m.get('image')
        if m.get('limit_per_user_and_day') is not None:
            self.limit_per_user_and_day = m.get('limit_per_user_and_day')
        if m.get('limit_per_user_and_month') is not None:
            self.limit_per_user_and_month = m.get('limit_per_user_and_month')
        if m.get('total_count') is not None:
            self.total_count = m.get('total_count')
        if m.get('valid_not_after') is not None:
            self.valid_not_after = m.get('valid_not_after')
        if m.get('valid_not_before') is not None:
            self.valid_not_before = m.get('valid_not_before')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        return self


class CreateConsumecardGoodsResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        request_id: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 异步发布商品返回的查询ID。使用该ID查询发布结果。
        self.request_id = request_id

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.request_id is not None:
            result['request_id'] = self.request_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('request_id') is not None:
            self.request_id = m.get('request_id')
        return self


class UpdateConsumecardGoodsRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        default_price: str = None,
        description: str = None,
        desc_images: str = None,
        display_price: str = None,
        goods_id: str = None,
        goods_name: str = None,
        images: str = None,
        limit_per_user_and_day: int = None,
        limit_per_user_and_month: int = None,
        total_count: int = None,
        valid_not_after: int = None,
        valid_not_before: int = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 默认价格
        self.default_price = default_price
        # 商品描述
        self.description = description
        # 描述图片url
        self.desc_images = desc_images
        # 商品标价
        self.display_price = display_price
        # 商品ID
        self.goods_id = goods_id
        # 商品名称
        self.goods_name = goods_name
        # 主图片url
        self.images = images
        # 商品每日上限
        self.limit_per_user_and_day = limit_per_user_and_day
        # 商品每月上限
        self.limit_per_user_and_month = limit_per_user_and_month
        # 商品库存
        self.total_count = total_count
        # 商品有效结束时间(UNIX毫秒时间戳)
        self.valid_not_after = valid_not_after
        # 商品有效开始时间(UNIX毫秒时间戳)
        self.valid_not_before = valid_not_before

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.default_price, 'default_price')
        self.validate_required(self.description, 'description')
        self.validate_required(self.desc_images, 'desc_images')
        self.validate_required(self.display_price, 'display_price')
        self.validate_required(self.goods_id, 'goods_id')
        self.validate_required(self.goods_name, 'goods_name')
        self.validate_required(self.images, 'images')
        self.validate_required(self.limit_per_user_and_day, 'limit_per_user_and_day')
        self.validate_required(self.limit_per_user_and_month, 'limit_per_user_and_month')
        self.validate_required(self.total_count, 'total_count')
        self.validate_required(self.valid_not_after, 'valid_not_after')
        self.validate_required(self.valid_not_before, 'valid_not_before')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.default_price is not None:
            result['default_price'] = self.default_price
        if self.description is not None:
            result['description'] = self.description
        if self.desc_images is not None:
            result['desc_images'] = self.desc_images
        if self.display_price is not None:
            result['display_price'] = self.display_price
        if self.goods_id is not None:
            result['goods_id'] = self.goods_id
        if self.goods_name is not None:
            result['goods_name'] = self.goods_name
        if self.images is not None:
            result['images'] = self.images
        if self.limit_per_user_and_day is not None:
            result['limit_per_user_and_day'] = self.limit_per_user_and_day
        if self.limit_per_user_and_month is not None:
            result['limit_per_user_and_month'] = self.limit_per_user_and_month
        if self.total_count is not None:
            result['total_count'] = self.total_count
        if self.valid_not_after is not None:
            result['valid_not_after'] = self.valid_not_after
        if self.valid_not_before is not None:
            result['valid_not_before'] = self.valid_not_before
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('default_price') is not None:
            self.default_price = m.get('default_price')
        if m.get('description') is not None:
            self.description = m.get('description')
        if m.get('desc_images') is not None:
            self.desc_images = m.get('desc_images')
        if m.get('display_price') is not None:
            self.display_price = m.get('display_price')
        if m.get('goods_id') is not None:
            self.goods_id = m.get('goods_id')
        if m.get('goods_name') is not None:
            self.goods_name = m.get('goods_name')
        if m.get('images') is not None:
            self.images = m.get('images')
        if m.get('limit_per_user_and_day') is not None:
            self.limit_per_user_and_day = m.get('limit_per_user_and_day')
        if m.get('limit_per_user_and_month') is not None:
            self.limit_per_user_and_month = m.get('limit_per_user_and_month')
        if m.get('total_count') is not None:
            self.total_count = m.get('total_count')
        if m.get('valid_not_after') is not None:
            self.valid_not_after = m.get('valid_not_after')
        if m.get('valid_not_before') is not None:
            self.valid_not_before = m.get('valid_not_before')
        return self


class UpdateConsumecardGoodsResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        request_id: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 异步更新商品信息，根据该ID查询更新结果
        self.request_id = request_id

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.request_id is not None:
            result['request_id'] = self.request_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('request_id') is not None:
            self.request_id = m.get('request_id')
        return self


class OpenConsumecardGoodstocustomRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        goods_id: str = None,
        open_account_id: str = None,
        open: bool = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 商品ID
        self.goods_id = goods_id
        # 开放权限的账户id
        self.open_account_id = open_account_id
        # true授权，false解除授权
        self.open = open

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.goods_id, 'goods_id')
        self.validate_required(self.open_account_id, 'open_account_id')
        self.validate_required(self.open, 'open')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.goods_id is not None:
            result['goods_id'] = self.goods_id
        if self.open_account_id is not None:
            result['open_account_id'] = self.open_account_id
        if self.open is not None:
            result['open'] = self.open
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('goods_id') is not None:
            self.goods_id = m.get('goods_id')
        if m.get('open_account_id') is not None:
            self.open_account_id = m.get('open_account_id')
        if m.get('open') is not None:
            self.open = m.get('open')
        return self


class OpenConsumecardGoodstocustomResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class CreateConsumecardGoodscategoryRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        category_description: str = None,
        category_id: str = None,
        category_name: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 商品类别描述
        self.category_description = category_description
        # 商品分类id（ffaaaaabbbbbbcccccc，如果存在返回失败）
        self.category_id = category_id
        # 商品类别名称
        self.category_name = category_name

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.category_description, 'category_description')
        self.validate_required(self.category_id, 'category_id')
        self.validate_required(self.category_name, 'category_name')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.category_description is not None:
            result['category_description'] = self.category_description
        if self.category_id is not None:
            result['category_id'] = self.category_id
        if self.category_name is not None:
            result['category_name'] = self.category_name
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('category_description') is not None:
            self.category_description = m.get('category_description')
        if m.get('category_id') is not None:
            self.category_id = m.get('category_id')
        if m.get('category_name') is not None:
            self.category_name = m.get('category_name')
        return self


class CreateConsumecardGoodscategoryResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class SetConsumecardGoodscustompriceRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        goods_id: str = None,
        open_account_id: str = None,
        price: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 商品ID
        self.goods_id = goods_id
        # 设置一客一价的目标账户id
        self.open_account_id = open_account_id
        # 设置的价格(单位:元,精确到分)
        self.price = price

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.goods_id, 'goods_id')
        self.validate_required(self.open_account_id, 'open_account_id')
        self.validate_required(self.price, 'price')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.goods_id is not None:
            result['goods_id'] = self.goods_id
        if self.open_account_id is not None:
            result['open_account_id'] = self.open_account_id
        if self.price is not None:
            result['price'] = self.price
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('goods_id') is not None:
            self.goods_id = m.get('goods_id')
        if m.get('open_account_id') is not None:
            self.open_account_id = m.get('open_account_id')
        if m.get('price') is not None:
            self.price = m.get('price')
        return self


class SetConsumecardGoodscustompriceResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class UploadConsumecardGoodsimageRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        content_type: str = None,
        image: List[str] = None,
        product_code: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 图片MIME类型，目前仅支持 image/jpeg
        self.content_type = content_type
        # 图片信息（base64编码）列表
        self.image = image
        # 场景码(入驻时申请)
        self.product_code = product_code

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.content_type, 'content_type')
        self.validate_required(self.image, 'image')
        self.validate_required(self.product_code, 'product_code')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.content_type is not None:
            result['content_type'] = self.content_type
        if self.image is not None:
            result['image'] = self.image
        if self.product_code is not None:
            result['product_code'] = self.product_code
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('content_type') is not None:
            self.content_type = m.get('content_type')
        if m.get('image') is not None:
            self.image = m.get('image')
        if m.get('product_code') is not None:
            self.product_code = m.get('product_code')
        return self


class UploadConsumecardGoodsimageResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        temporary_urls: List[str] = None,
        urls: List[str] = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 临时可访问的url列表，过期时间2小时
        self.temporary_urls = temporary_urls
        # 图片的不可访问url列表，发布商品时使用
        self.urls = urls

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.temporary_urls is not None:
            result['temporary_urls'] = self.temporary_urls
        if self.urls is not None:
            result['urls'] = self.urls
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('temporary_urls') is not None:
            self.temporary_urls = m.get('temporary_urls')
        if m.get('urls') is not None:
            self.urls = m.get('urls')
        return self


class ExecConsumecardOrdertrywithdrawRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        end_block_number: int = None,
        order_id_list: List[str] = None,
        start_block_number: int = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 需要提现的订单分布的区块结束高度
        self.end_block_number = end_block_number
        # 需要提现的订单Id列表(不要超过100个Id)
        self.order_id_list = order_id_list
        # 需要提现的订单分布的区块起始高度
        self.start_block_number = start_block_number

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.end_block_number is not None:
            result['end_block_number'] = self.end_block_number
        if self.order_id_list is not None:
            result['order_id_list'] = self.order_id_list
        if self.start_block_number is not None:
            result['start_block_number'] = self.start_block_number
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('end_block_number') is not None:
            self.end_block_number = m.get('end_block_number')
        if m.get('order_id_list') is not None:
            self.order_id_list = m.get('order_id_list')
        if m.get('start_block_number') is not None:
            self.start_block_number = m.get('start_block_number')
        return self


class ExecConsumecardOrdertrywithdrawResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        withdraw_total_amount: str = None,
        withdraw_total_count: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 试算总提现金额(单位:元,精确到分)
        self.withdraw_total_amount = withdraw_total_amount
        # 试算提现订单总笔数
        self.withdraw_total_count = withdraw_total_count

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.withdraw_total_amount is not None:
            result['withdraw_total_amount'] = self.withdraw_total_amount
        if self.withdraw_total_count is not None:
            result['withdraw_total_count'] = self.withdraw_total_count
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('withdraw_total_amount') is not None:
            self.withdraw_total_amount = m.get('withdraw_total_amount')
        if m.get('withdraw_total_count') is not None:
            self.withdraw_total_count = m.get('withdraw_total_count')
        return self


class ExecConsumecardOrderwithdrawbyblocknumRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        end_block_number: int = None,
        start_block_number: int = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 需要提现的订单分布的区块结束高度
        self.end_block_number = end_block_number
        # 需要提现的订单分布的区块起始高度
        self.start_block_number = start_block_number

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.end_block_number, 'end_block_number')
        self.validate_required(self.start_block_number, 'start_block_number')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.end_block_number is not None:
            result['end_block_number'] = self.end_block_number
        if self.start_block_number is not None:
            result['start_block_number'] = self.start_block_number
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('end_block_number') is not None:
            self.end_block_number = m.get('end_block_number')
        if m.get('start_block_number') is not None:
            self.start_block_number = m.get('start_block_number')
        return self


class ExecConsumecardOrderwithdrawbyblocknumResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        withdraw_biz_id: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 提现单编号(跟踪提现任务)
        self.withdraw_biz_id = withdraw_biz_id

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.withdraw_biz_id is not None:
            result['withdraw_biz_id'] = self.withdraw_biz_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('withdraw_biz_id') is not None:
            self.withdraw_biz_id = m.get('withdraw_biz_id')
        return self


class ExecConsumecardOrderwithdrawbyidsRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        order_id_list: List[str] = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 订单列表(不要超过100个Id)
        self.order_id_list = order_id_list

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.order_id_list, 'order_id_list')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.order_id_list is not None:
            result['order_id_list'] = self.order_id_list
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('order_id_list') is not None:
            self.order_id_list = m.get('order_id_list')
        return self


class ExecConsumecardOrderwithdrawbyidsResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        withdraw_biz_id: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 提现单编号(跟踪提现任务)
        self.withdraw_biz_id = withdraw_biz_id

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.withdraw_biz_id is not None:
            result['withdraw_biz_id'] = self.withdraw_biz_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('withdraw_biz_id') is not None:
            self.withdraw_biz_id = m.get('withdraw_biz_id')
        return self


class GetConsumecardOrderwithdrawresultRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        withdraw_biz_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 提现单编号
        self.withdraw_biz_id = withdraw_biz_id

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.withdraw_biz_id, 'withdraw_biz_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.withdraw_biz_id is not None:
            result['withdraw_biz_id'] = self.withdraw_biz_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('withdraw_biz_id') is not None:
            self.withdraw_biz_id = m.get('withdraw_biz_id')
        return self


class GetConsumecardOrderwithdrawresultResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        expected_withdraw_amount: str = None,
        status: str = None,
        withdraw_approval_order_count: int = None,
        withdraw_biz_id: str = None,
        withdraw_total_amount: str = None,
        withdraw_total_count: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 提现任务期望提现的金额(单位:元,精确到分)
        self.expected_withdraw_amount = expected_withdraw_amount
        # 状态
        self.status = status
        # 需要审批后才能提现的交易订单数量
        self.withdraw_approval_order_count = withdraw_approval_order_count
        # 提现单编号
        self.withdraw_biz_id = withdraw_biz_id
        # 提现成功的总金额(单位:元,精确到分)
        self.withdraw_total_amount = withdraw_total_amount
        # 提现成功的总笔数
        self.withdraw_total_count = withdraw_total_count

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.expected_withdraw_amount is not None:
            result['expected_withdraw_amount'] = self.expected_withdraw_amount
        if self.status is not None:
            result['status'] = self.status
        if self.withdraw_approval_order_count is not None:
            result['withdraw_approval_order_count'] = self.withdraw_approval_order_count
        if self.withdraw_biz_id is not None:
            result['withdraw_biz_id'] = self.withdraw_biz_id
        if self.withdraw_total_amount is not None:
            result['withdraw_total_amount'] = self.withdraw_total_amount
        if self.withdraw_total_count is not None:
            result['withdraw_total_count'] = self.withdraw_total_count
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('expected_withdraw_amount') is not None:
            self.expected_withdraw_amount = m.get('expected_withdraw_amount')
        if m.get('status') is not None:
            self.status = m.get('status')
        if m.get('withdraw_approval_order_count') is not None:
            self.withdraw_approval_order_count = m.get('withdraw_approval_order_count')
        if m.get('withdraw_biz_id') is not None:
            self.withdraw_biz_id = m.get('withdraw_biz_id')
        if m.get('withdraw_total_amount') is not None:
            self.withdraw_total_amount = m.get('withdraw_total_amount')
        if m.get('withdraw_total_count') is not None:
            self.withdraw_total_count = m.get('withdraw_total_count')
        return self


class QueryConsumecardWalletredeemableRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        remark: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 备注(长度不要超过500个字符)
        self.remark = remark

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.remark is not None:
            result['remark'] = self.remark
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('remark') is not None:
            self.remark = m.get('remark')
        return self


class QueryConsumecardWalletredeemableResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        redeemable_amount: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 可回退的金额
        self.redeemable_amount = redeemable_amount

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.redeemable_amount is not None:
            result['redeemable_amount'] = self.redeemable_amount
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('redeemable_amount') is not None:
            self.redeemable_amount = m.get('redeemable_amount')
        return self


class QueryConsumecardGoodscreateresultRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        request_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 异步发布商品返回的查询ID。使用该ID查询发布结果。
        self.request_id = request_id

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.request_id, 'request_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.request_id is not None:
            result['request_id'] = self.request_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('request_id') is not None:
            self.request_id = m.get('request_id')
        return self


class QueryConsumecardGoodscreateresultResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        goods_id: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 商品ID
        self.goods_id = goods_id

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.goods_id is not None:
            result['goods_id'] = self.goods_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('goods_id') is not None:
            self.goods_id = m.get('goods_id')
        return self


class QueryConsumecardGoodsRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        goods_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 商品ID
        self.goods_id = goods_id

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.goods_id, 'goods_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.goods_id is not None:
            result['goods_id'] = self.goods_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('goods_id') is not None:
            self.goods_id = m.get('goods_id')
        return self


class QueryConsumecardGoodsResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        goods: GoodsResponse = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 商品信息
        self.goods = goods

    def validate(self):
        if self.goods:
            self.goods.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.goods is not None:
            result['goods'] = self.goods.to_map()
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('goods') is not None:
            temp_model = GoodsResponse()
            self.goods = temp_model.from_map(m['goods'])
        return self


class ApplyConsumecardBillrefundRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        order_id: str = None,
        remark: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 账单ID
        self.order_id = order_id
        # 附言(不要超过500个字符)
        self.remark = remark

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.order_id, 'order_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.order_id is not None:
            result['order_id'] = self.order_id
        if self.remark is not None:
            result['remark'] = self.remark
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('order_id') is not None:
            self.order_id = m.get('order_id')
        if m.get('remark') is not None:
            self.remark = m.get('remark')
        return self


class ApplyConsumecardBillrefundResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class QueryConsumecardPurchaseRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        order_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 交易ID
        self.order_id = order_id

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.order_id, 'order_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.order_id is not None:
            result['order_id'] = self.order_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('order_id') is not None:
            self.order_id = m.get('order_id')
        return self


class QueryConsumecardPurchaseResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        block_instruction: BlockInstruction = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 交易信息
        self.block_instruction = block_instruction

    def validate(self):
        if self.block_instruction:
            self.block_instruction.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.block_instruction is not None:
            result['block_instruction'] = self.block_instruction.to_map()
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('block_instruction') is not None:
            temp_model = BlockInstruction()
            self.block_instruction = temp_model.from_map(m['block_instruction'])
        return self


class QueryConsumecardBlockRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        block_number: int = None,
        chain_id: str = None,
        delegated_tenant_ids: List[str] = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 区块高度
        self.block_number = block_number
        # 链ID，指定要获取的
        self.chain_id = chain_id
        # 代理查询区块信息，传入代理租户需有代理权限。接口会返回调用者和被代理租户能查看的所有交易信息。
        self.delegated_tenant_ids = delegated_tenant_ids

    def validate(self):
        self.validate_required(self.block_number, 'block_number')
        self.validate_required(self.chain_id, 'chain_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.block_number is not None:
            result['block_number'] = self.block_number
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.delegated_tenant_ids is not None:
            result['delegated_tenant_ids'] = self.delegated_tenant_ids
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('block_number') is not None:
            self.block_number = m.get('block_number')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('delegated_tenant_ids') is not None:
            self.delegated_tenant_ids = m.get('delegated_tenant_ids')
        return self


class QueryConsumecardBlockResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        block: Block = None,
        block_number: int = None,
        chain_id: str = None,
        filtered_tx_count: int = None,
        total_tx_count: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 区块信息
        self.block = block
        # 区块高度
        self.block_number = block_number
        # 链ID
        self.chain_id = chain_id
        # 过滤后的交易数量
        self.filtered_tx_count = filtered_tx_count
        # 区块中交易总数
        self.total_tx_count = total_tx_count

    def validate(self):
        if self.block:
            self.block.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.block is not None:
            result['block'] = self.block.to_map()
        if self.block_number is not None:
            result['block_number'] = self.block_number
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.filtered_tx_count is not None:
            result['filtered_tx_count'] = self.filtered_tx_count
        if self.total_tx_count is not None:
            result['total_tx_count'] = self.total_tx_count
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('block') is not None:
            temp_model = Block()
            self.block = temp_model.from_map(m['block'])
        if m.get('block_number') is not None:
            self.block_number = m.get('block_number')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('filtered_tx_count') is not None:
            self.filtered_tx_count = m.get('filtered_tx_count')
        if m.get('total_tx_count') is not None:
            self.total_tx_count = m.get('total_tx_count')
        return self


class QueryConsumecardLastblocknumberRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        return self


class QueryConsumecardLastblocknumberResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        block_number: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 区块链最高区块高度
        self.block_number = block_number

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.block_number is not None:
            result['block_number'] = self.block_number
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('block_number') is not None:
            self.block_number = m.get('block_number')
        return self


class QueryConsumecardGoodsupdateresultRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        request_id: str = None,
        base_request: BaseRequest = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 异步更新商品返回的查询ID。使用该ID查询更新结果。
        self.request_id = request_id
        # 请求参数
        self.base_request = base_request

    def validate(self):
        self.validate_required(self.request_id, 'request_id')
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.request_id is not None:
            result['request_id'] = self.request_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('request_id') is not None:
            self.request_id = m.get('request_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        return self


class QueryConsumecardGoodsupdateresultResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class CancelConsumecardSellerpurchaseRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        order_id: str = None,
        remark: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 交易ID
        self.order_id = order_id
        # 附言
        self.remark = remark

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.order_id, 'order_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.order_id is not None:
            result['order_id'] = self.order_id
        if self.remark is not None:
            result['remark'] = self.remark
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('order_id') is not None:
            self.order_id = m.get('order_id')
        if m.get('remark') is not None:
            self.remark = m.get('remark')
        return self


class CancelConsumecardSellerpurchaseResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class SetConsumecardCommissionRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        category_id: str = None,
        type: int = None,
        account_id: str = None,
        pay_commission_type: str = None,
        commission_rules: List[CommissionRule] = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 分类id（ffaaaaabbbbbb）
        self.category_id = category_id
        # 手续费类型（0:全局，1:商户）
        self.type = type
        # 手续费归属的账户id,如果type为0 ，则该字段必须为空
        self.account_id = account_id
        # 手续费支出方（0.卖家，1.买家，2.平台）
        self.pay_commission_type = pay_commission_type
        # 手续费一级分账。最长为6条
        self.commission_rules = commission_rules

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.category_id, 'category_id')
        self.validate_required(self.type, 'type')
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.pay_commission_type, 'pay_commission_type')
        self.validate_required(self.commission_rules, 'commission_rules')
        if self.commission_rules:
            for k in self.commission_rules:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.category_id is not None:
            result['category_id'] = self.category_id
        if self.type is not None:
            result['type'] = self.type
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.pay_commission_type is not None:
            result['pay_commission_type'] = self.pay_commission_type
        result['commission_rules'] = []
        if self.commission_rules is not None:
            for k in self.commission_rules:
                result['commission_rules'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('category_id') is not None:
            self.category_id = m.get('category_id')
        if m.get('type') is not None:
            self.type = m.get('type')
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('pay_commission_type') is not None:
            self.pay_commission_type = m.get('pay_commission_type')
        self.commission_rules = []
        if m.get('commission_rules') is not None:
            for k in m.get('commission_rules'):
                temp_model = CommissionRule()
                self.commission_rules.append(temp_model.from_map(k))
        return self


class SetConsumecardCommissionResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class RemoveConsumecardCommissionRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        type: int = None,
        category_id: str = None,
        account_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 手续费类型（0:全局，1:商户）
        self.type = type
        # 分类id（ffaaaaabbbbbb）
        self.category_id = category_id
        # 手续费归属的账户id,如果type为0 ，则该字段必须为空
        self.account_id = account_id

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.type, 'type')
        self.validate_required(self.category_id, 'category_id')
        self.validate_required(self.account_id, 'account_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.type is not None:
            result['type'] = self.type
        if self.category_id is not None:
            result['category_id'] = self.category_id
        if self.account_id is not None:
            result['account_id'] = self.account_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('type') is not None:
            self.type = m.get('type')
        if m.get('category_id') is not None:
            self.category_id = m.get('category_id')
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        return self


class RemoveConsumecardCommissionResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class QueryConsumecardCommissionRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        category_id: str = None,
        type: int = None,
        account_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 分类id（ffaaaaabbbbbb）
        self.category_id = category_id
        # 手续费类型（0:全局，1:商户）
        self.type = type
        # 手续费归属的账户id,如果type为0 ，则该字段必须为空
        self.account_id = account_id

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.category_id, 'category_id')
        self.validate_required(self.type, 'type')
        self.validate_required(self.account_id, 'account_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.category_id is not None:
            result['category_id'] = self.category_id
        if self.type is not None:
            result['type'] = self.type
        if self.account_id is not None:
            result['account_id'] = self.account_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('category_id') is not None:
            self.category_id = m.get('category_id')
        if m.get('type') is not None:
            self.type = m.get('type')
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        return self


class QueryConsumecardCommissionResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        commission_rules: List[CommissionRuleResponse] = None,
        category_id: str = None,
        type: int = None,
        account_id: str = None,
        pay_commission_type: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 手续费规则结果
        self.commission_rules = commission_rules
        # 分类id（ffaaaaabbbbbb，如果存在则直接更新）
        self.category_id = category_id
        # 手续费类型（0:全局，1:商户）
        self.type = type
        # 手续费归属的账户id,如果type为0 ，则该字段必须为空
        self.account_id = account_id
        # 手续费支出方（0.卖家，1.买家，2.平台）
        self.pay_commission_type = pay_commission_type

    def validate(self):
        if self.commission_rules:
            for k in self.commission_rules:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        result['commission_rules'] = []
        if self.commission_rules is not None:
            for k in self.commission_rules:
                result['commission_rules'].append(k.to_map() if k else None)
        if self.category_id is not None:
            result['category_id'] = self.category_id
        if self.type is not None:
            result['type'] = self.type
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.pay_commission_type is not None:
            result['pay_commission_type'] = self.pay_commission_type
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        self.commission_rules = []
        if m.get('commission_rules') is not None:
            for k in m.get('commission_rules'):
                temp_model = CommissionRuleResponse()
                self.commission_rules.append(temp_model.from_map(k))
        if m.get('category_id') is not None:
            self.category_id = m.get('category_id')
        if m.get('type') is not None:
            self.type = m.get('type')
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('pay_commission_type') is not None:
            self.pay_commission_type = m.get('pay_commission_type')
        return self


class SetConsumecardCommissionmanagerRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        set_account_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 手续费管理员账户
        self.set_account_id = set_account_id

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.set_account_id is not None:
            result['set_account_id'] = self.set_account_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('set_account_id') is not None:
            self.set_account_id = m.get('set_account_id')
        return self


class SetConsumecardCommissionmanagerResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class SetConsumecardGoodsstatusRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        goods_id: str = None,
        status: int = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 商品ID
        self.goods_id = goods_id
        # 商品状态：0上线，1下线
        self.status = status

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.goods_id, 'goods_id')
        self.validate_required(self.status, 'status')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.goods_id is not None:
            result['goods_id'] = self.goods_id
        if self.status is not None:
            result['status'] = self.status
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('goods_id') is not None:
            self.goods_id = m.get('goods_id')
        if m.get('status') is not None:
            self.status = m.get('status')
        return self


class SetConsumecardGoodsstatusResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class CreateConsumecardReceiptcontractRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        contract_number: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础请求对象
        self.base_request = base_request
        # 合同编号，纯数字
        self.contract_number = contract_number

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.contract_number, 'contract_number')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.contract_number is not None:
            result['contract_number'] = self.contract_number
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('contract_number') is not None:
            self.contract_number = m.get('contract_number')
        return self


class CreateConsumecardReceiptcontractResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class RemoveConsumecardReceiptcontractRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        contract_number: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础信息对象
        self.base_request = base_request
        # 合同编号，纯数字
        self.contract_number = contract_number

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.contract_number, 'contract_number')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.contract_number is not None:
            result['contract_number'] = self.contract_number
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('contract_number') is not None:
            self.contract_number = m.get('contract_number')
        return self


class RemoveConsumecardReceiptcontractResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class QueryConsumecardReceiptcontractRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        contract_number: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础请求对象
        self.base_request = base_request
        # 合同编号，纯数字
        self.contract_number = contract_number

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.contract_number, 'contract_number')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.contract_number is not None:
            result['contract_number'] = self.contract_number
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('contract_number') is not None:
            self.contract_number = m.get('contract_number')
        return self


class QueryConsumecardReceiptcontractResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        uid: str = None,
        platform_tenant_id: str = None,
        product_code: str = None,
        certification_id: str = None,
        contract_number: str = None,
        id_number: str = None,
        id_type: int = None,
        name: str = None,
        account_id: str = None,
        user_id: str = None,
        status: int = None,
        sign_date: str = None,
        cancel_date: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 签约ID= platform_tenant_id+product_code+certification_id+sales_plan(分库分表路由)
        self.uid = uid
        # 平台租户ID
        self.platform_tenant_id = platform_tenant_id
        # 场景码(需要申请)
        self.product_code = product_code
        # 认证平台ID，本期支付宝用户ID（分库分表路由字段）
        self.certification_id = certification_id
        # 合同编号
        self.contract_number = contract_number
        # 证件编号
        self.id_number = id_number
        # 证件类型
        self.id_type = id_type
        # 用户姓名/企业名称
        self.name = name
        # 客户编号（链上账号）
        # 
        # 已经创建成功的链上账户
        self.account_id = account_id
        # 客户编号（业务系统）
        # 
        # 平台业务系统IP
        self.user_id = user_id
        # 签约状态
        # 
        # 0：未签约 1：已签约 2：已解约（主动解约、过期解约）
        self.status = status
        # 签约日期
        # 
        self.sign_date = sign_date
        # 解约日期
        # 
        # 
        self.cancel_date = cancel_date

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.uid is not None:
            result['uid'] = self.uid
        if self.platform_tenant_id is not None:
            result['platform_tenant_id'] = self.platform_tenant_id
        if self.product_code is not None:
            result['product_code'] = self.product_code
        if self.certification_id is not None:
            result['certification_id'] = self.certification_id
        if self.contract_number is not None:
            result['contract_number'] = self.contract_number
        if self.id_number is not None:
            result['id_number'] = self.id_number
        if self.id_type is not None:
            result['id_type'] = self.id_type
        if self.name is not None:
            result['name'] = self.name
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.user_id is not None:
            result['user_id'] = self.user_id
        if self.status is not None:
            result['status'] = self.status
        if self.sign_date is not None:
            result['sign_date'] = self.sign_date
        if self.cancel_date is not None:
            result['cancel_date'] = self.cancel_date
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('uid') is not None:
            self.uid = m.get('uid')
        if m.get('platform_tenant_id') is not None:
            self.platform_tenant_id = m.get('platform_tenant_id')
        if m.get('product_code') is not None:
            self.product_code = m.get('product_code')
        if m.get('certification_id') is not None:
            self.certification_id = m.get('certification_id')
        if m.get('contract_number') is not None:
            self.contract_number = m.get('contract_number')
        if m.get('id_number') is not None:
            self.id_number = m.get('id_number')
        if m.get('id_type') is not None:
            self.id_type = m.get('id_type')
        if m.get('name') is not None:
            self.name = m.get('name')
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('user_id') is not None:
            self.user_id = m.get('user_id')
        if m.get('status') is not None:
            self.status = m.get('status')
        if m.get('sign_date') is not None:
            self.sign_date = m.get('sign_date')
        if m.get('cancel_date') is not None:
            self.cancel_date = m.get('cancel_date')
        return self


class CreateConsumecardBillingcontractRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        platform_tenant_id: str = None,
        certification_id: str = None,
        company_name: str = None,
        company_short_name: str = None,
        identity: str = None,
        usci: str = None,
        user_id: str = None,
        address: str = None,
        service_content: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础请求结构
        self.base_request = base_request
        # 购买数字商品服务平台的租户ID
        self.platform_tenant_id = platform_tenant_id
        # 认证平台ID 本期支付宝用户ID
        self.certification_id = certification_id
        # 企业名称 企业营业执照名称
        self.company_name = company_name
        # 企业简称 默认企业营业执照名称，可自定义
        self.company_short_name = company_short_name
        # 身份信息 金融机构/非金融机构
        self.identity = identity
        # 统一信用社会代码
        self.usci = usci
        # 客户编号（业务系统） 平台业务系统IP
        self.user_id = user_id
        # 营业执照地址
        self.address = address
        # 说明商家收款原因-字数中文500字以内（例如ETC服务,加油卡服务）
        self.service_content = service_content

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.platform_tenant_id, 'platform_tenant_id')
        self.validate_required(self.certification_id, 'certification_id')
        self.validate_required(self.company_name, 'company_name')
        self.validate_required(self.company_short_name, 'company_short_name')
        self.validate_required(self.identity, 'identity')
        self.validate_required(self.usci, 'usci')
        self.validate_required(self.user_id, 'user_id')
        self.validate_required(self.address, 'address')
        self.validate_required(self.service_content, 'service_content')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.platform_tenant_id is not None:
            result['platform_tenant_id'] = self.platform_tenant_id
        if self.certification_id is not None:
            result['certification_id'] = self.certification_id
        if self.company_name is not None:
            result['company_name'] = self.company_name
        if self.company_short_name is not None:
            result['company_short_name'] = self.company_short_name
        if self.identity is not None:
            result['identity'] = self.identity
        if self.usci is not None:
            result['usci'] = self.usci
        if self.user_id is not None:
            result['user_id'] = self.user_id
        if self.address is not None:
            result['address'] = self.address
        if self.service_content is not None:
            result['service_content'] = self.service_content
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('platform_tenant_id') is not None:
            self.platform_tenant_id = m.get('platform_tenant_id')
        if m.get('certification_id') is not None:
            self.certification_id = m.get('certification_id')
        if m.get('company_name') is not None:
            self.company_name = m.get('company_name')
        if m.get('company_short_name') is not None:
            self.company_short_name = m.get('company_short_name')
        if m.get('identity') is not None:
            self.identity = m.get('identity')
        if m.get('usci') is not None:
            self.usci = m.get('usci')
        if m.get('user_id') is not None:
            self.user_id = m.get('user_id')
        if m.get('address') is not None:
            self.address = m.get('address')
        if m.get('service_content') is not None:
            self.service_content = m.get('service_content')
        return self


class CreateConsumecardBillingcontractResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class RemoveConsumecardBillingcontractRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        certification_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础请求对象
        self.base_request = base_request
        # 认证平台ID 本期支付宝用户ID
        self.certification_id = certification_id

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.certification_id, 'certification_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.certification_id is not None:
            result['certification_id'] = self.certification_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('certification_id') is not None:
            self.certification_id = m.get('certification_id')
        return self


class RemoveConsumecardBillingcontractResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class QueryConsumecardBillingcontractRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        certification_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础请求结构
        self.base_request = base_request
        # 认证平台ID 本期支付宝用户ID
        self.certification_id = certification_id

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.certification_id, 'certification_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.certification_id is not None:
            result['certification_id'] = self.certification_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('certification_id') is not None:
            self.certification_id = m.get('certification_id')
        return self


class QueryConsumecardBillingcontractResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        base_response: BaseResponseData = None,
        name: str = None,
        account_id: str = None,
        certification_id: str = None,
        product_code: str = None,
        sign_time: str = None,
        invalid_time: str = None,
        arrangement_url: str = None,
        status: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 基础响应对象
        self.base_response = base_response
        # 商家名称
        self.name = name
        # 商家链上账户ID
        self.account_id = account_id
        # 认证平台ID 例如：支付宝用户ID
        self.certification_id = certification_id
        # 场景码(需要申请)
        self.product_code = product_code
        # 签约时间
        self.sign_time = sign_time
        # 解约时间
        self.invalid_time = invalid_time
        # 签约链接
        self.arrangement_url = arrangement_url
        # 签约状态
        self.status = status

    def validate(self):
        if self.base_response:
            self.base_response.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.base_response is not None:
            result['base_response'] = self.base_response.to_map()
        if self.name is not None:
            result['name'] = self.name
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.certification_id is not None:
            result['certification_id'] = self.certification_id
        if self.product_code is not None:
            result['product_code'] = self.product_code
        if self.sign_time is not None:
            result['sign_time'] = self.sign_time
        if self.invalid_time is not None:
            result['invalid_time'] = self.invalid_time
        if self.arrangement_url is not None:
            result['arrangement_url'] = self.arrangement_url
        if self.status is not None:
            result['status'] = self.status
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('base_response') is not None:
            temp_model = BaseResponseData()
            self.base_response = temp_model.from_map(m['base_response'])
        if m.get('name') is not None:
            self.name = m.get('name')
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('certification_id') is not None:
            self.certification_id = m.get('certification_id')
        if m.get('product_code') is not None:
            self.product_code = m.get('product_code')
        if m.get('sign_time') is not None:
            self.sign_time = m.get('sign_time')
        if m.get('invalid_time') is not None:
            self.invalid_time = m.get('invalid_time')
        if m.get('arrangement_url') is not None:
            self.arrangement_url = m.get('arrangement_url')
        if m.get('status') is not None:
            self.status = m.get('status')
        return self


class AddConsumecardCommissionpartyRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        account_id: str = None,
        commission_rule: CommissionRule = None,
        type: int = None,
        category_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础请求对象
        self.base_request = base_request
        # 收费规则归属方
        self.account_id = account_id
        # 手续费规则
        self.commission_rule = commission_rule
        # 手续费类型（0:全局，1:商户）
        self.type = type
        # 分类id（ffaaaaabbbbbb）
        self.category_id = category_id

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.commission_rule, 'commission_rule')
        if self.commission_rule:
            self.commission_rule.validate()
        self.validate_required(self.type, 'type')
        self.validate_required(self.category_id, 'category_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.commission_rule is not None:
            result['commission_rule'] = self.commission_rule.to_map()
        if self.type is not None:
            result['type'] = self.type
        if self.category_id is not None:
            result['category_id'] = self.category_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('commission_rule') is not None:
            temp_model = CommissionRule()
            self.commission_rule = temp_model.from_map(m['commission_rule'])
        if m.get('type') is not None:
            self.type = m.get('type')
        if m.get('category_id') is not None:
            self.category_id = m.get('category_id')
        return self


class AddConsumecardCommissionpartyResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class RemoveConsumecardCommissionpartyRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        category_id: str = None,
        type: int = None,
        rule_account_id: str = None,
        account_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础请求结构
        self.base_request = base_request
        # 分类id（ffaaaaabbbbbb）
        self.category_id = category_id
        # 手续费类型（0:全局，1:商户）
        self.type = type
        # 一级分账方accountId
        self.rule_account_id = rule_account_id
        # 手续费归属的账户id,如果type为0 ，则该字段必须为空
        self.account_id = account_id

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.category_id, 'category_id')
        self.validate_required(self.type, 'type')
        self.validate_required(self.rule_account_id, 'rule_account_id')
        self.validate_required(self.account_id, 'account_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.category_id is not None:
            result['category_id'] = self.category_id
        if self.type is not None:
            result['type'] = self.type
        if self.rule_account_id is not None:
            result['rule_account_id'] = self.rule_account_id
        if self.account_id is not None:
            result['account_id'] = self.account_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('category_id') is not None:
            self.category_id = m.get('category_id')
        if m.get('type') is not None:
            self.type = m.get('type')
        if m.get('rule_account_id') is not None:
            self.rule_account_id = m.get('rule_account_id')
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        return self


class RemoveConsumecardCommissionpartyResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class AddConsumecardCommissionperiodRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        category_id: str = None,
        type: int = None,
        account_id: str = None,
        rule_account_id: str = None,
        commission_period: CommissionPeriod = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础结构体
        self.base_request = base_request
        # 分类id（ffaaaaabbbbbb）
        self.category_id = category_id
        # 手续费类型（0:全局，1:商户）
        self.type = type
        # 手续费归属的账户id,如果type为0 ，则该字段必须为空
        self.account_id = account_id
        # 一级分账方
        self.rule_account_id = rule_account_id
        # 手续费周期
        self.commission_period = commission_period

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.category_id, 'category_id')
        self.validate_required(self.type, 'type')
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.rule_account_id, 'rule_account_id')
        self.validate_required(self.commission_period, 'commission_period')
        if self.commission_period:
            self.commission_period.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.category_id is not None:
            result['category_id'] = self.category_id
        if self.type is not None:
            result['type'] = self.type
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.rule_account_id is not None:
            result['rule_account_id'] = self.rule_account_id
        if self.commission_period is not None:
            result['commission_period'] = self.commission_period.to_map()
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('category_id') is not None:
            self.category_id = m.get('category_id')
        if m.get('type') is not None:
            self.type = m.get('type')
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('rule_account_id') is not None:
            self.rule_account_id = m.get('rule_account_id')
        if m.get('commission_period') is not None:
            temp_model = CommissionPeriod()
            self.commission_period = temp_model.from_map(m['commission_period'])
        return self


class AddConsumecardCommissionperiodResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class RemoveConsumecardCommissionperiodRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        category_id: str = None,
        account_id: str = None,
        rule_account_id: str = None,
        type: int = None,
        start_time_mills: int = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础请求对象
        self.base_request = base_request
        # 商品分类id（ffaaaaabbbbbb）
        self.category_id = category_id
        # 手续费归属的账户id,如果type为0 ，则该字段必须为空
        self.account_id = account_id
        # 一级分账方
        self.rule_account_id = rule_account_id
        # 手续费类型（0:全局，1:商户）
        self.type = type
        # 手续费开始时间,用于查找去除的手续费（无结束时间）
        self.start_time_mills = start_time_mills

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.category_id, 'category_id')
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.rule_account_id, 'rule_account_id')
        self.validate_required(self.type, 'type')
        self.validate_required(self.start_time_mills, 'start_time_mills')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.category_id is not None:
            result['category_id'] = self.category_id
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.rule_account_id is not None:
            result['rule_account_id'] = self.rule_account_id
        if self.type is not None:
            result['type'] = self.type
        if self.start_time_mills is not None:
            result['start_time_mills'] = self.start_time_mills
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('category_id') is not None:
            self.category_id = m.get('category_id')
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('rule_account_id') is not None:
            self.rule_account_id = m.get('rule_account_id')
        if m.get('type') is not None:
            self.type = m.get('type')
        if m.get('start_time_mills') is not None:
            self.start_time_mills = m.get('start_time_mills')
        return self


class RemoveConsumecardCommissionperiodResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class QueryConsumecardCounterRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequest = None,
        type: int = None,
        query_id: str = None,
        query_time_in_mills: int = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础结构体
        self.base_request = base_request
        # 查询的类别（0 商家，1 商品）
        self.type = type
        # 查询的id（type：0 为accountId 1为goodsId）
        self.query_id = query_id
        # 查询的时间戳对应的counter
        self.query_time_in_mills = query_time_in_mills

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.type, 'type')
        self.validate_required(self.query_id, 'query_id')
        self.validate_required(self.query_time_in_mills, 'query_time_in_mills')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.type is not None:
            result['type'] = self.type
        if self.query_id is not None:
            result['query_id'] = self.query_id
        if self.query_time_in_mills is not None:
            result['query_time_in_mills'] = self.query_time_in_mills
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequest()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('type') is not None:
            self.type = m.get('type')
        if m.get('query_id') is not None:
            self.query_id = m.get('query_id')
        if m.get('query_time_in_mills') is not None:
            self.query_time_in_mills = m.get('query_time_in_mills')
        return self


class QueryConsumecardCounterResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        type: int = None,
        query_id: str = None,
        day_counter: CounterData = None,
        month_counter: CounterData = None,
        year_counter: CounterData = None,
        quarterly_counter: CounterData = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 查询的类别（0 商家，1 商品）
        self.type = type
        # 查询的id（type：0 为accountId 1为goodsId）
        self.query_id = query_id
        # 日统计数据
        self.day_counter = day_counter
        # 月统计数据
        self.month_counter = month_counter
        # 年统计数据
        self.year_counter = year_counter
        # 季度统计数据
        self.quarterly_counter = quarterly_counter

    def validate(self):
        if self.day_counter:
            self.day_counter.validate()
        if self.month_counter:
            self.month_counter.validate()
        if self.year_counter:
            self.year_counter.validate()
        if self.quarterly_counter:
            self.quarterly_counter.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.type is not None:
            result['type'] = self.type
        if self.query_id is not None:
            result['query_id'] = self.query_id
        if self.day_counter is not None:
            result['day_counter'] = self.day_counter.to_map()
        if self.month_counter is not None:
            result['month_counter'] = self.month_counter.to_map()
        if self.year_counter is not None:
            result['year_counter'] = self.year_counter.to_map()
        if self.quarterly_counter is not None:
            result['quarterly_counter'] = self.quarterly_counter.to_map()
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('type') is not None:
            self.type = m.get('type')
        if m.get('query_id') is not None:
            self.query_id = m.get('query_id')
        if m.get('day_counter') is not None:
            temp_model = CounterData()
            self.day_counter = temp_model.from_map(m['day_counter'])
        if m.get('month_counter') is not None:
            temp_model = CounterData()
            self.month_counter = temp_model.from_map(m['month_counter'])
        if m.get('year_counter') is not None:
            temp_model = CounterData()
            self.year_counter = temp_model.from_map(m['year_counter'])
        if m.get('quarterly_counter') is not None:
            temp_model = CounterData()
            self.quarterly_counter = temp_model.from_map(m['quarterly_counter'])
        return self


class SetConsumecardProductcodeRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        tenant_id: str = None,
        product_code: str = None,
        account_name: str = None,
        account_id: str = None,
        memo: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 要配置的租户ID
        self.tenant_id = tenant_id
        # 场景码
        self.product_code = product_code
        # 账户链上名称
        self.account_name = account_name
        # 账户链上ID
        self.account_id = account_id
        # 备注信息
        self.memo = memo

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.tenant_id, 'tenant_id')
        self.validate_required(self.product_code, 'product_code')
        self.validate_required(self.account_name, 'account_name')
        self.validate_required(self.account_id, 'account_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.tenant_id is not None:
            result['tenant_id'] = self.tenant_id
        if self.product_code is not None:
            result['product_code'] = self.product_code
        if self.account_name is not None:
            result['account_name'] = self.account_name
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.memo is not None:
            result['memo'] = self.memo
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('tenant_id') is not None:
            self.tenant_id = m.get('tenant_id')
        if m.get('product_code') is not None:
            self.product_code = m.get('product_code')
        if m.get('account_name') is not None:
            self.account_name = m.get('account_name')
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        return self


class SetConsumecardProductcodeResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class QueryConsumecardProductcodeRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        tenant_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 要查询的租户信息，不传查全部信息
        self.tenant_id = tenant_id

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.tenant_id is not None:
            result['tenant_id'] = self.tenant_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('tenant_id') is not None:
            self.tenant_id = m.get('tenant_id')
        return self


class QueryConsumecardProductcodeResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        product_code_infos: List[ProductCodeInfo] = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 场景码配置信息列表
        self.product_code_infos = product_code_infos

    def validate(self):
        if self.product_code_infos:
            for k in self.product_code_infos:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        result['product_code_infos'] = []
        if self.product_code_infos is not None:
            for k in self.product_code_infos:
                result['product_code_infos'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        self.product_code_infos = []
        if m.get('product_code_infos') is not None:
            for k in m.get('product_code_infos'):
                temp_model = ProductCodeInfo()
                self.product_code_infos.append(temp_model.from_map(k))
        return self


class RemoveConsumecardProductcodeRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        tenant_id: str = None,
        product_code: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 要操作的租户ID
        self.tenant_id = tenant_id
        # 
        # 场景码
        self.product_code = product_code

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.tenant_id, 'tenant_id')
        self.validate_required(self.product_code, 'product_code')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.tenant_id is not None:
            result['tenant_id'] = self.tenant_id
        if self.product_code is not None:
            result['product_code'] = self.product_code
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('tenant_id') is not None:
            self.tenant_id = m.get('tenant_id')
        if m.get('product_code') is not None:
            self.product_code = m.get('product_code')
        return self


class RemoveConsumecardProductcodeResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class QueryConsumecardGoodsimageRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        product_code: str = None,
        urls: List[str] = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 场景码(入驻时申请)
        self.product_code = product_code
        # 要查询的图片不可访问url列表
        self.urls = urls

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.product_code, 'product_code')
        self.validate_required(self.urls, 'urls')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.product_code is not None:
            result['product_code'] = self.product_code
        if self.urls is not None:
            result['urls'] = self.urls
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('product_code') is not None:
            self.product_code = m.get('product_code')
        if m.get('urls') is not None:
            self.urls = m.get('urls')
        return self


class QueryConsumecardGoodsimageResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        temporary_urls: List[str] = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 图片的临时可访问url列表，url过期时间2小时
        self.temporary_urls = temporary_urls

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.temporary_urls is not None:
            result['temporary_urls'] = self.temporary_urls
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('temporary_urls') is not None:
            self.temporary_urls = m.get('temporary_urls')
        return self


class UploadConsumecardFileRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        product_code: str = None,
        file_object: BinaryIO = None,
        file_object_name: str = None,
        file_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 场景码(入驻时申请)
        self.product_code = product_code
        # file_id
        # 待上传文件
        self.file_object = file_object
        # 待上传文件名
        self.file_object_name = file_object_name
        self.file_id = file_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.product_code, 'product_code')
        self.validate_required(self.file_id, 'file_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.product_code is not None:
            result['product_code'] = self.product_code
        if self.file_object is not None:
            result['fileObject'] = self.file_object
        if self.file_object_name is not None:
            result['fileObjectName'] = self.file_object_name
        if self.file_id is not None:
            result['file_id'] = self.file_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('product_code') is not None:
            self.product_code = m.get('product_code')
        if m.get('fileObject') is not None:
            self.file_object = m.get('fileObject')
        if m.get('fileObjectName') is not None:
            self.file_object_name = m.get('fileObjectName')
        if m.get('file_id') is not None:
            self.file_id = m.get('file_id')
        return self


class UploadConsumecardFileResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        url: str = None,
        temporary_url: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 图片的不可访问url，发布商品时使用
        self.url = url
        # 临时可访问的url，过期时间2小时
        self.temporary_url = temporary_url

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.url is not None:
            result['url'] = self.url
        if self.temporary_url is not None:
            result['temporary_url'] = self.temporary_url
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('url') is not None:
            self.url = m.get('url')
        if m.get('temporary_url') is not None:
            self.temporary_url = m.get('temporary_url')
        return self


class QueryCouponRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        collection_id: str = None,
        coupon_id: str = None,
        out_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 批次ID
        self.collection_id = collection_id
        # 电子券ID
        self.coupon_id = coupon_id
        # 交易幂等ID，长度不大于128
        self.out_tx_id = out_tx_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.collection_id, 'collection_id')
        self.validate_required(self.coupon_id, 'coupon_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.collection_id is not None:
            result['collection_id'] = self.collection_id
        if self.coupon_id is not None:
            result['coupon_id'] = self.coupon_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('collection_id') is not None:
            self.collection_id = m.get('collection_id')
        if m.get('coupon_id') is not None:
            self.coupon_id = m.get('coupon_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        return self


class QueryCouponResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        coupon: Coupon = None,
        block_number: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 电子券详细信息
        self.coupon = coupon
        # 交易区块高度
        self.block_number = block_number

    def validate(self):
        if self.coupon:
            self.coupon.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.coupon is not None:
            result['coupon'] = self.coupon.to_map()
        if self.block_number is not None:
            result['block_number'] = self.block_number
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('coupon') is not None:
            temp_model = Coupon()
            self.coupon = temp_model.from_map(m['coupon'])
        if m.get('block_number') is not None:
            self.block_number = m.get('block_number')
        return self


class CreateCouponRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        coupon_info: CouponCreate = None,
        out_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 创建电子券的参数
        self.coupon_info = coupon_info
        # 交易幂等ID
        self.out_tx_id = out_tx_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.coupon_info, 'coupon_info')
        if self.coupon_info:
            self.coupon_info.validate()
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.coupon_info is not None:
            result['coupon_info'] = self.coupon_info.to_map()
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('coupon_info') is not None:
            temp_model = CouponCreate()
            self.coupon_info = temp_model.from_map(m['coupon_info'])
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        return self


class CreateCouponResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        block_number: int = None,
        coupon_id: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 交易块高
        self.block_number = block_number
        # 电子券ID
        self.coupon_id = coupon_id

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.block_number is not None:
            result['block_number'] = self.block_number
        if self.coupon_id is not None:
            result['coupon_id'] = self.coupon_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('block_number') is not None:
            self.block_number = m.get('block_number')
        if m.get('coupon_id') is not None:
            self.coupon_id = m.get('coupon_id')
        return self


class ExecCouponForbiddenRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        collection_id: str = None,
        coupon_id: str = None,
        out_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 批次ID
        self.collection_id = collection_id
        # 电子券ID
        self.coupon_id = coupon_id
        # 交易幂等ID，长度限制128
        self.out_tx_id = out_tx_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.collection_id, 'collection_id')
        self.validate_required(self.coupon_id, 'coupon_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.collection_id is not None:
            result['collection_id'] = self.collection_id
        if self.coupon_id is not None:
            result['coupon_id'] = self.coupon_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('collection_id') is not None:
            self.collection_id = m.get('collection_id')
        if m.get('coupon_id') is not None:
            self.coupon_id = m.get('coupon_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        return self


class ExecCouponForbiddenResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        block_number: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 交易区块高度
        self.block_number = block_number

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.block_number is not None:
            result['block_number'] = self.block_number
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('block_number') is not None:
            self.block_number = m.get('block_number')
        return self


class ExecCouponEnableRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        collection_id: str = None,
        coupon_id: str = None,
        out_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 批次ID
        self.collection_id = collection_id
        # 电子券ID
        self.coupon_id = coupon_id
        # 交易幂等ID
        self.out_tx_id = out_tx_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.collection_id, 'collection_id')
        self.validate_required(self.coupon_id, 'coupon_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.collection_id is not None:
            result['collection_id'] = self.collection_id
        if self.coupon_id is not None:
            result['coupon_id'] = self.coupon_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('collection_id') is not None:
            self.collection_id = m.get('collection_id')
        if m.get('coupon_id') is not None:
            self.coupon_id = m.get('coupon_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        return self


class ExecCouponEnableResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        block_number: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 交易区块高度
        self.block_number = block_number

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.block_number is not None:
            result['block_number'] = self.block_number
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('block_number') is not None:
            self.block_number = m.get('block_number')
        return self


class ExecCouponExpireRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        collection_id: str = None,
        coupon_id: str = None,
        out_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 批次ID
        self.collection_id = collection_id
        # 电子券ID
        self.coupon_id = coupon_id
        # 交易幂等ID
        self.out_tx_id = out_tx_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.collection_id, 'collection_id')
        self.validate_required(self.coupon_id, 'coupon_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.collection_id is not None:
            result['collection_id'] = self.collection_id
        if self.coupon_id is not None:
            result['coupon_id'] = self.coupon_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('collection_id') is not None:
            self.collection_id = m.get('collection_id')
        if m.get('coupon_id') is not None:
            self.coupon_id = m.get('coupon_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        return self


class ExecCouponExpireResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        block_number: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 交易区块高度
        self.block_number = block_number

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.block_number is not None:
            result['block_number'] = self.block_number
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('block_number') is not None:
            self.block_number = m.get('block_number')
        return self


class ExecCouponWriteoffRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        collection_id: str = None,
        coupon_id: str = None,
        out_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 批次ID
        self.collection_id = collection_id
        # 电子券ID
        self.coupon_id = coupon_id
        # 交易幂等ID
        self.out_tx_id = out_tx_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.collection_id, 'collection_id')
        self.validate_required(self.coupon_id, 'coupon_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.collection_id is not None:
            result['collection_id'] = self.collection_id
        if self.coupon_id is not None:
            result['coupon_id'] = self.coupon_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('collection_id') is not None:
            self.collection_id = m.get('collection_id')
        if m.get('coupon_id') is not None:
            self.coupon_id = m.get('coupon_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        return self


class ExecCouponWriteoffResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        block_number: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 交易区块高度
        self.block_number = block_number

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.block_number is not None:
            result['block_number'] = self.block_number
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('block_number') is not None:
            self.block_number = m.get('block_number')
        return self


class ExecCouponTimeoutRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        collection_id: str = None,
        coupon_id: str = None,
        out_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 批次ID
        self.collection_id = collection_id
        # 电子券ID
        self.coupon_id = coupon_id
        # 交易幂等ID
        self.out_tx_id = out_tx_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.collection_id, 'collection_id')
        self.validate_required(self.coupon_id, 'coupon_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.collection_id is not None:
            result['collection_id'] = self.collection_id
        if self.coupon_id is not None:
            result['coupon_id'] = self.coupon_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('collection_id') is not None:
            self.collection_id = m.get('collection_id')
        if m.get('coupon_id') is not None:
            self.coupon_id = m.get('coupon_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        return self


class ExecCouponTimeoutResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        block_number: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 交易区块高度
        self.block_number = block_number

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.block_number is not None:
            result['block_number'] = self.block_number
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('block_number') is not None:
            self.block_number = m.get('block_number')
        return self


class ExecCouponActivateRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        collection_id: str = None,
        coupon_code: str = None,
        coupon_ext_code: str = None,
        coupon_id: str = None,
        out_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 电子券批次ID
        self.collection_id = collection_id
        # 电子券激活码
        self.coupon_code = coupon_code
        # 激活码附加信息
        self.coupon_ext_code = coupon_ext_code
        # 电子券ID
        self.coupon_id = coupon_id
        # 交易幂等ID
        self.out_tx_id = out_tx_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.collection_id, 'collection_id')
        self.validate_required(self.coupon_code, 'coupon_code')
        self.validate_required(self.coupon_id, 'coupon_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.collection_id is not None:
            result['collection_id'] = self.collection_id
        if self.coupon_code is not None:
            result['coupon_code'] = self.coupon_code
        if self.coupon_ext_code is not None:
            result['coupon_ext_code'] = self.coupon_ext_code
        if self.coupon_id is not None:
            result['coupon_id'] = self.coupon_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('collection_id') is not None:
            self.collection_id = m.get('collection_id')
        if m.get('coupon_code') is not None:
            self.coupon_code = m.get('coupon_code')
        if m.get('coupon_ext_code') is not None:
            self.coupon_ext_code = m.get('coupon_ext_code')
        if m.get('coupon_id') is not None:
            self.coupon_id = m.get('coupon_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        return self


class ExecCouponActivateResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        block_number: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 交易区块高度
        self.block_number = block_number

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.block_number is not None:
            result['block_number'] = self.block_number
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('block_number') is not None:
            self.block_number = m.get('block_number')
        return self


class ExecCouponTransferRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        collection_id: str = None,
        coupon_id: str = None,
        origin_uid_public_key_sign: str = None,
        out_tx_id: str = None,
        transfer_desensitized_uid: str = None,
        transfer_uid_public_key: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 电子券批次ID
        self.collection_id = collection_id
        # 电子券ID
        self.coupon_id = coupon_id
        # 原始持有用户公钥对应的私钥，对outBizId的签名
        self.origin_uid_public_key_sign = origin_uid_public_key_sign
        # 交易幂等ID
        self.out_tx_id = out_tx_id
        # 要转让的目标用户脱敏ID
        self.transfer_desensitized_uid = transfer_desensitized_uid
        # 要转让的目标用户公钥
        self.transfer_uid_public_key = transfer_uid_public_key

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.collection_id, 'collection_id')
        self.validate_required(self.coupon_id, 'coupon_id')
        self.validate_required(self.origin_uid_public_key_sign, 'origin_uid_public_key_sign')
        self.validate_required(self.out_tx_id, 'out_tx_id')
        self.validate_required(self.transfer_desensitized_uid, 'transfer_desensitized_uid')
        self.validate_required(self.transfer_uid_public_key, 'transfer_uid_public_key')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.collection_id is not None:
            result['collection_id'] = self.collection_id
        if self.coupon_id is not None:
            result['coupon_id'] = self.coupon_id
        if self.origin_uid_public_key_sign is not None:
            result['origin_uid_public_key_sign'] = self.origin_uid_public_key_sign
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        if self.transfer_desensitized_uid is not None:
            result['transfer_desensitized_uid'] = self.transfer_desensitized_uid
        if self.transfer_uid_public_key is not None:
            result['transfer_uid_public_key'] = self.transfer_uid_public_key
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('collection_id') is not None:
            self.collection_id = m.get('collection_id')
        if m.get('coupon_id') is not None:
            self.coupon_id = m.get('coupon_id')
        if m.get('origin_uid_public_key_sign') is not None:
            self.origin_uid_public_key_sign = m.get('origin_uid_public_key_sign')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        if m.get('transfer_desensitized_uid') is not None:
            self.transfer_desensitized_uid = m.get('transfer_desensitized_uid')
        if m.get('transfer_uid_public_key') is not None:
            self.transfer_uid_public_key = m.get('transfer_uid_public_key')
        return self


class ExecCouponTransferResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        block_number: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 交易区块高度
        self.block_number = block_number

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.block_number is not None:
            result['block_number'] = self.block_number
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('block_number') is not None:
            self.block_number = m.get('block_number')
        return self


class ExecCouponSignRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        collection_id: str = None,
        coupon_id: str = None,
        desensitized_uid: str = None,
        out_tx_id: str = None,
        uid_public_key: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 电子券批次ID
        self.collection_id = collection_id
        # 电子券ID
        self.coupon_id = coupon_id
        # 脱敏用户ID
        self.desensitized_uid = desensitized_uid
        # 交易幂等ID
        self.out_tx_id = out_tx_id
        # 用户公钥
        self.uid_public_key = uid_public_key

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.collection_id, 'collection_id')
        self.validate_required(self.coupon_id, 'coupon_id')
        self.validate_required(self.desensitized_uid, 'desensitized_uid')
        self.validate_required(self.out_tx_id, 'out_tx_id')
        self.validate_required(self.uid_public_key, 'uid_public_key')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.collection_id is not None:
            result['collection_id'] = self.collection_id
        if self.coupon_id is not None:
            result['coupon_id'] = self.coupon_id
        if self.desensitized_uid is not None:
            result['desensitized_uid'] = self.desensitized_uid
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        if self.uid_public_key is not None:
            result['uid_public_key'] = self.uid_public_key
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('collection_id') is not None:
            self.collection_id = m.get('collection_id')
        if m.get('coupon_id') is not None:
            self.coupon_id = m.get('coupon_id')
        if m.get('desensitized_uid') is not None:
            self.desensitized_uid = m.get('desensitized_uid')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        if m.get('uid_public_key') is not None:
            self.uid_public_key = m.get('uid_public_key')
        return self


class ExecCouponSignResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        block_number: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 交易区块高度
        self.block_number = block_number

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.block_number is not None:
            result['block_number'] = self.block_number
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('block_number') is not None:
            self.block_number = m.get('block_number')
        return self


class ExecCouponBindRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        collection_id: str = None,
        coupon_id: str = None,
        desensitized_uid: str = None,
        holder_user_account: str = None,
        out_tx_id: str = None,
        public_key_sign: str = None,
        uid_public_key_sign: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 电子券批次ID
        self.collection_id = collection_id
        # 电子券ID
        self.coupon_id = coupon_id
        # 用户脱敏ID
        self.desensitized_uid = desensitized_uid
        # 绑定的持有者信息
        self.holder_user_account = holder_user_account
        # 交易幂等ID
        self.out_tx_id = out_tx_id
        # 电子券公钥对应的私钥，对 couponId||outTxId 的签名
        self.public_key_sign = public_key_sign
        # 用户公钥对应的私钥，对 outTxId 的签名
        self.uid_public_key_sign = uid_public_key_sign

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.collection_id, 'collection_id')
        self.validate_required(self.coupon_id, 'coupon_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')
        self.validate_required(self.public_key_sign, 'public_key_sign')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.collection_id is not None:
            result['collection_id'] = self.collection_id
        if self.coupon_id is not None:
            result['coupon_id'] = self.coupon_id
        if self.desensitized_uid is not None:
            result['desensitized_uid'] = self.desensitized_uid
        if self.holder_user_account is not None:
            result['holder_user_account'] = self.holder_user_account
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        if self.public_key_sign is not None:
            result['public_key_sign'] = self.public_key_sign
        if self.uid_public_key_sign is not None:
            result['uid_public_key_sign'] = self.uid_public_key_sign
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('collection_id') is not None:
            self.collection_id = m.get('collection_id')
        if m.get('coupon_id') is not None:
            self.coupon_id = m.get('coupon_id')
        if m.get('desensitized_uid') is not None:
            self.desensitized_uid = m.get('desensitized_uid')
        if m.get('holder_user_account') is not None:
            self.holder_user_account = m.get('holder_user_account')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        if m.get('public_key_sign') is not None:
            self.public_key_sign = m.get('public_key_sign')
        if m.get('uid_public_key_sign') is not None:
            self.uid_public_key_sign = m.get('uid_public_key_sign')
        return self


class ExecCouponBindResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        block_number: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 交易区块高度
        self.block_number = block_number

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.block_number is not None:
            result['block_number'] = self.block_number
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('block_number') is not None:
            self.block_number = m.get('block_number')
        return self


class BatchcreateCouponRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        coupon_info: CouponCreate = None,
        create_number: int = None,
        out_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 电子券创建参数
        self.coupon_info = coupon_info
        # 一次性创建数量。最大每次创建100张
        self.create_number = create_number
        # 交易幂等ID
        self.out_tx_id = out_tx_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.coupon_info, 'coupon_info')
        if self.coupon_info:
            self.coupon_info.validate()
        self.validate_required(self.create_number, 'create_number')
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.coupon_info is not None:
            result['coupon_info'] = self.coupon_info.to_map()
        if self.create_number is not None:
            result['create_number'] = self.create_number
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('coupon_info') is not None:
            temp_model = CouponCreate()
            self.coupon_info = temp_model.from_map(m['coupon_info'])
        if m.get('create_number') is not None:
            self.create_number = m.get('create_number')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        return self


class BatchcreateCouponResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        block_number: int = None,
        coupon_id_list: List[str] = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 交易块高
        self.block_number = block_number
        # 电子券创建结果：电子券ID列表
        self.coupon_id_list = coupon_id_list

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.block_number is not None:
            result['block_number'] = self.block_number
        if self.coupon_id_list is not None:
            result['coupon_id_list'] = self.coupon_id_list
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('block_number') is not None:
            self.block_number = m.get('block_number')
        if m.get('coupon_id_list') is not None:
            self.coupon_id_list = m.get('coupon_id_list')
        return self


class CreateCouponListRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        coupons: List[CouponCreate] = None,
        out_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 电子券创建参数列表
        self.coupons = coupons
        # 交易幂等ID
        self.out_tx_id = out_tx_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.coupons, 'coupons')
        if self.coupons:
            for k in self.coupons:
                if k:
                    k.validate()
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        result['coupons'] = []
        if self.coupons is not None:
            for k in self.coupons:
                result['coupons'].append(k.to_map() if k else None)
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        self.coupons = []
        if m.get('coupons') is not None:
            for k in m.get('coupons'):
                temp_model = CouponCreate()
                self.coupons.append(temp_model.from_map(k))
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        return self


class CreateCouponListResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        coupon_id_list: List[str] = None,
        block_number: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 电子券创建结果：电子券ID列表
        self.coupon_id_list = coupon_id_list
        # 交易区块高度
        self.block_number = block_number

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.coupon_id_list is not None:
            result['coupon_id_list'] = self.coupon_id_list
        if self.block_number is not None:
            result['block_number'] = self.block_number
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('coupon_id_list') is not None:
            self.coupon_id_list = m.get('coupon_id_list')
        if m.get('block_number') is not None:
            self.block_number = m.get('block_number')
        return self


class CreateCouponCollectionRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        collection_id: str = None,
        coupon_number_prefix: str = None,
        issuer: str = None,
        name: str = None,
        need_pre_registered: bool = None,
        need_registered: bool = None,
        out_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 批次ID
        self.collection_id = collection_id
        # 电子券前缀
        self.coupon_number_prefix = coupon_number_prefix
        # 批次创建者
        self.issuer = issuer
        # 批次名称
        self.name = name
        # 是否创建时就记名
        self.need_pre_registered = need_pre_registered
        # 是否记名电子券
        self.need_registered = need_registered
        # 交易幂等ID
        self.out_tx_id = out_tx_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.collection_id, 'collection_id')
        self.validate_required(self.coupon_number_prefix, 'coupon_number_prefix')
        self.validate_required(self.issuer, 'issuer')
        self.validate_required(self.name, 'name')
        self.validate_required(self.need_pre_registered, 'need_pre_registered')
        self.validate_required(self.need_registered, 'need_registered')
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.collection_id is not None:
            result['collection_id'] = self.collection_id
        if self.coupon_number_prefix is not None:
            result['coupon_number_prefix'] = self.coupon_number_prefix
        if self.issuer is not None:
            result['issuer'] = self.issuer
        if self.name is not None:
            result['name'] = self.name
        if self.need_pre_registered is not None:
            result['need_pre_registered'] = self.need_pre_registered
        if self.need_registered is not None:
            result['need_registered'] = self.need_registered
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('collection_id') is not None:
            self.collection_id = m.get('collection_id')
        if m.get('coupon_number_prefix') is not None:
            self.coupon_number_prefix = m.get('coupon_number_prefix')
        if m.get('issuer') is not None:
            self.issuer = m.get('issuer')
        if m.get('name') is not None:
            self.name = m.get('name')
        if m.get('need_pre_registered') is not None:
            self.need_pre_registered = m.get('need_pre_registered')
        if m.get('need_registered') is not None:
            self.need_registered = m.get('need_registered')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        return self


class CreateCouponCollectionResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        block_number: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 交易区块高度
        self.block_number = block_number

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.block_number is not None:
            result['block_number'] = self.block_number
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('block_number') is not None:
            self.block_number = m.get('block_number')
        return self


class QueryCouponCollectionRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        collection_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 批次ID
        self.collection_id = collection_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.collection_id, 'collection_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.collection_id is not None:
            result['collection_id'] = self.collection_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('collection_id') is not None:
            self.collection_id = m.get('collection_id')
        return self


class QueryCouponCollectionResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        coupon_collection: CouponCollection = None,
        block_number: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 批次详情
        self.coupon_collection = coupon_collection
        # 交易区块高度
        self.block_number = block_number

    def validate(self):
        if self.coupon_collection:
            self.coupon_collection.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.coupon_collection is not None:
            result['coupon_collection'] = self.coupon_collection.to_map()
        if self.block_number is not None:
            result['block_number'] = self.block_number
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('coupon_collection') is not None:
            temp_model = CouponCollection()
            self.coupon_collection = temp_model.from_map(m['coupon_collection'])
        if m.get('block_number') is not None:
            self.block_number = m.get('block_number')
        return self


class QueryMerchantUserRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        local_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 商户管理下的用户ID
        self.local_id = local_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.local_id, 'local_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.local_id is not None:
            result['local_id'] = self.local_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('local_id') is not None:
            self.local_id = m.get('local_id')
        return self


class QueryMerchantUserResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        user: User = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 用户完整信息
        # {
        # "tenant_id": "ZKUA",
        # "user_id": "331f9b0922f940f464d4b94b5628180408ac305b7fc72d3e40f5b7727d0702fb",
        # "local_id": "user01",
        # "did": "",
        # "vc": "",
        # "pk": "3280b948a7fa8525c0fbfd47d1df75d7a7ee9f3baedd6964565b42f461dd86732717c4bc4c8203ea2b9b1aeef7b148644babba3c0cd6927c4c0964919f590c6c"
        # }
        # 
        self.user = user

    def validate(self):
        if self.user:
            self.user.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.user is not None:
            result['user'] = self.user.to_map()
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('user') is not None:
            temp_model = User()
            self.user = temp_model.from_map(m['user'])
        return self


class CreateMerchantUserRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        did: str = None,
        local_id: str = None,
        out_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 用户的did信息
        self.did = did
        # 用户名
        self.local_id = local_id
        # 外部交易ID
        self.out_tx_id = out_tx_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.local_id, 'local_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.did is not None:
            result['did'] = self.did
        if self.local_id is not None:
            result['local_id'] = self.local_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('did') is not None:
            self.did = m.get('did')
        if m.get('local_id') is not None:
            self.local_id = m.get('local_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        return self


class CreateMerchantUserResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class QueryMerchantRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        currency: str = None,
        delegated_tenant_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 币种
        self.currency = currency
        # 要代理操作的租户ID
        self.delegated_tenant_id = delegated_tenant_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.currency is not None:
            result['currency'] = self.currency
        if self.delegated_tenant_id is not None:
            result['delegated_tenant_id'] = self.delegated_tenant_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('currency') is not None:
            self.currency = m.get('currency')
        if m.get('delegated_tenant_id') is not None:
            self.delegated_tenant_id = m.get('delegated_tenant_id')
        return self


class QueryMerchantResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        merchant: Merchant = None,
        block_number: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 商户完整信息
        # {
        # "tenant_id": "Z",
        # "did": "did:mychain:ct",
        # "admin_id": "ed7b3acb718e2f91bc8fab6a5e7cc3c061",
        # "fund_manager_id": "b7ecd55bde04827b3e611a741d",
        # "description": "SK",
        # "is_equity_provider": true,
        # "is_equity_consumer": true,
        # "is_asset_issuer": true,
        # "status": 0,
        # "provision": {
        # "currency": "CNY",
        # "debit": "99999999.0000",
        # "credit_max": "99999999.0000",
        # "credit_used": "0.0000"
        # }
        # }
        self.merchant = merchant
        # 查询商户信息时的区块高度
        self.block_number = block_number

    def validate(self):
        if self.merchant:
            self.merchant.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.merchant is not None:
            result['merchant'] = self.merchant.to_map()
        if self.block_number is not None:
            result['block_number'] = self.block_number
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('merchant') is not None:
            temp_model = Merchant()
            self.merchant = temp_model.from_map(m['merchant'])
        if m.get('block_number') is not None:
            self.block_number = m.get('block_number')
        return self


class UploadImageRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        content_type: str = None,
        delegated_tenant_id: str = None,
        image: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 图片MIME类型，目前仅支持 image/jpeg
        self.content_type = content_type
        # 要代理操作的租户ID
        self.delegated_tenant_id = delegated_tenant_id
        # 图片信息（base64编码）
        self.image = image

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.content_type, 'content_type')
        self.validate_required(self.image, 'image')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.content_type is not None:
            result['content_type'] = self.content_type
        if self.delegated_tenant_id is not None:
            result['delegated_tenant_id'] = self.delegated_tenant_id
        if self.image is not None:
            result['image'] = self.image
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('content_type') is not None:
            self.content_type = m.get('content_type')
        if m.get('delegated_tenant_id') is not None:
            self.delegated_tenant_id = m.get('delegated_tenant_id')
        if m.get('image') is not None:
            self.image = m.get('image')
        return self


class UploadImageResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        temporary_url: str = None,
        url: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 临时可访问的url，过期时间2小时
        self.temporary_url = temporary_url
        # 图片的不可访问url，发布权益时使用
        self.url = url

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.temporary_url is not None:
            result['temporary_url'] = self.temporary_url
        if self.url is not None:
            result['url'] = self.url
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('temporary_url') is not None:
            self.temporary_url = m.get('temporary_url')
        if m.get('url') is not None:
            self.url = m.get('url')
        return self


class GetPkiPublickeyRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        account_id: str = None,
        opt_tenant_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 商户管理员/其用户的链上账户ID
        self.account_id = account_id
        # 商户管理员/其用户归属的租户ID
        self.opt_tenant_id = opt_tenant_id

    def validate(self):
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.opt_tenant_id, 'opt_tenant_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.opt_tenant_id is not None:
            result['opt_tenant_id'] = self.opt_tenant_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('opt_tenant_id') is not None:
            self.opt_tenant_id = m.get('opt_tenant_id')
        return self


class GetPkiPublickeyResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        public_key: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 公钥字符串（base64）
        self.public_key = public_key

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.public_key is not None:
            result['public_key'] = self.public_key
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('public_key') is not None:
            self.public_key = m.get('public_key')
        return self


class ExecPkiEncryptRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        account_id: str = None,
        content: str = None,
        opt_tenant_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 商户管理员/其用户的链上账户ID
        self.account_id = account_id
        # 明文（base64编码）
        self.content = content
        # 商户管理员/其用户归属的租户ID
        self.opt_tenant_id = opt_tenant_id

    def validate(self):
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.content, 'content')
        self.validate_required(self.opt_tenant_id, 'opt_tenant_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.content is not None:
            result['content'] = self.content
        if self.opt_tenant_id is not None:
            result['opt_tenant_id'] = self.opt_tenant_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('content') is not None:
            self.content = m.get('content')
        if m.get('opt_tenant_id') is not None:
            self.opt_tenant_id = m.get('opt_tenant_id')
        return self


class ExecPkiEncryptResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        encrypted_content: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 密文 base64编码
        self.encrypted_content = encrypted_content

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.encrypted_content is not None:
            result['encrypted_content'] = self.encrypted_content
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('encrypted_content') is not None:
            self.encrypted_content = m.get('encrypted_content')
        return self


class ExecPkiDecryptRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        account_id: str = None,
        delegated_tenant_id: str = None,
        encrypted_content: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 商户管理员/其用户的链上账户ID
        self.account_id = account_id
        # 要代理操作的租户ID
        self.delegated_tenant_id = delegated_tenant_id
        # 密文（base64）
        self.encrypted_content = encrypted_content

    def validate(self):
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.encrypted_content, 'encrypted_content')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.delegated_tenant_id is not None:
            result['delegated_tenant_id'] = self.delegated_tenant_id
        if self.encrypted_content is not None:
            result['encrypted_content'] = self.encrypted_content
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('delegated_tenant_id') is not None:
            self.delegated_tenant_id = m.get('delegated_tenant_id')
        if m.get('encrypted_content') is not None:
            self.encrypted_content = m.get('encrypted_content')
        return self


class ExecPkiDecryptResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        content: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 明文
        self.content = content

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.content is not None:
            result['content'] = self.content
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('content') is not None:
            self.content = m.get('content')
        return self


class UpdateMerchantFriendRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        friend_tenant_id: str = None,
        out_tx_id: str = None,
        type: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 友好商户租户ID
        self.friend_tenant_id = friend_tenant_id
        # 外部交易ID
        self.out_tx_id = out_tx_id
        # 更新类型
        self.type = type

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.friend_tenant_id, 'friend_tenant_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')
        self.validate_required(self.type, 'type')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.friend_tenant_id is not None:
            result['friend_tenant_id'] = self.friend_tenant_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        if self.type is not None:
            result['type'] = self.type
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('friend_tenant_id') is not None:
            self.friend_tenant_id = m.get('friend_tenant_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        if m.get('type') is not None:
            self.type = m.get('type')
        return self


class UpdateMerchantFriendResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class CreateEquityRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        auth_type: int = None,
        chain_id: str = None,
        currency: str = None,
        default_price: str = None,
        delegated_tenant_id: str = None,
        description: str = None,
        desc_images: str = None,
        equity_name: str = None,
        equity_type: int = None,
        if_public: bool = None,
        images: str = None,
        limit_per_merchant_and_day: int = None,
        limit_per_merchant_and_month: int = None,
        limit_per_user_and_day: int = None,
        limit_per_user_and_month: int = None,
        memo: str = None,
        out_tx_id: str = None,
        total_count: str = None,
        use_valid_not_after: int = None,
        use_valid_not_before: int = None,
        valid_not_after: int = None,
        valid_not_before: int = None,
        value: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 授权类型 0 Auto，1Contract
        self.auth_type = auth_type
        # 链ID
        self.chain_id = chain_id
        # 结算币种
        self.currency = currency
        # 权益价格（单位：元）
        self.default_price = default_price
        # 代理操作专用，要代理操作的租户ID
        self.delegated_tenant_id = delegated_tenant_id
        # 权益商品详情信息
        self.description = description
        # 权益商品详情图。上传仅接受链接，请使用OSS存储服务上传图片(;分隔)
        self.desc_images = desc_images
        # 权益商品名称
        self.equity_name = equity_name
        # 权益商品类型：类型为整型（不大于：2147483647），需要进行细分，类型由三部分组成；aabbbbcccc。aa 为大类分类，bbbb 为细项分类（无细项分类时为0000），cccc 为数据格式分类（其中0000表示无格式要求）。请根据实际商品类型填写，具体类型和兑换时数据结构查看文档【https://tech.antfin.com/docs/2/163896】 。不可修改，如需修改需重新发布商品
        self.equity_type = equity_type
        # 字段决定权益商品是否全量链上客户可见，当选择权益为false时，需要使用baas.antdao.equity.merchant.open接口增加权益商品可见客户
        self.if_public = if_public
        # 权益商品主图。上传仅接受链接，请使用OSS存储服务上传图片(;分隔)
        self.images = images
        # 商户每日兑换上限
        self.limit_per_merchant_and_day = limit_per_merchant_and_day
        # 商户每月兑换上限
        self.limit_per_merchant_and_month = limit_per_merchant_and_month
        # 用户每日兑换上限
        self.limit_per_user_and_day = limit_per_user_and_day
        # 用户每月兑换上限
        self.limit_per_user_and_month = limit_per_user_and_month
        # 若需要兑换方提供的特殊信息，可增加在备注字段，并要求兑换方是否传入（按照需求方自定义内容信息）
        # - 如必须传入证件号，手机号信息，则权益需要通过运营平台审核，非必须采集信息将拒绝上架
        self.memo = memo
        # 外部交易ID
        self.out_tx_id = out_tx_id
        # 权益商品库存数量
        self.total_count = total_count
        # 权益商品使用有效期结束时间（毫秒）
        self.use_valid_not_after = use_valid_not_after
        # 权益商品使用有效期开始时间（毫秒）
        self.use_valid_not_before = use_valid_not_before
        # 权益商品兑换有效期结束时间（毫秒）
        self.valid_not_after = valid_not_after
        # 权益商品兑换有效期开始时间（毫秒）
        self.valid_not_before = valid_not_before
        # 权益商品面值（单位：元）
        self.value = value

    def validate(self):
        self.validate_required(self.auth_type, 'auth_type')
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.currency, 'currency')
        self.validate_required(self.default_price, 'default_price')
        self.validate_required(self.description, 'description')
        self.validate_required(self.desc_images, 'desc_images')
        self.validate_required(self.equity_name, 'equity_name')
        self.validate_required(self.equity_type, 'equity_type')
        self.validate_required(self.if_public, 'if_public')
        self.validate_required(self.images, 'images')
        self.validate_required(self.limit_per_merchant_and_day, 'limit_per_merchant_and_day')
        self.validate_required(self.limit_per_merchant_and_month, 'limit_per_merchant_and_month')
        self.validate_required(self.limit_per_user_and_day, 'limit_per_user_and_day')
        self.validate_required(self.limit_per_user_and_month, 'limit_per_user_and_month')
        self.validate_required(self.out_tx_id, 'out_tx_id')
        self.validate_required(self.total_count, 'total_count')
        self.validate_required(self.use_valid_not_after, 'use_valid_not_after')
        self.validate_required(self.use_valid_not_before, 'use_valid_not_before')
        self.validate_required(self.valid_not_after, 'valid_not_after')
        self.validate_required(self.valid_not_before, 'valid_not_before')
        self.validate_required(self.value, 'value')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.auth_type is not None:
            result['auth_type'] = self.auth_type
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.currency is not None:
            result['currency'] = self.currency
        if self.default_price is not None:
            result['default_price'] = self.default_price
        if self.delegated_tenant_id is not None:
            result['delegated_tenant_id'] = self.delegated_tenant_id
        if self.description is not None:
            result['description'] = self.description
        if self.desc_images is not None:
            result['desc_images'] = self.desc_images
        if self.equity_name is not None:
            result['equity_name'] = self.equity_name
        if self.equity_type is not None:
            result['equity_type'] = self.equity_type
        if self.if_public is not None:
            result['if_public'] = self.if_public
        if self.images is not None:
            result['images'] = self.images
        if self.limit_per_merchant_and_day is not None:
            result['limit_per_merchant_and_day'] = self.limit_per_merchant_and_day
        if self.limit_per_merchant_and_month is not None:
            result['limit_per_merchant_and_month'] = self.limit_per_merchant_and_month
        if self.limit_per_user_and_day is not None:
            result['limit_per_user_and_day'] = self.limit_per_user_and_day
        if self.limit_per_user_and_month is not None:
            result['limit_per_user_and_month'] = self.limit_per_user_and_month
        if self.memo is not None:
            result['memo'] = self.memo
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        if self.total_count is not None:
            result['total_count'] = self.total_count
        if self.use_valid_not_after is not None:
            result['use_valid_not_after'] = self.use_valid_not_after
        if self.use_valid_not_before is not None:
            result['use_valid_not_before'] = self.use_valid_not_before
        if self.valid_not_after is not None:
            result['valid_not_after'] = self.valid_not_after
        if self.valid_not_before is not None:
            result['valid_not_before'] = self.valid_not_before
        if self.value is not None:
            result['value'] = self.value
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('auth_type') is not None:
            self.auth_type = m.get('auth_type')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('currency') is not None:
            self.currency = m.get('currency')
        if m.get('default_price') is not None:
            self.default_price = m.get('default_price')
        if m.get('delegated_tenant_id') is not None:
            self.delegated_tenant_id = m.get('delegated_tenant_id')
        if m.get('description') is not None:
            self.description = m.get('description')
        if m.get('desc_images') is not None:
            self.desc_images = m.get('desc_images')
        if m.get('equity_name') is not None:
            self.equity_name = m.get('equity_name')
        if m.get('equity_type') is not None:
            self.equity_type = m.get('equity_type')
        if m.get('if_public') is not None:
            self.if_public = m.get('if_public')
        if m.get('images') is not None:
            self.images = m.get('images')
        if m.get('limit_per_merchant_and_day') is not None:
            self.limit_per_merchant_and_day = m.get('limit_per_merchant_and_day')
        if m.get('limit_per_merchant_and_month') is not None:
            self.limit_per_merchant_and_month = m.get('limit_per_merchant_and_month')
        if m.get('limit_per_user_and_day') is not None:
            self.limit_per_user_and_day = m.get('limit_per_user_and_day')
        if m.get('limit_per_user_and_month') is not None:
            self.limit_per_user_and_month = m.get('limit_per_user_and_month')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        if m.get('total_count') is not None:
            self.total_count = m.get('total_count')
        if m.get('use_valid_not_after') is not None:
            self.use_valid_not_after = m.get('use_valid_not_after')
        if m.get('use_valid_not_before') is not None:
            self.use_valid_not_before = m.get('use_valid_not_before')
        if m.get('valid_not_after') is not None:
            self.valid_not_after = m.get('valid_not_after')
        if m.get('valid_not_before') is not None:
            self.valid_not_before = m.get('valid_not_before')
        if m.get('value') is not None:
            self.value = m.get('value')
        return self


class CreateEquityResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        create_equity_request_id: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 请求ID，用于查询异步发布权益结果
        self.create_equity_request_id = create_equity_request_id

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.create_equity_request_id is not None:
            result['create_equity_request_id'] = self.create_equity_request_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('create_equity_request_id') is not None:
            self.create_equity_request_id = m.get('create_equity_request_id')
        return self


class OfflineEquityRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        equity_id: str = None,
        out_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 权益商品ID
        self.equity_id = equity_id
        # 外部交易ID
        self.out_tx_id = out_tx_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.equity_id, 'equity_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.equity_id is not None:
            result['equity_id'] = self.equity_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('equity_id') is not None:
            self.equity_id = m.get('equity_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        return self


class OfflineEquityResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class FreezeEquityRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        equity_id: str = None,
        out_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 权益商品ID
        self.equity_id = equity_id
        # 外部交易ID
        self.out_tx_id = out_tx_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.equity_id, 'equity_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.equity_id is not None:
            result['equity_id'] = self.equity_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('equity_id') is not None:
            self.equity_id = m.get('equity_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        return self


class FreezeEquityResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class OpenEquityMerchantRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        delegated_tenant_id: str = None,
        equity_id: str = None,
        opt_tenant_id: str = None,
        opt_type: str = None,
        out_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 代理操作专用，要代理操作的租户ID
        self.delegated_tenant_id = delegated_tenant_id
        # 权益商品ID
        self.equity_id = equity_id
        # 被授权的租户ID
        self.opt_tenant_id = opt_tenant_id
        # 更新操作，添加或者删除
        self.opt_type = opt_type
        # 外部交易ID
        self.out_tx_id = out_tx_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.equity_id, 'equity_id')
        self.validate_required(self.opt_tenant_id, 'opt_tenant_id')
        self.validate_required(self.opt_type, 'opt_type')
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.delegated_tenant_id is not None:
            result['delegated_tenant_id'] = self.delegated_tenant_id
        if self.equity_id is not None:
            result['equity_id'] = self.equity_id
        if self.opt_tenant_id is not None:
            result['opt_tenant_id'] = self.opt_tenant_id
        if self.opt_type is not None:
            result['opt_type'] = self.opt_type
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('delegated_tenant_id') is not None:
            self.delegated_tenant_id = m.get('delegated_tenant_id')
        if m.get('equity_id') is not None:
            self.equity_id = m.get('equity_id')
        if m.get('opt_tenant_id') is not None:
            self.opt_tenant_id = m.get('opt_tenant_id')
        if m.get('opt_type') is not None:
            self.opt_type = m.get('opt_type')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        return self


class OpenEquityMerchantResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class AuthEquityMerchantuserpriceRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        amount: str = None,
        chain_id: str = None,
        delegated_tenant_id: str = None,
        equity_id: str = None,
        opt_tenant_id: str = None,
        out_tx_id: str = None,
        ratio: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 用户兑换价格（单位：元）。价格和比例二选一，且只能填写一个。
        self.amount = amount
        # 链ID
        self.chain_id = chain_id
        # 代理操作专用，要代理操作的租户ID
        self.delegated_tenant_id = delegated_tenant_id
        # 权益商品ID
        self.equity_id = equity_id
        # 操作用户
        self.opt_tenant_id = opt_tenant_id
        # 外部交易ID
        self.out_tx_id = out_tx_id
        # 比例。价格和比例二选一，且只能填写一个。
        self.ratio = ratio

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.equity_id, 'equity_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.amount is not None:
            result['amount'] = self.amount
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.delegated_tenant_id is not None:
            result['delegated_tenant_id'] = self.delegated_tenant_id
        if self.equity_id is not None:
            result['equity_id'] = self.equity_id
        if self.opt_tenant_id is not None:
            result['opt_tenant_id'] = self.opt_tenant_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        if self.ratio is not None:
            result['ratio'] = self.ratio
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('amount') is not None:
            self.amount = m.get('amount')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('delegated_tenant_id') is not None:
            self.delegated_tenant_id = m.get('delegated_tenant_id')
        if m.get('equity_id') is not None:
            self.equity_id = m.get('equity_id')
        if m.get('opt_tenant_id') is not None:
            self.opt_tenant_id = m.get('opt_tenant_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        if m.get('ratio') is not None:
            self.ratio = m.get('ratio')
        return self


class AuthEquityMerchantuserpriceResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class UpdateEquityDefaultpriceRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        amount: str = None,
        chain_id: str = None,
        delegated_tenant_id: str = None,
        equity_id: str = None,
        out_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 价格
        self.amount = amount
        # 链ID
        self.chain_id = chain_id
        # 代理操作专用，要代理操作的租户ID
        self.delegated_tenant_id = delegated_tenant_id
        # 权益商品ID
        self.equity_id = equity_id
        # 外部交易ID
        self.out_tx_id = out_tx_id

    def validate(self):
        self.validate_required(self.amount, 'amount')
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.equity_id, 'equity_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.amount is not None:
            result['amount'] = self.amount
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.delegated_tenant_id is not None:
            result['delegated_tenant_id'] = self.delegated_tenant_id
        if self.equity_id is not None:
            result['equity_id'] = self.equity_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('amount') is not None:
            self.amount = m.get('amount')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('delegated_tenant_id') is not None:
            self.delegated_tenant_id = m.get('delegated_tenant_id')
        if m.get('equity_id') is not None:
            self.equity_id = m.get('equity_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        return self


class UpdateEquityDefaultpriceResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class UpdateEquityTenantpriceRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        amount: str = None,
        chain_id: str = None,
        delegated_tenant_id: str = None,
        equity_id: str = None,
        opt_tenant_id: str = None,
        out_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 价格（单位：元）
        self.amount = amount
        # 链ID
        self.chain_id = chain_id
        # 要代理操作的租户ID
        self.delegated_tenant_id = delegated_tenant_id
        # 权益商品ID
        self.equity_id = equity_id
        # 定向价格租户ID
        self.opt_tenant_id = opt_tenant_id
        # 外部交易ID
        self.out_tx_id = out_tx_id

    def validate(self):
        self.validate_required(self.amount, 'amount')
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.equity_id, 'equity_id')
        self.validate_required(self.opt_tenant_id, 'opt_tenant_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.amount is not None:
            result['amount'] = self.amount
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.delegated_tenant_id is not None:
            result['delegated_tenant_id'] = self.delegated_tenant_id
        if self.equity_id is not None:
            result['equity_id'] = self.equity_id
        if self.opt_tenant_id is not None:
            result['opt_tenant_id'] = self.opt_tenant_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('amount') is not None:
            self.amount = m.get('amount')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('delegated_tenant_id') is not None:
            self.delegated_tenant_id = m.get('delegated_tenant_id')
        if m.get('equity_id') is not None:
            self.equity_id = m.get('equity_id')
        if m.get('opt_tenant_id') is not None:
            self.opt_tenant_id = m.get('opt_tenant_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        return self


class UpdateEquityTenantpriceResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class AddEquityCountRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        amount: int = None,
        chain_id: str = None,
        delegated_tenant_id: str = None,
        equity_id: str = None,
        out_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 权益库存数量
        self.amount = amount
        # 链ID
        self.chain_id = chain_id
        # 代理操作专用，要代理操作的租户ID
        self.delegated_tenant_id = delegated_tenant_id
        # 权益商品ID
        self.equity_id = equity_id
        # 外部交易ID
        self.out_tx_id = out_tx_id

    def validate(self):
        self.validate_required(self.amount, 'amount')
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.equity_id, 'equity_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.amount is not None:
            result['amount'] = self.amount
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.delegated_tenant_id is not None:
            result['delegated_tenant_id'] = self.delegated_tenant_id
        if self.equity_id is not None:
            result['equity_id'] = self.equity_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('amount') is not None:
            self.amount = m.get('amount')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('delegated_tenant_id') is not None:
            self.delegated_tenant_id = m.get('delegated_tenant_id')
        if m.get('equity_id') is not None:
            self.equity_id = m.get('equity_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        return self


class AddEquityCountResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class UpdateEquityExchangelimitRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        delegated_tenant_id: str = None,
        equity_id: str = None,
        limit_per_merchant_and_day: int = None,
        limit_per_merchant_and_montn: int = None,
        limit_per_user_and_day: int = None,
        limit_per_user_and_month: int = None,
        out_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 代理操作专用，要代理操作的租户ID
        self.delegated_tenant_id = delegated_tenant_id
        # 权益商品ID
        self.equity_id = equity_id
        # 商户每日兑换上限
        self.limit_per_merchant_and_day = limit_per_merchant_and_day
        # 商户每月兑换上限
        self.limit_per_merchant_and_montn = limit_per_merchant_and_montn
        # 用户每日兑换上限
        self.limit_per_user_and_day = limit_per_user_and_day
        # 用户每月兑换上限
        self.limit_per_user_and_month = limit_per_user_and_month
        # 外部交易ID
        self.out_tx_id = out_tx_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.equity_id, 'equity_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.delegated_tenant_id is not None:
            result['delegated_tenant_id'] = self.delegated_tenant_id
        if self.equity_id is not None:
            result['equity_id'] = self.equity_id
        if self.limit_per_merchant_and_day is not None:
            result['limit_per_merchant_and_day'] = self.limit_per_merchant_and_day
        if self.limit_per_merchant_and_montn is not None:
            result['limit_per_merchant_and_montn'] = self.limit_per_merchant_and_montn
        if self.limit_per_user_and_day is not None:
            result['limit_per_user_and_day'] = self.limit_per_user_and_day
        if self.limit_per_user_and_month is not None:
            result['limit_per_user_and_month'] = self.limit_per_user_and_month
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('delegated_tenant_id') is not None:
            self.delegated_tenant_id = m.get('delegated_tenant_id')
        if m.get('equity_id') is not None:
            self.equity_id = m.get('equity_id')
        if m.get('limit_per_merchant_and_day') is not None:
            self.limit_per_merchant_and_day = m.get('limit_per_merchant_and_day')
        if m.get('limit_per_merchant_and_montn') is not None:
            self.limit_per_merchant_and_montn = m.get('limit_per_merchant_and_montn')
        if m.get('limit_per_user_and_day') is not None:
            self.limit_per_user_and_day = m.get('limit_per_user_and_day')
        if m.get('limit_per_user_and_month') is not None:
            self.limit_per_user_and_month = m.get('limit_per_user_and_month')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        return self


class UpdateEquityExchangelimitResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class UpdateEquityValidtimeRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        delegated_tenant_id: str = None,
        equity_id: str = None,
        out_tx_id: str = None,
        use_valid_not_after: str = None,
        use_valid_not_before: str = None,
        valid_not_after: str = None,
        valid_not_before: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 要代理的租户ID
        self.delegated_tenant_id = delegated_tenant_id
        # 权益商品ID
        self.equity_id = equity_id
        # 外部交易ID
        self.out_tx_id = out_tx_id
        # 权益商品使用有效期右闭区间
        self.use_valid_not_after = use_valid_not_after
        # 权益商品使用有效期左闭区间
        self.use_valid_not_before = use_valid_not_before
        # 权益商品兑换有效期右闭区间
        self.valid_not_after = valid_not_after
        # 权益商品兑换有效期左闭区间
        self.valid_not_before = valid_not_before

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.equity_id, 'equity_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.delegated_tenant_id is not None:
            result['delegated_tenant_id'] = self.delegated_tenant_id
        if self.equity_id is not None:
            result['equity_id'] = self.equity_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        if self.use_valid_not_after is not None:
            result['use_valid_not_after'] = self.use_valid_not_after
        if self.use_valid_not_before is not None:
            result['use_valid_not_before'] = self.use_valid_not_before
        if self.valid_not_after is not None:
            result['valid_not_after'] = self.valid_not_after
        if self.valid_not_before is not None:
            result['valid_not_before'] = self.valid_not_before
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('delegated_tenant_id') is not None:
            self.delegated_tenant_id = m.get('delegated_tenant_id')
        if m.get('equity_id') is not None:
            self.equity_id = m.get('equity_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        if m.get('use_valid_not_after') is not None:
            self.use_valid_not_after = m.get('use_valid_not_after')
        if m.get('use_valid_not_before') is not None:
            self.use_valid_not_before = m.get('use_valid_not_before')
        if m.get('valid_not_after') is not None:
            self.valid_not_after = m.get('valid_not_after')
        if m.get('valid_not_before') is not None:
            self.valid_not_before = m.get('valid_not_before')
        return self


class UpdateEquityValidtimeResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class QueryEquityRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        delegated_tenant_id: str = None,
        equity_id: str = None,
        opt_tenant_id: str = None,
        target_date: str = None,
        user_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 要代理操作的租户ID
        self.delegated_tenant_id = delegated_tenant_id
        # 权益商品ID
        self.equity_id = equity_id
        # 被检索商户ID
        self.opt_tenant_id = opt_tenant_id
        # 交易限制日期(yyyyMMdd或yyyyMM)(可选)
        self.target_date = target_date
        # 被检索用户ID
        self.user_id = user_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.equity_id, 'equity_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.delegated_tenant_id is not None:
            result['delegated_tenant_id'] = self.delegated_tenant_id
        if self.equity_id is not None:
            result['equity_id'] = self.equity_id
        if self.opt_tenant_id is not None:
            result['opt_tenant_id'] = self.opt_tenant_id
        if self.target_date is not None:
            result['target_date'] = self.target_date
        if self.user_id is not None:
            result['user_id'] = self.user_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('delegated_tenant_id') is not None:
            self.delegated_tenant_id = m.get('delegated_tenant_id')
        if m.get('equity_id') is not None:
            self.equity_id = m.get('equity_id')
        if m.get('opt_tenant_id') is not None:
            self.opt_tenant_id = m.get('opt_tenant_id')
        if m.get('target_date') is not None:
            self.target_date = m.get('target_date')
        if m.get('user_id') is not None:
            self.user_id = m.get('user_id')
        return self


class QueryEquityResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        equity: Equity = None,
        urls: List[str] = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 权益商品完整信息: equityType 权益类型：0积分，1卡券，2实物。 status 权益状态：0可用状态，1下线，2冻结。 authType 权益授权类型：0自动，1合约。
        # { "equity_id": "6041f851f4d", "tenant_id": "ZEJEZKUA", "admin_id": "ed7b3ac3c061", "equity_type": 1, "equity_name": "FDCardtest", "description": "FDCard", "total_count": "1000000", "status": 0, "auth_type": 0, "currency": "CNY", "value": "10.0000", "default_price": "1.0000", "images": "oss://myexchange/12593acf32dd6d4257fa0.jpeg", "desc_images": "", "memo": "", "is_public": true, "valid_not_before": 112692, "valid_not_after": 112654365244, "use_valid_not_before": 112612, "use_valid_not_after": 11265436524415235, "limit_per_user_and_day": 1000000, "limit_per_user_and_month": 100000, "limit_per_merchant_and_day": 1000000, "limit_per_merchant_and_month": 1000000, "equity_ext_info": { "open_to_tenant_id": "", "tenant_price": "", "tenant_user_price": { "snapshot_tenant_price": "", "user_price_type": 0, "price": "", "ratio": "" }, "target_date": "", "limit_per_day_used": 0, "limit_per_month_used": 0 } }
        self.equity = equity
        # 权益图片的永久oss地址
        self.urls = urls

    def validate(self):
        if self.equity:
            self.equity.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.equity is not None:
            result['equity'] = self.equity.to_map()
        if self.urls is not None:
            result['urls'] = self.urls
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('equity') is not None:
            temp_model = Equity()
            self.equity = temp_model.from_map(m['equity'])
        if m.get('urls') is not None:
            self.urls = m.get('urls')
        return self


class ExecExchangeByuserRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        asset_id: str = None,
        asset_issuer: str = None,
        asset_rate: str = None,
        chain_id: str = None,
        delegated_tenant_id: str = None,
        equity_id: str = None,
        equity_provider: str = None,
        equity_rate: str = None,
        memo: str = None,
        out_tx_id: str = None,
        user_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 资产ID
        self.asset_id = asset_id
        # 资产发行方
        self.asset_issuer = asset_issuer
        # 期望资产汇率
        self.asset_rate = asset_rate
        # 链ID
        self.chain_id = chain_id
        # 代理操作专用，要代理操作的租户ID
        self.delegated_tenant_id = delegated_tenant_id
        # 权益商品ID
        self.equity_id = equity_id
        # 权益商品提供方ID
        self.equity_provider = equity_provider
        # 期望权益汇率
        self.equity_rate = equity_rate
        # 兑换时必要信息，敏感信息需加密。兑换时必要的信息，敏感信息需加密。实际数据结构根据商品类型和描述输入，可参考https://tech.antfin.com/docs/2/163896
        self.memo = memo
        # 外部交易ID
        self.out_tx_id = out_tx_id
        # 用户ID
        self.user_id = user_id

    def validate(self):
        self.validate_required(self.asset_id, 'asset_id')
        self.validate_required(self.asset_issuer, 'asset_issuer')
        self.validate_required(self.asset_rate, 'asset_rate')
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.equity_id, 'equity_id')
        self.validate_required(self.equity_provider, 'equity_provider')
        self.validate_required(self.equity_rate, 'equity_rate')
        self.validate_required(self.out_tx_id, 'out_tx_id')
        self.validate_required(self.user_id, 'user_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.asset_id is not None:
            result['asset_id'] = self.asset_id
        if self.asset_issuer is not None:
            result['asset_issuer'] = self.asset_issuer
        if self.asset_rate is not None:
            result['asset_rate'] = self.asset_rate
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.delegated_tenant_id is not None:
            result['delegated_tenant_id'] = self.delegated_tenant_id
        if self.equity_id is not None:
            result['equity_id'] = self.equity_id
        if self.equity_provider is not None:
            result['equity_provider'] = self.equity_provider
        if self.equity_rate is not None:
            result['equity_rate'] = self.equity_rate
        if self.memo is not None:
            result['memo'] = self.memo
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        if self.user_id is not None:
            result['user_id'] = self.user_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('asset_id') is not None:
            self.asset_id = m.get('asset_id')
        if m.get('asset_issuer') is not None:
            self.asset_issuer = m.get('asset_issuer')
        if m.get('asset_rate') is not None:
            self.asset_rate = m.get('asset_rate')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('delegated_tenant_id') is not None:
            self.delegated_tenant_id = m.get('delegated_tenant_id')
        if m.get('equity_id') is not None:
            self.equity_id = m.get('equity_id')
        if m.get('equity_provider') is not None:
            self.equity_provider = m.get('equity_provider')
        if m.get('equity_rate') is not None:
            self.equity_rate = m.get('equity_rate')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        if m.get('user_id') is not None:
            self.user_id = m.get('user_id')
        return self


class ExecExchangeByuserResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class ExecExchangeBymerchantRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        asset_id: str = None,
        asset_rate: str = None,
        chain_id: str = None,
        equity_id: str = None,
        equity_price: str = None,
        memo: str = None,
        out_tx_id: str = None,
        tx_sig: str = None,
        user_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 资产ID
        self.asset_id = asset_id
        # 当前希望按照上述比例扣减用户资产
        self.asset_rate = asset_rate
        # 链ID
        self.chain_id = chain_id
        # 权益商品ID，例：7f1be9108651f97513b5b59030f5b059e58a59d263ab426cbf26337f91642caa
        self.equity_id = equity_id
        # 用户兑换价格接口设置的价格（单位：元）
        self.equity_price = equity_price
        # 兑换时必要的信息，敏感信息需加密。实际数据结构根据商品类型和描述输入，可参考https://tech.antfin.com/docs/2/163896
        # 比如在兑换手机直充商品时，需要对{"countryCode": "86", "phone": "13900000000"} 使用供应商的公钥进行加密。
        self.memo = memo
        # 权益商品兑换外部流水ID，调用方自定义流水ID
        self.out_tx_id = out_tx_id
        # 采购商如果绑定了附加的公私钥对。在兑换商品时需要对SHA256(out_tx_id+tenant_id+asset_id+equity_id+equity_price+asset_rate+user_id+memo)使用ECC K1私钥签名（算法ECDSAWithSHA256，曲线Secp256K1），并转换为Hex。
        self.tx_sig = tx_sig
        # 受益用户名
        self.user_id = user_id

    def validate(self):
        self.validate_required(self.asset_id, 'asset_id')
        self.validate_required(self.asset_rate, 'asset_rate')
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.equity_id, 'equity_id')
        self.validate_required(self.equity_price, 'equity_price')
        self.validate_required(self.out_tx_id, 'out_tx_id')
        self.validate_required(self.user_id, 'user_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.asset_id is not None:
            result['asset_id'] = self.asset_id
        if self.asset_rate is not None:
            result['asset_rate'] = self.asset_rate
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.equity_id is not None:
            result['equity_id'] = self.equity_id
        if self.equity_price is not None:
            result['equity_price'] = self.equity_price
        if self.memo is not None:
            result['memo'] = self.memo
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        if self.tx_sig is not None:
            result['tx_sig'] = self.tx_sig
        if self.user_id is not None:
            result['user_id'] = self.user_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('asset_id') is not None:
            self.asset_id = m.get('asset_id')
        if m.get('asset_rate') is not None:
            self.asset_rate = m.get('asset_rate')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('equity_id') is not None:
            self.equity_id = m.get('equity_id')
        if m.get('equity_price') is not None:
            self.equity_price = m.get('equity_price')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        if m.get('tx_sig') is not None:
            self.tx_sig = m.get('tx_sig')
        if m.get('user_id') is not None:
            self.user_id = m.get('user_id')
        return self


class ExecExchangeBymerchantResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class ConfirmExchangeRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        delegated_tenant_id: str = None,
        equity_id: str = None,
        memo: str = None,
        origin_tx_id: str = None,
        out_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 要代理操作的租户ID
        self.delegated_tenant_id = delegated_tenant_id
        # 权益商品ID
        self.equity_id = equity_id
        # 附言。实际数据结构根据商品类型和描述输入，可参考https://tech.antfin.com/docs/2/163896
        self.memo = memo
        # 原始订单交易ID。由采购商在创建对换单时传入，不可更新。
        self.origin_tx_id = origin_tx_id
        # 外部交易ID
        self.out_tx_id = out_tx_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.equity_id, 'equity_id')
        self.validate_required(self.origin_tx_id, 'origin_tx_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.delegated_tenant_id is not None:
            result['delegated_tenant_id'] = self.delegated_tenant_id
        if self.equity_id is not None:
            result['equity_id'] = self.equity_id
        if self.memo is not None:
            result['memo'] = self.memo
        if self.origin_tx_id is not None:
            result['origin_tx_id'] = self.origin_tx_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('delegated_tenant_id') is not None:
            self.delegated_tenant_id = m.get('delegated_tenant_id')
        if m.get('equity_id') is not None:
            self.equity_id = m.get('equity_id')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('origin_tx_id') is not None:
            self.origin_tx_id = m.get('origin_tx_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        return self


class ConfirmExchangeResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class ExecExchangeOutofstoreRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        delegated_tenant_id: str = None,
        equity_id: str = None,
        memo: str = None,
        origin_tx_id: str = None,
        out_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 要代理操作的租户ID
        self.delegated_tenant_id = delegated_tenant_id
        # 权益商品ID
        self.equity_id = equity_id
        # 缺货时通知给采购方的信息，若敏感信息需加密。实际数据结构根据商品类型和描述输入，可参考https://tech.antfin.com/docs/2/163896
        self.memo = memo
        # 原始订单交易ID。由采购商在创建对换单时传入，不可更新。
        self.origin_tx_id = origin_tx_id
        # 外部交易ID
        self.out_tx_id = out_tx_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.equity_id, 'equity_id')
        self.validate_required(self.memo, 'memo')
        self.validate_required(self.origin_tx_id, 'origin_tx_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.delegated_tenant_id is not None:
            result['delegated_tenant_id'] = self.delegated_tenant_id
        if self.equity_id is not None:
            result['equity_id'] = self.equity_id
        if self.memo is not None:
            result['memo'] = self.memo
        if self.origin_tx_id is not None:
            result['origin_tx_id'] = self.origin_tx_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('delegated_tenant_id') is not None:
            self.delegated_tenant_id = m.get('delegated_tenant_id')
        if m.get('equity_id') is not None:
            self.equity_id = m.get('equity_id')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('origin_tx_id') is not None:
            self.origin_tx_id = m.get('origin_tx_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        return self


class ExecExchangeOutofstoreResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class SendExchangeRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        delegated_tenant_id: str = None,
        equity_id: str = None,
        memo: str = None,
        origin_tx_id: str = None,
        out_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 要代理操作的租户ID
        self.delegated_tenant_id = delegated_tenant_id
        # 权益商品ID
        self.equity_id = equity_id
        # 发货商品的信息，敏感信息需加密，使用收货方公钥加密的权益信息。实际数据结构根据商品类型和描述输入，可参考https://tech.antfin.com/docs/2/163896。比如在手机直充时可以返回 {  "voucher": "充值凭证，如有",  "memo": ""}信息。
        self.memo = memo
        # 原始订单交易ID。由采购商在创建对换单时传入，不可更新。
        self.origin_tx_id = origin_tx_id
        # 外部交易ID
        self.out_tx_id = out_tx_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.equity_id, 'equity_id')
        self.validate_required(self.origin_tx_id, 'origin_tx_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.delegated_tenant_id is not None:
            result['delegated_tenant_id'] = self.delegated_tenant_id
        if self.equity_id is not None:
            result['equity_id'] = self.equity_id
        if self.memo is not None:
            result['memo'] = self.memo
        if self.origin_tx_id is not None:
            result['origin_tx_id'] = self.origin_tx_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('delegated_tenant_id') is not None:
            self.delegated_tenant_id = m.get('delegated_tenant_id')
        if m.get('equity_id') is not None:
            self.equity_id = m.get('equity_id')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('origin_tx_id') is not None:
            self.origin_tx_id = m.get('origin_tx_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        return self


class SendExchangeResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class ExecExchangeReceivebyuserRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        delegated_tenant_id: str = None,
        memo: str = None,
        origin_tx_id: str = None,
        out_tx_id: str = None,
        user_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 要代理操作的租户ID
        self.delegated_tenant_id = delegated_tenant_id
        # 收货时的信息，若敏感信息需加密。实际数据结构根据商品类型和描述输入，可参考https://tech.antfin.com/docs/2/163896
        self.memo = memo
        # 原始订单交易ID。由采购商在创建对换单时传入，不可更新。
        self.origin_tx_id = origin_tx_id
        # 外部交易ID
        self.out_tx_id = out_tx_id
        # 用户ID
        self.user_id = user_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.memo, 'memo')
        self.validate_required(self.origin_tx_id, 'origin_tx_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')
        self.validate_required(self.user_id, 'user_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.delegated_tenant_id is not None:
            result['delegated_tenant_id'] = self.delegated_tenant_id
        if self.memo is not None:
            result['memo'] = self.memo
        if self.origin_tx_id is not None:
            result['origin_tx_id'] = self.origin_tx_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        if self.user_id is not None:
            result['user_id'] = self.user_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('delegated_tenant_id') is not None:
            self.delegated_tenant_id = m.get('delegated_tenant_id')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('origin_tx_id') is not None:
            self.origin_tx_id = m.get('origin_tx_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        if m.get('user_id') is not None:
            self.user_id = m.get('user_id')
        return self


class ExecExchangeReceivebyuserResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class ExecAssetExpireRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        amount: int = None,
        asset_id: str = None,
        chain_id: str = None,
        info: str = None,
        original_tx_id: str = None,
        out_tx_id: str = None,
        user_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 数量
        self.amount = amount
        # 资产ID
        self.asset_id = asset_id
        # 链ID
        self.chain_id = chain_id
        # 资产过期信息
        self.info = info
        # 过期的交易ID
        self.original_tx_id = original_tx_id
        # 外部交易ID，每个租户保证唯一
        self.out_tx_id = out_tx_id
        # 用户ID
        self.user_id = user_id

    def validate(self):
        self.validate_required(self.amount, 'amount')
        self.validate_required(self.asset_id, 'asset_id')
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.original_tx_id, 'original_tx_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')
        self.validate_required(self.user_id, 'user_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.amount is not None:
            result['amount'] = self.amount
        if self.asset_id is not None:
            result['asset_id'] = self.asset_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.info is not None:
            result['info'] = self.info
        if self.original_tx_id is not None:
            result['original_tx_id'] = self.original_tx_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        if self.user_id is not None:
            result['user_id'] = self.user_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('amount') is not None:
            self.amount = m.get('amount')
        if m.get('asset_id') is not None:
            self.asset_id = m.get('asset_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('info') is not None:
            self.info = m.get('info')
        if m.get('original_tx_id') is not None:
            self.original_tx_id = m.get('original_tx_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        if m.get('user_id') is not None:
            self.user_id = m.get('user_id')
        return self


class ExecAssetExpireResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class QueryAssetInstructionRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        origin_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 资产流水ID
        self.origin_tx_id = origin_tx_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.origin_tx_id, 'origin_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.origin_tx_id is not None:
            result['origin_tx_id'] = self.origin_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('origin_tx_id') is not None:
            self.origin_tx_id = m.get('origin_tx_id')
        return self


class QueryAssetInstructionResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        instruction: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 资产流水完整信息的json字符串。
        # direction 交易方向:：0正向交易，1反向交易。
        # type 交易类型：0 资产发行；1资产赎回；2资产发放；3资产发放回退；4资产风控调整；5资产过期；6资产支付；7资产支付退款。
        # status流水状态(Complete)；0完成
        self.instruction = instruction

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.instruction is not None:
            result['instruction'] = self.instruction
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('instruction') is not None:
            self.instruction = m.get('instruction')
        return self


class QueryExchangeInstructionRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        equity_id: str = None,
        opt_tenant_id: str = None,
        origin_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 权益商品ID
        self.equity_id = equity_id
        # 发起操作的租户ID
        self.opt_tenant_id = opt_tenant_id
        # 原始订单交易ID。由采购商在创建对换单时传入，不可更新。
        self.origin_tx_id = origin_tx_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.equity_id, 'equity_id')
        self.validate_required(self.opt_tenant_id, 'opt_tenant_id')
        self.validate_required(self.origin_tx_id, 'origin_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.equity_id is not None:
            result['equity_id'] = self.equity_id
        if self.opt_tenant_id is not None:
            result['opt_tenant_id'] = self.opt_tenant_id
        if self.origin_tx_id is not None:
            result['origin_tx_id'] = self.origin_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('equity_id') is not None:
            self.equity_id = m.get('equity_id')
        if m.get('opt_tenant_id') is not None:
            self.opt_tenant_id = m.get('opt_tenant_id')
        if m.get('origin_tx_id') is not None:
            self.origin_tx_id = m.get('origin_tx_id')
        return self


class QueryExchangeInstructionResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        instruction: EInstruction = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 权益兑换流水完整信息
        self.instruction = instruction

    def validate(self):
        if self.instruction:
            self.instruction.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.instruction is not None:
            result['instruction'] = self.instruction.to_map()
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('instruction') is not None:
            temp_model = EInstruction()
            self.instruction = temp_model.from_map(m['instruction'])
        return self


class ExecAssetIssueRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        amount: int = None,
        asset_id: str = None,
        chain_id: str = None,
        info: str = None,
        out_tx_id: str = None,
        opt_tenant_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 充值数量
        self.amount = amount
        # 资产ID
        self.asset_id = asset_id
        # 链ID
        self.chain_id = chain_id
        # 备注信息
        self.info = info
        # 外部交易ID
        self.out_tx_id = out_tx_id
        # 充值租户ID
        self.opt_tenant_id = opt_tenant_id

    def validate(self):
        self.validate_required(self.amount, 'amount')
        self.validate_required(self.asset_id, 'asset_id')
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.info, 'info')
        self.validate_required(self.out_tx_id, 'out_tx_id')
        self.validate_required(self.opt_tenant_id, 'opt_tenant_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.amount is not None:
            result['amount'] = self.amount
        if self.asset_id is not None:
            result['asset_id'] = self.asset_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.info is not None:
            result['info'] = self.info
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        if self.opt_tenant_id is not None:
            result['opt_tenant_id'] = self.opt_tenant_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('amount') is not None:
            self.amount = m.get('amount')
        if m.get('asset_id') is not None:
            self.asset_id = m.get('asset_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('info') is not None:
            self.info = m.get('info')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        if m.get('opt_tenant_id') is not None:
            self.opt_tenant_id = m.get('opt_tenant_id')
        return self


class ExecAssetIssueResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class ExecAssetRedeemRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        amount: int = None,
        asset_id: str = None,
        chain_id: str = None,
        info: str = None,
        origin_tx_id: str = None,
        out_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 赎回数量
        self.amount = amount
        # 资产ID
        self.asset_id = asset_id
        # 链ID
        self.chain_id = chain_id
        # 备注信息
        self.info = info
        # 要赎回的充值交易ID
        self.origin_tx_id = origin_tx_id
        # 外部交易ID
        self.out_tx_id = out_tx_id

    def validate(self):
        self.validate_required(self.amount, 'amount')
        self.validate_required(self.asset_id, 'asset_id')
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.info, 'info')
        self.validate_required(self.origin_tx_id, 'origin_tx_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.amount is not None:
            result['amount'] = self.amount
        if self.asset_id is not None:
            result['asset_id'] = self.asset_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.info is not None:
            result['info'] = self.info
        if self.origin_tx_id is not None:
            result['origin_tx_id'] = self.origin_tx_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('amount') is not None:
            self.amount = m.get('amount')
        if m.get('asset_id') is not None:
            self.asset_id = m.get('asset_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('info') is not None:
            self.info = m.get('info')
        if m.get('origin_tx_id') is not None:
            self.origin_tx_id = m.get('origin_tx_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        return self


class ExecAssetRedeemResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class ExecAssetGrantRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        amount: str = None,
        asset_id: str = None,
        chain_id: str = None,
        info: str = None,
        merchant_id: str = None,
        out_tx_id: str = None,
        user_id: str = None,
        validity_time: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 数量
        self.amount = amount
        # 资产ID
        self.asset_id = asset_id
        # 链ID
        self.chain_id = chain_id
        # 资产发放信息
        self.info = info
        # 商户ID
        self.merchant_id = merchant_id
        # 外部交易ID
        self.out_tx_id = out_tx_id
        # 用户ID
        self.user_id = user_id
        # 有效时间
        self.validity_time = validity_time

    def validate(self):
        self.validate_required(self.amount, 'amount')
        self.validate_required(self.asset_id, 'asset_id')
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.merchant_id, 'merchant_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')
        self.validate_required(self.user_id, 'user_id')
        self.validate_required(self.validity_time, 'validity_time')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.amount is not None:
            result['amount'] = self.amount
        if self.asset_id is not None:
            result['asset_id'] = self.asset_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.info is not None:
            result['info'] = self.info
        if self.merchant_id is not None:
            result['merchant_id'] = self.merchant_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        if self.user_id is not None:
            result['user_id'] = self.user_id
        if self.validity_time is not None:
            result['validity_time'] = self.validity_time
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('amount') is not None:
            self.amount = m.get('amount')
        if m.get('asset_id') is not None:
            self.asset_id = m.get('asset_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('info') is not None:
            self.info = m.get('info')
        if m.get('merchant_id') is not None:
            self.merchant_id = m.get('merchant_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        if m.get('user_id') is not None:
            self.user_id = m.get('user_id')
        if m.get('validity_time') is not None:
            self.validity_time = m.get('validity_time')
        return self


class ExecAssetGrantResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class ExecAssetGrantrefundRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        amount: int = None,
        asset_id: str = None,
        chain_id: str = None,
        info: str = None,
        origin_tx_id: str = None,
        out_tx_id: str = None,
        user_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 数量
        self.amount = amount
        # 资产ID
        self.asset_id = asset_id
        # 链ID
        self.chain_id = chain_id
        # 备注信息
        self.info = info
        # 要回退的交易ID
        self.origin_tx_id = origin_tx_id
        # 外部交易ID
        self.out_tx_id = out_tx_id
        # 用户ID
        self.user_id = user_id

    def validate(self):
        self.validate_required(self.amount, 'amount')
        self.validate_required(self.asset_id, 'asset_id')
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.info, 'info')
        self.validate_required(self.origin_tx_id, 'origin_tx_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')
        self.validate_required(self.user_id, 'user_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.amount is not None:
            result['amount'] = self.amount
        if self.asset_id is not None:
            result['asset_id'] = self.asset_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.info is not None:
            result['info'] = self.info
        if self.origin_tx_id is not None:
            result['origin_tx_id'] = self.origin_tx_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        if self.user_id is not None:
            result['user_id'] = self.user_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('amount') is not None:
            self.amount = m.get('amount')
        if m.get('asset_id') is not None:
            self.asset_id = m.get('asset_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('info') is not None:
            self.info = m.get('info')
        if m.get('origin_tx_id') is not None:
            self.origin_tx_id = m.get('origin_tx_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        if m.get('user_id') is not None:
            self.user_id = m.get('user_id')
        return self


class ExecAssetGrantrefundResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class ExecAssetAdjustRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        amount: int = None,
        asset_id: str = None,
        chain_id: str = None,
        info: str = None,
        out_tx_id: str = None,
        user_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 风控调整数量
        self.amount = amount
        # 资产ID
        self.asset_id = asset_id
        # 链ID
        self.chain_id = chain_id
        # 风控调整信息
        self.info = info
        # 外部交易ID，每个租户保证唯一
        self.out_tx_id = out_tx_id
        # 用户ID
        self.user_id = user_id

    def validate(self):
        self.validate_required(self.amount, 'amount')
        self.validate_required(self.asset_id, 'asset_id')
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')
        self.validate_required(self.user_id, 'user_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.amount is not None:
            result['amount'] = self.amount
        if self.asset_id is not None:
            result['asset_id'] = self.asset_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.info is not None:
            result['info'] = self.info
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        if self.user_id is not None:
            result['user_id'] = self.user_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('amount') is not None:
            self.amount = m.get('amount')
        if m.get('asset_id') is not None:
            self.asset_id = m.get('asset_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('info') is not None:
            self.info = m.get('info')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        if m.get('user_id') is not None:
            self.user_id = m.get('user_id')
        return self


class ExecAssetAdjustResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class QueryAssetRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        asset_id: str = None,
        chain_id: str = None,
        opt_tenant_id: str = None,
        user_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 资产ID
        self.asset_id = asset_id
        # 链ID
        self.chain_id = chain_id
        # 资产查询相关的租户ID
        self.opt_tenant_id = opt_tenant_id
        # 若要查询用户持有的资产数量，输入用户ID
        self.user_id = user_id

    def validate(self):
        self.validate_required(self.asset_id, 'asset_id')
        self.validate_required(self.chain_id, 'chain_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.asset_id is not None:
            result['asset_id'] = self.asset_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.opt_tenant_id is not None:
            result['opt_tenant_id'] = self.opt_tenant_id
        if self.user_id is not None:
            result['user_id'] = self.user_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('asset_id') is not None:
            self.asset_id = m.get('asset_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('opt_tenant_id') is not None:
            self.opt_tenant_id = m.get('opt_tenant_id')
        if m.get('user_id') is not None:
            self.user_id = m.get('user_id')
        return self


class QueryAssetResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        asset: Asset = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 资产完整信息
        # {
        # "asset_id": "CT::Asset001",
        # "asset_name": "CTPoints",
        # "tenant_id": "OREDKOCN",
        # "admin_id": "f46857d8796fc2b829862e2752bda38f7eefeec5581ad41398002f50a3ad8ccd",
        # "currency": "CNY",
        # "asset_rate": "1000.0000",
        # "total_issue_balance": "11111111.0000",
        # "issue_account_balance": "0.0000",
        # "relay_Account_balance": "0.0000",
        # "receive_payment_account_balance": "0.0000",
        # "overdue_recovery_account_balance": "",
        # "status": 76,
        # "asset_ext_info": {
        # "dispense_tenant_id": "",
        # "dispense_balance": "",
        # "user_id": "",
        # "user_credit_balance": ""
        # }
        # }
        self.asset = asset

    def validate(self):
        if self.asset:
            self.asset.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.asset is not None:
            result['asset'] = self.asset.to_map()
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('asset') is not None:
            temp_model = Asset()
            self.asset = temp_model.from_map(m['asset'])
        return self


class ExecExchangeReceivebymerchantRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        equity_id: str = None,
        memo: str = None,
        origin_tx_id: str = None,
        out_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 权益商品ID
        self.equity_id = equity_id
        # 收货时的信息，若敏感信息需加密。实际数据结构根据商品类型和描述输入，可参考https://tech.antfin.com/docs/2/163896
        self.memo = memo
        # 原始订单交易ID。由采购商在创建对换单时传入，不可更新。
        self.origin_tx_id = origin_tx_id
        # 外部交易ID
        self.out_tx_id = out_tx_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.equity_id, 'equity_id')
        self.validate_required(self.origin_tx_id, 'origin_tx_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.equity_id is not None:
            result['equity_id'] = self.equity_id
        if self.memo is not None:
            result['memo'] = self.memo
        if self.origin_tx_id is not None:
            result['origin_tx_id'] = self.origin_tx_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('equity_id') is not None:
            self.equity_id = m.get('equity_id')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('origin_tx_id') is not None:
            self.origin_tx_id = m.get('origin_tx_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        return self


class ExecExchangeReceivebymerchantResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class QueryBlockRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        block_number: int = None,
        chain_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 区块链高度
        self.block_number = block_number
        # 链ID
        self.chain_id = chain_id

    def validate(self):
        self.validate_required(self.block_number, 'block_number')
        self.validate_required(self.chain_id, 'chain_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.block_number is not None:
            result['block_number'] = self.block_number
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('block_number') is not None:
            self.block_number = m.get('block_number')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        return self


class QueryBlockResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        block: Block = None,
        block_number: int = None,
        chain_id: str = None,
        filtered_tx_count: int = None,
        total_tx_count: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 区块信息
        self.block = block
        # 区块高度
        self.block_number = block_number
        # 链ID
        self.chain_id = chain_id
        # 过滤后的交易数量
        self.filtered_tx_count = filtered_tx_count
        # 区块中交易总数
        self.total_tx_count = total_tx_count

    def validate(self):
        if self.block:
            self.block.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.block is not None:
            result['block'] = self.block.to_map()
        if self.block_number is not None:
            result['block_number'] = self.block_number
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.filtered_tx_count is not None:
            result['filtered_tx_count'] = self.filtered_tx_count
        if self.total_tx_count is not None:
            result['total_tx_count'] = self.total_tx_count
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('block') is not None:
            temp_model = Block()
            self.block = temp_model.from_map(m['block'])
        if m.get('block_number') is not None:
            self.block_number = m.get('block_number')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('filtered_tx_count') is not None:
            self.filtered_tx_count = m.get('filtered_tx_count')
        if m.get('total_tx_count') is not None:
            self.total_tx_count = m.get('total_tx_count')
        return self


class QueryBlockLastblocknumberRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        return self


class QueryBlockLastblocknumberResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        last_block_number: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 最新区块高度
        self.last_block_number = last_block_number

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.last_block_number is not None:
            result['last_block_number'] = self.last_block_number
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('last_block_number') is not None:
            self.last_block_number = m.get('last_block_number')
        return self


class UpdateEquityRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        auth_type: int = None,
        chain_id: str = None,
        currency: str = None,
        default_price: str = None,
        delegated_tenant_id: str = None,
        description: str = None,
        desc_images: str = None,
        equity_id: str = None,
        equity_name: str = None,
        equity_type: int = None,
        if_public: bool = None,
        images: str = None,
        limit_per_merchant_and_day: int = None,
        limit_per_merchant_and_month: int = None,
        limit_per_user_and_day: int = None,
        limit_per_user_and_month: int = None,
        memo: str = None,
        out_tx_id: str = None,
        total_count: str = None,
        use_valid_not_after: int = None,
        use_valid_not_before: int = None,
        valid_not_after: int = None,
        valid_not_before: int = None,
        value: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 授权类型：0 Auto，1 Contract。不可修改，如需修改需重新发布商品
        self.auth_type = auth_type
        # 链ID
        self.chain_id = chain_id
        # 货币类型。不可修改，如需修改需重新发布商品。
        self.currency = currency
        # 默认价格（单位：元）
        self.default_price = default_price
        # 要代理的租户ID
        self.delegated_tenant_id = delegated_tenant_id
        # 权益商品详细描述信息
        self.description = description
        # 描述图片信息(;分隔)
        self.desc_images = desc_images
        # 权益商品ID
        self.equity_id = equity_id
        # 权益商品名称
        self.equity_name = equity_name
        # 权益商品类型：类型为整型（不大于：2147483647），需要进行细分，类型由三部分组成；aabbbbcccc。aa 为大类分类，bbbb 为细项分类（无细项分类时为0000），cccc 为数据格式分类（其中0000表示无格式要求）。请根据实际商品类型填写，具体类型和兑换时数据结构查看文档【https://tech.antfin.com/docs/2/163896】。不可修改，如需修改需重新发布商品
        self.equity_type = equity_type
        # 权益商品是否公开。不可修改，如需修改需重新发布商品
        self.if_public = if_public
        # 主图片信息(;分隔)
        self.images = images
        # 商户每日兑换上限
        self.limit_per_merchant_and_day = limit_per_merchant_and_day
        # 商户每月兑换上限
        self.limit_per_merchant_and_month = limit_per_merchant_and_month
        # 用户每日兑换上限
        self.limit_per_user_and_day = limit_per_user_and_day
        # 用户每月兑换上限
        self.limit_per_user_and_month = limit_per_user_and_month
        # 附言
        self.memo = memo
        # 交易ID
        self.out_tx_id = out_tx_id
        # 库存
        self.total_count = total_count
        # 权益商品使用有效期结束时间（毫秒）
        self.use_valid_not_after = use_valid_not_after
        # 权益商品使用有效期开始时间（毫秒）
        self.use_valid_not_before = use_valid_not_before
        # 权益商品兑换有效期结束时间（毫秒）
        self.valid_not_after = valid_not_after
        # 权益商品兑换有效期开始时间（毫秒）
        self.valid_not_before = valid_not_before
        # 面值（单位：元）。不可修改，如需修改需重新发布商品
        self.value = value

    def validate(self):
        self.validate_required(self.auth_type, 'auth_type')
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.currency, 'currency')
        self.validate_required(self.default_price, 'default_price')
        self.validate_required(self.description, 'description')
        self.validate_required(self.desc_images, 'desc_images')
        self.validate_required(self.equity_id, 'equity_id')
        self.validate_required(self.equity_name, 'equity_name')
        self.validate_required(self.equity_type, 'equity_type')
        self.validate_required(self.if_public, 'if_public')
        self.validate_required(self.images, 'images')
        self.validate_required(self.limit_per_merchant_and_day, 'limit_per_merchant_and_day')
        self.validate_required(self.limit_per_merchant_and_month, 'limit_per_merchant_and_month')
        self.validate_required(self.limit_per_user_and_day, 'limit_per_user_and_day')
        self.validate_required(self.limit_per_user_and_month, 'limit_per_user_and_month')
        self.validate_required(self.out_tx_id, 'out_tx_id')
        self.validate_required(self.total_count, 'total_count')
        self.validate_required(self.use_valid_not_after, 'use_valid_not_after')
        self.validate_required(self.use_valid_not_before, 'use_valid_not_before')
        self.validate_required(self.valid_not_after, 'valid_not_after')
        self.validate_required(self.valid_not_before, 'valid_not_before')
        self.validate_required(self.value, 'value')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.auth_type is not None:
            result['auth_type'] = self.auth_type
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.currency is not None:
            result['currency'] = self.currency
        if self.default_price is not None:
            result['default_price'] = self.default_price
        if self.delegated_tenant_id is not None:
            result['delegated_tenant_id'] = self.delegated_tenant_id
        if self.description is not None:
            result['description'] = self.description
        if self.desc_images is not None:
            result['desc_images'] = self.desc_images
        if self.equity_id is not None:
            result['equity_id'] = self.equity_id
        if self.equity_name is not None:
            result['equity_name'] = self.equity_name
        if self.equity_type is not None:
            result['equity_type'] = self.equity_type
        if self.if_public is not None:
            result['if_public'] = self.if_public
        if self.images is not None:
            result['images'] = self.images
        if self.limit_per_merchant_and_day is not None:
            result['limit_per_merchant_and_day'] = self.limit_per_merchant_and_day
        if self.limit_per_merchant_and_month is not None:
            result['limit_per_merchant_and_month'] = self.limit_per_merchant_and_month
        if self.limit_per_user_and_day is not None:
            result['limit_per_user_and_day'] = self.limit_per_user_and_day
        if self.limit_per_user_and_month is not None:
            result['limit_per_user_and_month'] = self.limit_per_user_and_month
        if self.memo is not None:
            result['memo'] = self.memo
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        if self.total_count is not None:
            result['total_count'] = self.total_count
        if self.use_valid_not_after is not None:
            result['use_valid_not_after'] = self.use_valid_not_after
        if self.use_valid_not_before is not None:
            result['use_valid_not_before'] = self.use_valid_not_before
        if self.valid_not_after is not None:
            result['valid_not_after'] = self.valid_not_after
        if self.valid_not_before is not None:
            result['valid_not_before'] = self.valid_not_before
        if self.value is not None:
            result['value'] = self.value
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('auth_type') is not None:
            self.auth_type = m.get('auth_type')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('currency') is not None:
            self.currency = m.get('currency')
        if m.get('default_price') is not None:
            self.default_price = m.get('default_price')
        if m.get('delegated_tenant_id') is not None:
            self.delegated_tenant_id = m.get('delegated_tenant_id')
        if m.get('description') is not None:
            self.description = m.get('description')
        if m.get('desc_images') is not None:
            self.desc_images = m.get('desc_images')
        if m.get('equity_id') is not None:
            self.equity_id = m.get('equity_id')
        if m.get('equity_name') is not None:
            self.equity_name = m.get('equity_name')
        if m.get('equity_type') is not None:
            self.equity_type = m.get('equity_type')
        if m.get('if_public') is not None:
            self.if_public = m.get('if_public')
        if m.get('images') is not None:
            self.images = m.get('images')
        if m.get('limit_per_merchant_and_day') is not None:
            self.limit_per_merchant_and_day = m.get('limit_per_merchant_and_day')
        if m.get('limit_per_merchant_and_month') is not None:
            self.limit_per_merchant_and_month = m.get('limit_per_merchant_and_month')
        if m.get('limit_per_user_and_day') is not None:
            self.limit_per_user_and_day = m.get('limit_per_user_and_day')
        if m.get('limit_per_user_and_month') is not None:
            self.limit_per_user_and_month = m.get('limit_per_user_and_month')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        if m.get('total_count') is not None:
            self.total_count = m.get('total_count')
        if m.get('use_valid_not_after') is not None:
            self.use_valid_not_after = m.get('use_valid_not_after')
        if m.get('use_valid_not_before') is not None:
            self.use_valid_not_before = m.get('use_valid_not_before')
        if m.get('valid_not_after') is not None:
            self.valid_not_after = m.get('valid_not_after')
        if m.get('valid_not_before') is not None:
            self.valid_not_before = m.get('valid_not_before')
        if m.get('value') is not None:
            self.value = m.get('value')
        return self


class UpdateEquityResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class QueryEquityCreateresultRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        create_equity_request_id: str = None,
        delegated_tenant_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 创建商品接口返回的createEquityRequestId
        self.create_equity_request_id = create_equity_request_id
        # 要代理操作的租户ID
        self.delegated_tenant_id = delegated_tenant_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.create_equity_request_id, 'create_equity_request_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.create_equity_request_id is not None:
            result['create_equity_request_id'] = self.create_equity_request_id
        if self.delegated_tenant_id is not None:
            result['delegated_tenant_id'] = self.delegated_tenant_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('create_equity_request_id') is not None:
            self.create_equity_request_id = m.get('create_equity_request_id')
        if m.get('delegated_tenant_id') is not None:
            self.delegated_tenant_id = m.get('delegated_tenant_id')
        return self


class QueryEquityCreateresultResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        equity_id: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 权益商品创建成功，返回权益ID
        self.equity_id = equity_id

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.equity_id is not None:
            result['equity_id'] = self.equity_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('equity_id') is not None:
            self.equity_id = m.get('equity_id')
        return self


class QueryEquityInstructionRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        delegated_tenant_id: str = None,
        equity_id: str = None,
        opt_tenant_id: str = None,
        origin_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 代理该租户调用接口，会使用该租户发送交易链上查询信息
        self.delegated_tenant_id = delegated_tenant_id
        # 权益商品ID
        self.equity_id = equity_id
        # 发起操作的租户ID
        self.opt_tenant_id = opt_tenant_id
        # 要查询的流水交易号
        self.origin_tx_id = origin_tx_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.equity_id, 'equity_id')
        self.validate_required(self.opt_tenant_id, 'opt_tenant_id')
        self.validate_required(self.origin_tx_id, 'origin_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.delegated_tenant_id is not None:
            result['delegated_tenant_id'] = self.delegated_tenant_id
        if self.equity_id is not None:
            result['equity_id'] = self.equity_id
        if self.opt_tenant_id is not None:
            result['opt_tenant_id'] = self.opt_tenant_id
        if self.origin_tx_id is not None:
            result['origin_tx_id'] = self.origin_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('delegated_tenant_id') is not None:
            self.delegated_tenant_id = m.get('delegated_tenant_id')
        if m.get('equity_id') is not None:
            self.equity_id = m.get('equity_id')
        if m.get('opt_tenant_id') is not None:
            self.opt_tenant_id = m.get('opt_tenant_id')
        if m.get('origin_tx_id') is not None:
            self.origin_tx_id = m.get('origin_tx_id')
        return self


class QueryEquityInstructionResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        instruction: EInstruction = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 商品兑换流水信息
        self.instruction = instruction

    def validate(self):
        if self.instruction:
            self.instruction.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.instruction is not None:
            result['instruction'] = self.instruction.to_map()
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('instruction') is not None:
            temp_model = EInstruction()
            self.instruction = temp_model.from_map(m['instruction'])
        return self


class QueryImageRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        urls: List[str] = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 要查询的图片数组，填入不可访问的url
        self.urls = urls

    def validate(self):
        self.validate_required(self.urls, 'urls')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.urls is not None:
            result['urls'] = self.urls
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('urls') is not None:
            self.urls = m.get('urls')
        return self


class QueryImageResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        urls: List[MultiURL] = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 临时可访问的oss图片链接，每张图片会返回四个url，对应原图和不同的比例缩小，每一张图片的四个url用;隔开。
        self.urls = urls

    def validate(self):
        if self.urls:
            for k in self.urls:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        result['urls'] = []
        if self.urls is not None:
            for k in self.urls:
                result['urls'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        self.urls = []
        if m.get('urls') is not None:
            for k in m.get('urls'):
                temp_model = MultiURL()
                self.urls.append(temp_model.from_map(k))
        return self


class UpdateEquityStatusRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        delegated_tenant_id: str = None,
        equity_id: str = None,
        out_tx_id: str = None,
        status: int = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 要代理操作的租户ID
        self.delegated_tenant_id = delegated_tenant_id
        # 权益商品ID
        self.equity_id = equity_id
        # 外部交易ID
        self.out_tx_id = out_tx_id
        # 权益状态：0可用，1下线，2冻结
        self.status = status

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.equity_id, 'equity_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')
        self.validate_required(self.status, 'status')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.delegated_tenant_id is not None:
            result['delegated_tenant_id'] = self.delegated_tenant_id
        if self.equity_id is not None:
            result['equity_id'] = self.equity_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        if self.status is not None:
            result['status'] = self.status
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('delegated_tenant_id') is not None:
            self.delegated_tenant_id = m.get('delegated_tenant_id')
        if m.get('equity_id') is not None:
            self.equity_id = m.get('equity_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        if m.get('status') is not None:
            self.status = m.get('status')
        return self


class UpdateEquityStatusResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class SetMerchantProvisionRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        credit_max_amount: str = None,
        credit_used_amount: str = None,
        currency: str = None,
        debit_amount: str = None,
        opt_tenant_id: str = None,
        original_credit_max_amount: str = None,
        original_credit_used_amount: str = None,
        original_debit_amount: str = None,
        out_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 新的授信上限（单位：元）
        self.credit_max_amount = credit_max_amount
        # 新的授信已使用数额（单位：元）
        self.credit_used_amount = credit_used_amount
        # 币种
        self.currency = currency
        # 新的备付金余额（单位：元）
        self.debit_amount = debit_amount
        # 要设置备付金的商户租户ID
        self.opt_tenant_id = opt_tenant_id
        # 初始的授信上限（单位：元）
        self.original_credit_max_amount = original_credit_max_amount
        # 初始的授信已使用数额（单位：元）
        self.original_credit_used_amount = original_credit_used_amount
        # 初始的备付金余额（单位：元）
        self.original_debit_amount = original_debit_amount
        # 外部交易ID（确保幂等）
        self.out_tx_id = out_tx_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.currency, 'currency')
        self.validate_required(self.opt_tenant_id, 'opt_tenant_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.credit_max_amount is not None:
            result['credit_max_amount'] = self.credit_max_amount
        if self.credit_used_amount is not None:
            result['credit_used_amount'] = self.credit_used_amount
        if self.currency is not None:
            result['currency'] = self.currency
        if self.debit_amount is not None:
            result['debit_amount'] = self.debit_amount
        if self.opt_tenant_id is not None:
            result['opt_tenant_id'] = self.opt_tenant_id
        if self.original_credit_max_amount is not None:
            result['original_credit_max_amount'] = self.original_credit_max_amount
        if self.original_credit_used_amount is not None:
            result['original_credit_used_amount'] = self.original_credit_used_amount
        if self.original_debit_amount is not None:
            result['original_debit_amount'] = self.original_debit_amount
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('credit_max_amount') is not None:
            self.credit_max_amount = m.get('credit_max_amount')
        if m.get('credit_used_amount') is not None:
            self.credit_used_amount = m.get('credit_used_amount')
        if m.get('currency') is not None:
            self.currency = m.get('currency')
        if m.get('debit_amount') is not None:
            self.debit_amount = m.get('debit_amount')
        if m.get('opt_tenant_id') is not None:
            self.opt_tenant_id = m.get('opt_tenant_id')
        if m.get('original_credit_max_amount') is not None:
            self.original_credit_max_amount = m.get('original_credit_max_amount')
        if m.get('original_credit_used_amount') is not None:
            self.original_credit_used_amount = m.get('original_credit_used_amount')
        if m.get('original_debit_amount') is not None:
            self.original_debit_amount = m.get('original_debit_amount')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        return self


class SetMerchantProvisionResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class UpdateMerchantProvisionRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        credit_max_amount: str = None,
        credit_used_amount: str = None,
        currency: str = None,
        debit_amount: str = None,
        opt_tenant_id: str = None,
        opt_type: str = None,
        out_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 更新授信上限
        self.credit_max_amount = credit_max_amount
        # 更新授信已使用数额
        self.credit_used_amount = credit_used_amount
        # 币种
        self.currency = currency
        # 更新余额
        self.debit_amount = debit_amount
        # 要设置备付金的商户租户ID
        self.opt_tenant_id = opt_tenant_id
        # 操作类型，ADD表示增加，SUB表示减少
        self.opt_type = opt_type
        # 外部交易ID
        self.out_tx_id = out_tx_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.currency, 'currency')
        self.validate_required(self.opt_tenant_id, 'opt_tenant_id')
        self.validate_required(self.opt_type, 'opt_type')
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.credit_max_amount is not None:
            result['credit_max_amount'] = self.credit_max_amount
        if self.credit_used_amount is not None:
            result['credit_used_amount'] = self.credit_used_amount
        if self.currency is not None:
            result['currency'] = self.currency
        if self.debit_amount is not None:
            result['debit_amount'] = self.debit_amount
        if self.opt_tenant_id is not None:
            result['opt_tenant_id'] = self.opt_tenant_id
        if self.opt_type is not None:
            result['opt_type'] = self.opt_type
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('credit_max_amount') is not None:
            self.credit_max_amount = m.get('credit_max_amount')
        if m.get('credit_used_amount') is not None:
            self.credit_used_amount = m.get('credit_used_amount')
        if m.get('currency') is not None:
            self.currency = m.get('currency')
        if m.get('debit_amount') is not None:
            self.debit_amount = m.get('debit_amount')
        if m.get('opt_tenant_id') is not None:
            self.opt_tenant_id = m.get('opt_tenant_id')
        if m.get('opt_type') is not None:
            self.opt_type = m.get('opt_type')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        return self


class UpdateMerchantProvisionResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class ExecEquityInstructionwriteoffRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        equity_id: str = None,
        memo: str = None,
        origin_tx_id: str = None,
        out_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 权益商品ID
        self.equity_id = equity_id
        # 附言
        self.memo = memo
        # 兑换交易ID
        self.origin_tx_id = origin_tx_id
        # 外部交易ID
        self.out_tx_id = out_tx_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.equity_id, 'equity_id')
        self.validate_required(self.origin_tx_id, 'origin_tx_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.equity_id is not None:
            result['equity_id'] = self.equity_id
        if self.memo is not None:
            result['memo'] = self.memo
        if self.origin_tx_id is not None:
            result['origin_tx_id'] = self.origin_tx_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('equity_id') is not None:
            self.equity_id = m.get('equity_id')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('origin_tx_id') is not None:
            self.origin_tx_id = m.get('origin_tx_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        return self


class ExecEquityInstructionwriteoffResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class QueryMerchantProvisionsRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        business_action: str = None,
        opt_tenant_id: str = None,
        product_code: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 行为
        self.business_action = business_action
        # 要查询的租户ID
        self.opt_tenant_id = opt_tenant_id
        # 产品编码
        self.product_code = product_code

    def validate(self):
        self.validate_required(self.business_action, 'business_action')
        self.validate_required(self.opt_tenant_id, 'opt_tenant_id')
        self.validate_required(self.product_code, 'product_code')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.business_action is not None:
            result['business_action'] = self.business_action
        if self.opt_tenant_id is not None:
            result['opt_tenant_id'] = self.opt_tenant_id
        if self.product_code is not None:
            result['product_code'] = self.product_code
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('business_action') is not None:
            self.business_action = m.get('business_action')
        if m.get('opt_tenant_id') is not None:
            self.opt_tenant_id = m.get('opt_tenant_id')
        if m.get('product_code') is not None:
            self.product_code = m.get('product_code')
        return self


class QueryMerchantProvisionsResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        discrete_values: List[DiscreteValue] = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 租户的备付金列表信息
        self.discrete_values = discrete_values

    def validate(self):
        if self.discrete_values:
            for k in self.discrete_values:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        result['discrete_values'] = []
        if self.discrete_values is not None:
            for k in self.discrete_values:
                result['discrete_values'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        self.discrete_values = []
        if m.get('discrete_values') is not None:
            for k in m.get('discrete_values'):
                temp_model = DiscreteValue()
                self.discrete_values.append(temp_model.from_map(k))
        return self


class QueryMerchantExchangeableequitylistRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        page_number: str = None,
        page_size: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 页码
        self.page_number = page_number
        # 每页数量（不填默认返回50条数据）
        self.page_size = page_size

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.page_number, 'page_number')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.page_number is not None:
            result['page_number'] = self.page_number
        if self.page_size is not None:
            result['page_size'] = self.page_size
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('page_number') is not None:
            self.page_number = m.get('page_number')
        if m.get('page_size') is not None:
            self.page_size = m.get('page_size')
        return self


class QueryMerchantExchangeableequitylistResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        object: ExchangeableEquityList = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 可兑换商品信息列表
        self.object = object

    def validate(self):
        if self.object:
            self.object.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.object is not None:
            result['object'] = self.object.to_map()
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('object') is not None:
            temp_model = ExchangeableEquityList()
            self.object = temp_model.from_map(m['object'])
        return self


class QueryMerchantExchangeableequitydetailRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        sku_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 商品SKUID
        self.sku_id = sku_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.sku_id, 'sku_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.sku_id is not None:
            result['sku_id'] = self.sku_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('sku_id') is not None:
            self.sku_id = m.get('sku_id')
        return self


class QueryMerchantExchangeableequitydetailResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        equity: EquityDetail = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 可兑换的商品详情信息
        self.equity = equity

    def validate(self):
        if self.equity:
            self.equity.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.equity is not None:
            result['equity'] = self.equity.to_map()
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('equity') is not None:
            temp_model = EquityDetail()
            self.equity = temp_model.from_map(m['equity'])
        return self


class ExecAssetCreateRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        asset_id: str = None,
        asset_name: str = None,
        chain_id: str = None,
        currency: str = None,
        opt_tenant_id: str = None,
        out_tx_id: str = None,
        rate: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 资产ID
        self.asset_id = asset_id
        # 资产名称
        self.asset_name = asset_name
        # 链ID
        self.chain_id = chain_id
        # 资产绑定币种
        self.currency = currency
        # 为该租户创建新资产
        self.opt_tenant_id = opt_tenant_id
        # 外部交易ID
        self.out_tx_id = out_tx_id
        # 资产汇率(等值一元钱的数量)
        self.rate = rate

    def validate(self):
        self.validate_required(self.asset_id, 'asset_id')
        self.validate_required(self.asset_name, 'asset_name')
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.currency, 'currency')
        self.validate_required(self.opt_tenant_id, 'opt_tenant_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')
        self.validate_required(self.rate, 'rate')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.asset_id is not None:
            result['asset_id'] = self.asset_id
        if self.asset_name is not None:
            result['asset_name'] = self.asset_name
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.currency is not None:
            result['currency'] = self.currency
        if self.opt_tenant_id is not None:
            result['opt_tenant_id'] = self.opt_tenant_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        if self.rate is not None:
            result['rate'] = self.rate
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('asset_id') is not None:
            self.asset_id = m.get('asset_id')
        if m.get('asset_name') is not None:
            self.asset_name = m.get('asset_name')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('currency') is not None:
            self.currency = m.get('currency')
        if m.get('opt_tenant_id') is not None:
            self.opt_tenant_id = m.get('opt_tenant_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        if m.get('rate') is not None:
            self.rate = m.get('rate')
        return self


class ExecAssetCreateResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class ExecAssetGenerateRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        amount: str = None,
        asset_id: str = None,
        chain_id: str = None,
        out_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 铸币数量
        self.amount = amount
        # 资产ID
        self.asset_id = asset_id
        # 链ID
        self.chain_id = chain_id
        # 外部交易ID
        self.out_tx_id = out_tx_id

    def validate(self):
        self.validate_required(self.amount, 'amount')
        self.validate_required(self.asset_id, 'asset_id')
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.amount is not None:
            result['amount'] = self.amount
        if self.asset_id is not None:
            result['asset_id'] = self.asset_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('amount') is not None:
            self.amount = m.get('amount')
        if m.get('asset_id') is not None:
            self.asset_id = m.get('asset_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        return self


class ExecAssetGenerateResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class CreateMerchantRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        description: str = None,
        fund_manager_tenant_id: str = None,
        if_asset_issuer: bool = None,
        if_equity_consumer: bool = None,
        if_equity_provider: bool = None,
        opt_tenant_id: str = None,
        out_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 商户描述，不超过2048
        self.description = description
        # 商户的资金管理员 归属的租户ID
        self.fund_manager_tenant_id = fund_manager_tenant_id
        # 商户角色，是否是资产发行商
        self.if_asset_issuer = if_asset_issuer
        # 商户角色，是否是采购商
        self.if_equity_consumer = if_equity_consumer
        # 商户角色，是否是供应商
        self.if_equity_provider = if_equity_provider
        # 商户归属的租户ID
        self.opt_tenant_id = opt_tenant_id
        # 外部交易ID（确保幂等）
        self.out_tx_id = out_tx_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.fund_manager_tenant_id, 'fund_manager_tenant_id')
        self.validate_required(self.if_asset_issuer, 'if_asset_issuer')
        self.validate_required(self.if_equity_consumer, 'if_equity_consumer')
        self.validate_required(self.if_equity_provider, 'if_equity_provider')
        self.validate_required(self.opt_tenant_id, 'opt_tenant_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.description is not None:
            result['description'] = self.description
        if self.fund_manager_tenant_id is not None:
            result['fund_manager_tenant_id'] = self.fund_manager_tenant_id
        if self.if_asset_issuer is not None:
            result['if_asset_issuer'] = self.if_asset_issuer
        if self.if_equity_consumer is not None:
            result['if_equity_consumer'] = self.if_equity_consumer
        if self.if_equity_provider is not None:
            result['if_equity_provider'] = self.if_equity_provider
        if self.opt_tenant_id is not None:
            result['opt_tenant_id'] = self.opt_tenant_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('description') is not None:
            self.description = m.get('description')
        if m.get('fund_manager_tenant_id') is not None:
            self.fund_manager_tenant_id = m.get('fund_manager_tenant_id')
        if m.get('if_asset_issuer') is not None:
            self.if_asset_issuer = m.get('if_asset_issuer')
        if m.get('if_equity_consumer') is not None:
            self.if_equity_consumer = m.get('if_equity_consumer')
        if m.get('if_equity_provider') is not None:
            self.if_equity_provider = m.get('if_equity_provider')
        if m.get('opt_tenant_id') is not None:
            self.opt_tenant_id = m.get('opt_tenant_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        return self


class CreateMerchantResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class SetMerchantFundmanagerRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        out_tx_id: str = None,
        chain_id: str = None,
        opt_tenant_id: str = None,
        fund_manager_tenant_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 外部交易ID
        self.out_tx_id = out_tx_id
        # 链ID
        self.chain_id = chain_id
        # 要进行资金管理员设置的租户ID
        self.opt_tenant_id = opt_tenant_id
        # 资金管理员所属的租户ID
        self.fund_manager_tenant_id = fund_manager_tenant_id

    def validate(self):
        self.validate_required(self.out_tx_id, 'out_tx_id')
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.opt_tenant_id, 'opt_tenant_id')
        self.validate_required(self.fund_manager_tenant_id, 'fund_manager_tenant_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.opt_tenant_id is not None:
            result['opt_tenant_id'] = self.opt_tenant_id
        if self.fund_manager_tenant_id is not None:
            result['fund_manager_tenant_id'] = self.fund_manager_tenant_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('opt_tenant_id') is not None:
            self.opt_tenant_id = m.get('opt_tenant_id')
        if m.get('fund_manager_tenant_id') is not None:
            self.fund_manager_tenant_id = m.get('fund_manager_tenant_id')
        return self


class SetMerchantFundmanagerResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class CreateMerchantProvisionRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        out_tx_id: str = None,
        chain_id: str = None,
        opt_tenant_id: str = None,
        currency: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 外部交易ID，确保幂等
        self.out_tx_id = out_tx_id
        # 链ID
        self.chain_id = chain_id
        # 要创建备付金账户的租户ID
        self.opt_tenant_id = opt_tenant_id
        # 备付金账户币种
        self.currency = currency

    def validate(self):
        self.validate_required(self.out_tx_id, 'out_tx_id')
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.opt_tenant_id, 'opt_tenant_id')
        self.validate_required(self.currency, 'currency')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.opt_tenant_id is not None:
            result['opt_tenant_id'] = self.opt_tenant_id
        if self.currency is not None:
            result['currency'] = self.currency
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('opt_tenant_id') is not None:
            self.opt_tenant_id = m.get('opt_tenant_id')
        if m.get('currency') is not None:
            self.currency = m.get('currency')
        return self


class CreateMerchantProvisionResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class QueryConfigDelegaterelationRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        delegated_tenant_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 被代理的租户ID
        self.delegated_tenant_id = delegated_tenant_id

    def validate(self):
        self.validate_required(self.delegated_tenant_id, 'delegated_tenant_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.delegated_tenant_id is not None:
            result['delegated_tenant_id'] = self.delegated_tenant_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('delegated_tenant_id') is not None:
            self.delegated_tenant_id = m.get('delegated_tenant_id')
        return self


class QueryConfigDelegaterelationResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        delegate_relation_infos: List[DelegateRelationInfo] = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 代理授权关系信息
        self.delegate_relation_infos = delegate_relation_infos

    def validate(self):
        if self.delegate_relation_infos:
            for k in self.delegate_relation_infos:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        result['delegate_relation_infos'] = []
        if self.delegate_relation_infos is not None:
            for k in self.delegate_relation_infos:
                result['delegate_relation_infos'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        self.delegate_relation_infos = []
        if m.get('delegate_relation_infos') is not None:
            for k in m.get('delegate_relation_infos'):
                temp_model = DelegateRelationInfo()
                self.delegate_relation_infos.append(temp_model.from_map(k))
        return self


class UpdateConfigDelegaterelationRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        delegated_tenant_id: str = None,
        opt_tenant_id: str = None,
        opt_type: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 被代理的租户ID
        self.delegated_tenant_id = delegated_tenant_id
        # 代理租户ID
        self.opt_tenant_id = opt_tenant_id
        # 操作类型，ADD表示添加，SUB表示撤销
        self.opt_type = opt_type

    def validate(self):
        self.validate_required(self.delegated_tenant_id, 'delegated_tenant_id')
        self.validate_required(self.opt_tenant_id, 'opt_tenant_id')
        self.validate_required(self.opt_type, 'opt_type')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.delegated_tenant_id is not None:
            result['delegated_tenant_id'] = self.delegated_tenant_id
        if self.opt_tenant_id is not None:
            result['opt_tenant_id'] = self.opt_tenant_id
        if self.opt_type is not None:
            result['opt_type'] = self.opt_type
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('delegated_tenant_id') is not None:
            self.delegated_tenant_id = m.get('delegated_tenant_id')
        if m.get('opt_tenant_id') is not None:
            self.opt_tenant_id = m.get('opt_tenant_id')
        if m.get('opt_type') is not None:
            self.opt_type = m.get('opt_type')
        return self


class UpdateConfigDelegaterelationResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class QueryConfigWhitelistRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        tenant_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 查询链的白名单信息
        self.chain_id = chain_id
        # 查询该租户的白名单信息
        self.tenant_id = tenant_id

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.tenant_id is not None:
            result['tenant_id'] = self.tenant_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('tenant_id') is not None:
            self.tenant_id = m.get('tenant_id')
        return self


class QueryConfigWhitelistResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        white_list: List[APIWhiteListInfo] = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 接口白名单信息
        self.white_list = white_list

    def validate(self):
        if self.white_list:
            for k in self.white_list:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        result['white_list'] = []
        if self.white_list is not None:
            for k in self.white_list:
                result['white_list'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        self.white_list = []
        if m.get('white_list') is not None:
            for k in m.get('white_list'):
                temp_model = APIWhiteListInfo()
                self.white_list.append(temp_model.from_map(k))
        return self


class UpdateConfigWhitelistRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        opt_tenant_id: str = None,
        opt_type: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 租户ID
        self.opt_tenant_id = opt_tenant_id
        # 操作类型
        self.opt_type = opt_type

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.opt_tenant_id, 'opt_tenant_id')
        self.validate_required(self.opt_type, 'opt_type')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.opt_tenant_id is not None:
            result['opt_tenant_id'] = self.opt_tenant_id
        if self.opt_type is not None:
            result['opt_type'] = self.opt_type
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('opt_tenant_id') is not None:
            self.opt_tenant_id = m.get('opt_tenant_id')
        if m.get('opt_type') is not None:
            self.opt_type = m.get('opt_type')
        return self


class UpdateConfigWhitelistResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class ApplyExchangeAftersaleRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        equity_id: str = None,
        memo: str = None,
        origin_tx_id: str = None,
        out_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链id
        self.chain_id = chain_id
        # 权益商品id
        self.equity_id = equity_id
        # 额外信息 可选
        self.memo = memo
        # 原始订单交易ID。由采购商在创建对换单时传入，不可更新。
        self.origin_tx_id = origin_tx_id
        # 外部交易ID
        self.out_tx_id = out_tx_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.equity_id, 'equity_id')
        self.validate_required(self.origin_tx_id, 'origin_tx_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.equity_id is not None:
            result['equity_id'] = self.equity_id
        if self.memo is not None:
            result['memo'] = self.memo
        if self.origin_tx_id is not None:
            result['origin_tx_id'] = self.origin_tx_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('equity_id') is not None:
            self.equity_id = m.get('equity_id')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('origin_tx_id') is not None:
            self.origin_tx_id = m.get('origin_tx_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        return self


class ApplyExchangeAftersaleResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class ExecExchangeAgreeaftersaleRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        delegated_tenant_id: str = None,
        equity_id: str = None,
        memo: str = None,
        origin_tx_id: str = None,
        out_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链id
        self.chain_id = chain_id
        # 要代理操作的租户ID
        self.delegated_tenant_id = delegated_tenant_id
        # 权益id
        self.equity_id = equity_id
        # 额外信息
        self.memo = memo
        # 原始订单交易ID。由采购商在创建对换单时传入，不可更新。
        self.origin_tx_id = origin_tx_id
        # 外部交易ID
        self.out_tx_id = out_tx_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.equity_id, 'equity_id')
        self.validate_required(self.origin_tx_id, 'origin_tx_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.delegated_tenant_id is not None:
            result['delegated_tenant_id'] = self.delegated_tenant_id
        if self.equity_id is not None:
            result['equity_id'] = self.equity_id
        if self.memo is not None:
            result['memo'] = self.memo
        if self.origin_tx_id is not None:
            result['origin_tx_id'] = self.origin_tx_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('delegated_tenant_id') is not None:
            self.delegated_tenant_id = m.get('delegated_tenant_id')
        if m.get('equity_id') is not None:
            self.equity_id = m.get('equity_id')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('origin_tx_id') is not None:
            self.origin_tx_id = m.get('origin_tx_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        return self


class ExecExchangeAgreeaftersaleResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class RefuseExchangeAftersaleRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        delegated_tenant_id: str = None,
        equity_id: str = None,
        memo: str = None,
        origin_tx_id: str = None,
        out_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # l链id
        self.chain_id = chain_id
        # 要代理操作的租户ID
        self.delegated_tenant_id = delegated_tenant_id
        # 商品id
        self.equity_id = equity_id
        # 额外信息
        self.memo = memo
        # 原始订单交易ID。由采购商在创建对换单时传入，不可更新。
        self.origin_tx_id = origin_tx_id
        # 外部交易id
        self.out_tx_id = out_tx_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.equity_id, 'equity_id')
        self.validate_required(self.origin_tx_id, 'origin_tx_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.delegated_tenant_id is not None:
            result['delegated_tenant_id'] = self.delegated_tenant_id
        if self.equity_id is not None:
            result['equity_id'] = self.equity_id
        if self.memo is not None:
            result['memo'] = self.memo
        if self.origin_tx_id is not None:
            result['origin_tx_id'] = self.origin_tx_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('delegated_tenant_id') is not None:
            self.delegated_tenant_id = m.get('delegated_tenant_id')
        if m.get('equity_id') is not None:
            self.equity_id = m.get('equity_id')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('origin_tx_id') is not None:
            self.origin_tx_id = m.get('origin_tx_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        return self


class RefuseExchangeAftersaleResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class SendExchangeAftersaleRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        delegated_tenant_id: str = None,
        equity_id: str = None,
        memo: str = None,
        origin_tx_id: str = None,
        out_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链id
        self.chain_id = chain_id
        # 要代理操作的租户ID
        self.delegated_tenant_id = delegated_tenant_id
        # 商品id
        self.equity_id = equity_id
        # 发货商品的信息，敏感信息需加密，使用收货方公钥加密的权益信息。实际数据结构根据商品类型和描述输入，可参考https://tech.antfin.com/docs/2/163896。比如在手机直充时可以返回 {  "voucher": "充值凭证，如有",  "memo": ""}信息。
        self.memo = memo
        # 原始订单交易ID。由采购商在创建对换单时传入，不可更新。
        self.origin_tx_id = origin_tx_id
        # 外部交易id
        self.out_tx_id = out_tx_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.equity_id, 'equity_id')
        self.validate_required(self.origin_tx_id, 'origin_tx_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.delegated_tenant_id is not None:
            result['delegated_tenant_id'] = self.delegated_tenant_id
        if self.equity_id is not None:
            result['equity_id'] = self.equity_id
        if self.memo is not None:
            result['memo'] = self.memo
        if self.origin_tx_id is not None:
            result['origin_tx_id'] = self.origin_tx_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('delegated_tenant_id') is not None:
            self.delegated_tenant_id = m.get('delegated_tenant_id')
        if m.get('equity_id') is not None:
            self.equity_id = m.get('equity_id')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('origin_tx_id') is not None:
            self.origin_tx_id = m.get('origin_tx_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        return self


class SendExchangeAftersaleResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class ConfirmExchangeAftersaleRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        equity_id: str = None,
        memo: str = None,
        origin_tx_id: str = None,
        out_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链id
        self.chain_id = chain_id
        # 商品id
        self.equity_id = equity_id
        # 收货时的信息，若敏感信息需加密。实际数据结构根据商品类型和描述输入，可参考https://tech.antfin.com/docs/2/163896
        self.memo = memo
        # 原始订单交易ID。由采购商在创建对换单时传入，不可更新。
        self.origin_tx_id = origin_tx_id
        # 外部交易id
        self.out_tx_id = out_tx_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.equity_id, 'equity_id')
        self.validate_required(self.origin_tx_id, 'origin_tx_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.equity_id is not None:
            result['equity_id'] = self.equity_id
        if self.memo is not None:
            result['memo'] = self.memo
        if self.origin_tx_id is not None:
            result['origin_tx_id'] = self.origin_tx_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('equity_id') is not None:
            self.equity_id = m.get('equity_id')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('origin_tx_id') is not None:
            self.origin_tx_id = m.get('origin_tx_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        return self


class ConfirmExchangeAftersaleResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class ExecDataDepositRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        tx: Transaction = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 交易信息
        self.tx = tx

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.tx, 'tx')
        if self.tx:
            self.tx.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.tx is not None:
            result['tx'] = self.tx.to_map()
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('tx') is not None:
            temp_model = Transaction()
            self.tx = temp_model.from_map(m['tx'])
        return self


class ExecDataDepositResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        tx_hash: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 存证交易哈希
        self.tx_hash = tx_hash

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.tx_hash is not None:
            result['tx_hash'] = self.tx_hash
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('tx_hash') is not None:
            self.tx_hash = m.get('tx_hash')
        return self


class SetCommissionRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        commissions: List[Commission] = None,
        equity_type: int = None,
        if_global: bool = None,
        opt_tenant_id: str = None,
        out_tx_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 手续费列表，可传入多个
        self.commissions = commissions
        # 商品类型。可按照如下文档查询商品对应的类型，及数据格式 https://tech.antfin.com/docs/2/163896
        self.equity_type = equity_type
        # 是否设置全局手续费。若是false，需传入optTenantId
        self.if_global = if_global
        # 要设置手续费的租户对象，如果为空表示设置全局手续费（IfGlobal需设置为true）
        self.opt_tenant_id = opt_tenant_id
        # 交易幂等ID
        self.out_tx_id = out_tx_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.commissions, 'commissions')
        if self.commissions:
            for k in self.commissions:
                if k:
                    k.validate()
        self.validate_required(self.equity_type, 'equity_type')
        self.validate_required(self.out_tx_id, 'out_tx_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        result['commissions'] = []
        if self.commissions is not None:
            for k in self.commissions:
                result['commissions'].append(k.to_map() if k else None)
        if self.equity_type is not None:
            result['equity_type'] = self.equity_type
        if self.if_global is not None:
            result['if_global'] = self.if_global
        if self.opt_tenant_id is not None:
            result['opt_tenant_id'] = self.opt_tenant_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        self.commissions = []
        if m.get('commissions') is not None:
            for k in m.get('commissions'):
                temp_model = Commission()
                self.commissions.append(temp_model.from_map(k))
        if m.get('equity_type') is not None:
            self.equity_type = m.get('equity_type')
        if m.get('if_global') is not None:
            self.if_global = m.get('if_global')
        if m.get('opt_tenant_id') is not None:
            self.opt_tenant_id = m.get('opt_tenant_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        return self


class SetCommissionResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        commission_id: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 手续费ID
        self.commission_id = commission_id

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.commission_id is not None:
            result['commission_id'] = self.commission_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('commission_id') is not None:
            self.commission_id = m.get('commission_id')
        return self


class QueryCommissionRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        equity_type: int = None,
        if_current: bool = None,
        if_global: bool = None,
        delegated_tenant_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 商品类型。可按照如下文档查询商品对应的类型，及数据格式https://tech.antfin.com/docs/2/163896
        self.equity_type = equity_type
        # 是否查询当前生效的手续费信息。如为false，则查询该商品的全部手续费信息
        self.if_current = if_current
        # 是否查询全局的手续费信息
        self.if_global = if_global
        # 查询该租户的手续费信息
        self.delegated_tenant_id = delegated_tenant_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.equity_type, 'equity_type')
        self.validate_required(self.if_current, 'if_current')
        self.validate_required(self.if_global, 'if_global')
        self.validate_required(self.delegated_tenant_id, 'delegated_tenant_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.equity_type is not None:
            result['equity_type'] = self.equity_type
        if self.if_current is not None:
            result['if_current'] = self.if_current
        if self.if_global is not None:
            result['if_global'] = self.if_global
        if self.delegated_tenant_id is not None:
            result['delegated_tenant_id'] = self.delegated_tenant_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('equity_type') is not None:
            self.equity_type = m.get('equity_type')
        if m.get('if_current') is not None:
            self.if_current = m.get('if_current')
        if m.get('if_global') is not None:
            self.if_global = m.get('if_global')
        if m.get('delegated_tenant_id') is not None:
            self.delegated_tenant_id = m.get('delegated_tenant_id')
        return self


class QueryCommissionResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        commissions: List[CommissionResult] = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 手续费信息列表
        self.commissions = commissions

    def validate(self):
        if self.commissions:
            for k in self.commissions:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        result['commissions'] = []
        if self.commissions is not None:
            for k in self.commissions:
                result['commissions'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        self.commissions = []
        if m.get('commissions') is not None:
            for k in m.get('commissions'):
                temp_model = CommissionResult()
                self.commissions.append(temp_model.from_map(k))
        return self


class SetCommissionMerchantRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        opt_tenant_id: str = None,
        out_tx_id: str = None,
        chain_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 收取手续费的商户对应的租户ID
        self.opt_tenant_id = opt_tenant_id
        # 交易幂等ID
        self.out_tx_id = out_tx_id
        # 链ID
        self.chain_id = chain_id

    def validate(self):
        self.validate_required(self.opt_tenant_id, 'opt_tenant_id')
        self.validate_required(self.out_tx_id, 'out_tx_id')
        self.validate_required(self.chain_id, 'chain_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.opt_tenant_id is not None:
            result['opt_tenant_id'] = self.opt_tenant_id
        if self.out_tx_id is not None:
            result['out_tx_id'] = self.out_tx_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('opt_tenant_id') is not None:
            self.opt_tenant_id = m.get('opt_tenant_id')
        if m.get('out_tx_id') is not None:
            self.out_tx_id = m.get('out_tx_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        return self


class SetCommissionMerchantResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class QueryCommissionMerchantRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        return self


class QueryCommissionMerchantResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        tenant_id: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 收取手续费的商户 租户ID
        self.tenant_id = tenant_id

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.tenant_id is not None:
            result['tenant_id'] = self.tenant_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('tenant_id') is not None:
            self.tenant_id = m.get('tenant_id')
        return self


class CreateConfigChainaccountRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        opt_tenant_id: str = None,
        member: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 要创建的链上ID对应的租户ID
        self.opt_tenant_id = opt_tenant_id
        # 创建的角色，admin是商户管理员链上ID，fundmanager是资金管理员链上ID
        self.member = member

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.opt_tenant_id, 'opt_tenant_id')
        self.validate_required(self.member, 'member')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.opt_tenant_id is not None:
            result['opt_tenant_id'] = self.opt_tenant_id
        if self.member is not None:
            result['member'] = self.member
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('opt_tenant_id') is not None:
            self.opt_tenant_id = m.get('opt_tenant_id')
        if m.get('member') is not None:
            self.member = m.get('member')
        return self


class CreateConfigChainaccountResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        tenant_id: str = None,
        account_id: str = None,
        public_key: str = None,
        did: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 租户ID
        self.tenant_id = tenant_id
        # 链上ID
        self.account_id = account_id
        # 链上账户对应的账户公钥
        self.public_key = public_key
        # 分布式身份ID
        self.did = did

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.tenant_id is not None:
            result['tenant_id'] = self.tenant_id
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.public_key is not None:
            result['public_key'] = self.public_key
        if self.did is not None:
            result['did'] = self.did
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('tenant_id') is not None:
            self.tenant_id = m.get('tenant_id')
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('public_key') is not None:
            self.public_key = m.get('public_key')
        if m.get('did') is not None:
            self.did = m.get('did')
        return self


class StartIpPackagetradeRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        account_id: str = None,
        ip_id: str = None,
        only_call_blockchain: bool = None,
        price_range: str = None,
        amount: int = None,
        expected_total_price: str = None,
        auth_begin_time: int = None,
        auth_end_time: int = None,
        memo: str = None,
        additional_clause: str = None,
        auth_product_scope: str = None,
        auth_area_scope: str = None,
        sales_channel: str = None,
        goods_type: int = None,
        related_order_id: str = None,
        pay_return_url: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础请求参数
        self.base_request = base_request
        # 买方的链上账户Id
        self.account_id = account_id
        # IP授权交易时传入IP ID；增值服务交易时传入服务ID
        self.ip_id = ip_id
        # true 只上链不走真实支付，false 上链并链下真实支付账单
        self.only_call_blockchain = only_call_blockchain
        # 终端商品价格区间
        self.price_range = price_range
        # 套餐中包含终端商品数量
        self.amount = amount
        # 套餐交易应付金额，单位元，保留两位小数
        self.expected_total_price = expected_total_price
        # 授权合作开始期限（毫秒时间戳）
        self.auth_begin_time = auth_begin_time
        # 授权合作结束期限（毫秒时间戳）
        self.auth_end_time = auth_end_time
        # 备注信息
        self.memo = memo
        # 附加条款
        self.additional_clause = additional_clause
        # 授权产品范围
        self.auth_product_scope = auth_product_scope
        # 授权地域范围
        self.auth_area_scope = auth_area_scope
        # 商品销售渠道
        self.sales_channel = sales_channel
        # 0 IP交易，1 增值服务交易
        self.goods_type = goods_type
        # 增值服务交易绑定的ip授权交易订单，增值服务交易必填
        self.related_order_id = related_order_id
        # 支付完成后的回调地址。如果为空，默认跳转到https://ipforce.cloud.alipay.com/\
        self.pay_return_url = pay_return_url

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.ip_id, 'ip_id')
        self.validate_required(self.only_call_blockchain, 'only_call_blockchain')
        self.validate_required(self.price_range, 'price_range')
        self.validate_required(self.amount, 'amount')
        self.validate_required(self.expected_total_price, 'expected_total_price')
        self.validate_required(self.auth_begin_time, 'auth_begin_time')
        self.validate_required(self.auth_end_time, 'auth_end_time')
        self.validate_required(self.memo, 'memo')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.ip_id is not None:
            result['ip_id'] = self.ip_id
        if self.only_call_blockchain is not None:
            result['only_call_blockchain'] = self.only_call_blockchain
        if self.price_range is not None:
            result['price_range'] = self.price_range
        if self.amount is not None:
            result['amount'] = self.amount
        if self.expected_total_price is not None:
            result['expected_total_price'] = self.expected_total_price
        if self.auth_begin_time is not None:
            result['auth_begin_time'] = self.auth_begin_time
        if self.auth_end_time is not None:
            result['auth_end_time'] = self.auth_end_time
        if self.memo is not None:
            result['memo'] = self.memo
        if self.additional_clause is not None:
            result['additional_clause'] = self.additional_clause
        if self.auth_product_scope is not None:
            result['auth_product_scope'] = self.auth_product_scope
        if self.auth_area_scope is not None:
            result['auth_area_scope'] = self.auth_area_scope
        if self.sales_channel is not None:
            result['sales_channel'] = self.sales_channel
        if self.goods_type is not None:
            result['goods_type'] = self.goods_type
        if self.related_order_id is not None:
            result['related_order_id'] = self.related_order_id
        if self.pay_return_url is not None:
            result['pay_return_url'] = self.pay_return_url
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('ip_id') is not None:
            self.ip_id = m.get('ip_id')
        if m.get('only_call_blockchain') is not None:
            self.only_call_blockchain = m.get('only_call_blockchain')
        if m.get('price_range') is not None:
            self.price_range = m.get('price_range')
        if m.get('amount') is not None:
            self.amount = m.get('amount')
        if m.get('expected_total_price') is not None:
            self.expected_total_price = m.get('expected_total_price')
        if m.get('auth_begin_time') is not None:
            self.auth_begin_time = m.get('auth_begin_time')
        if m.get('auth_end_time') is not None:
            self.auth_end_time = m.get('auth_end_time')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('additional_clause') is not None:
            self.additional_clause = m.get('additional_clause')
        if m.get('auth_product_scope') is not None:
            self.auth_product_scope = m.get('auth_product_scope')
        if m.get('auth_area_scope') is not None:
            self.auth_area_scope = m.get('auth_area_scope')
        if m.get('sales_channel') is not None:
            self.sales_channel = m.get('sales_channel')
        if m.get('goods_type') is not None:
            self.goods_type = m.get('goods_type')
        if m.get('related_order_id') is not None:
            self.related_order_id = m.get('related_order_id')
        if m.get('pay_return_url') is not None:
            self.pay_return_url = m.get('pay_return_url')
        return self


class StartIpPackagetradeResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        ip_order_id: str = None,
        pay_url: str = None,
        ip_bill_id: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 订单ID
        self.ip_order_id = ip_order_id
        # 支付信息
        self.pay_url = pay_url
        # 账单ID
        self.ip_bill_id = ip_bill_id

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.ip_order_id is not None:
            result['ip_order_id'] = self.ip_order_id
        if self.pay_url is not None:
            result['pay_url'] = self.pay_url
        if self.ip_bill_id is not None:
            result['ip_bill_id'] = self.ip_bill_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('ip_order_id') is not None:
            self.ip_order_id = m.get('ip_order_id')
        if m.get('pay_url') is not None:
            self.pay_url = m.get('pay_url')
        if m.get('ip_bill_id') is not None:
            self.ip_bill_id = m.get('ip_bill_id')
        return self


class CancelIpPackagetradeRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        ip_order_id: str = None,
        account_id: str = None,
        memo: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 订单ID
        self.ip_order_id = ip_order_id
        # IP交易发起方的链上账户ID
        self.account_id = account_id
        # 备注信息
        self.memo = memo

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.ip_order_id, 'ip_order_id')
        self.validate_required(self.account_id, 'account_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.ip_order_id is not None:
            result['ip_order_id'] = self.ip_order_id
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.memo is not None:
            result['memo'] = self.memo
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('ip_order_id') is not None:
            self.ip_order_id = m.get('ip_order_id')
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        return self


class CancelIpPackagetradeResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class UploadIpPackagetradesalesRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        account_id: str = None,
        ip_order_id: str = None,
        ip_sales_info_list: List[IPSalesInfo] = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 买方的链上账户Id
        self.account_id = account_id
        # 关联订单ID
        self.ip_order_id = ip_order_id
        # 销售数据列表
        self.ip_sales_info_list = ip_sales_info_list

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.ip_order_id, 'ip_order_id')
        self.validate_required(self.ip_sales_info_list, 'ip_sales_info_list')
        if self.ip_sales_info_list:
            for k in self.ip_sales_info_list:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.ip_order_id is not None:
            result['ip_order_id'] = self.ip_order_id
        result['ip_sales_info_list'] = []
        if self.ip_sales_info_list is not None:
            for k in self.ip_sales_info_list:
                result['ip_sales_info_list'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('ip_order_id') is not None:
            self.ip_order_id = m.get('ip_order_id')
        self.ip_sales_info_list = []
        if m.get('ip_sales_info_list') is not None:
            for k in m.get('ip_sales_info_list'):
                temp_model = IPSalesInfo()
                self.ip_sales_info_list.append(temp_model.from_map(k))
        return self


class UploadIpPackagetradesalesResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class StartIpAuthtradeRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        account_id: str = None,
        ip_id: str = None,
        charge_type: int = None,
        auth_rate: str = None,
        auth_price: str = None,
        auth_begin_time: int = None,
        auth_end_time: int = None,
        contract: str = None,
        design_draft: str = None,
        auth_product_scope: str = None,
        auth_area_scope: str = None,
        sales_channel: str = None,
        memo: str = None,
        additional_clause: str = None,
        guaranteed: bool = None,
        guaranteed_fund: str = None,
        guaranteed_goods_amount: int = None,
        guaranteed_sales: str = None,
        goods_type: int = None,
        related_order_id: str = None,
        pay_return_url: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 采购者的链上账户Id
        self.account_id = account_id
        # IP授权交易时传入IP ID；增值服务交易时传入服务ID
        self.ip_id = ip_id
        # 收费模式：0 销售抽佣, 1 按量付费
        self.charge_type = charge_type
        # 授权计费比例
        self.auth_rate = auth_rate
        # 按量付费的收费单价（按量付费模式必填）
        self.auth_price = auth_price
        # 授权合作开始期限（毫秒时间戳）
        self.auth_begin_time = auth_begin_time
        # 授权合作结束期限（毫秒时间戳）
        self.auth_end_time = auth_end_time
        # 合同（文件URL）
        self.contract = contract
        # 设计稿（文件URL）
        self.design_draft = design_draft
        # 授权产品范围
        self.auth_product_scope = auth_product_scope
        # 授权地域范围
        self.auth_area_scope = auth_area_scope
        # 商品销售渠道
        self.sales_channel = sales_channel
        # 备注消息(不超过256个字符)
        self.memo = memo
        # 附加条款
        self.additional_clause = additional_clause
        # 是否有保底金
        self.guaranteed = guaranteed
        # 支付的保底金金额
        self.guaranteed_fund = guaranteed_fund
        # 保底商品个数（按量付费），订单销售数量超过保底部分需按量付费
        self.guaranteed_goods_amount = guaranteed_goods_amount
        # 保底商品销售金额（销售抽佣），订单销售额超过保底部分需按比例抽拥
        self.guaranteed_sales = guaranteed_sales
        # 0 IP交易，1 增值服务交易
        self.goods_type = goods_type
        # 增值服务交易绑定的ip授权交易订单，增值服务交易必填
        self.related_order_id = related_order_id
        # 支付完成后的回调地址。如果为空，默认跳转到https://ipforce.cloud.alipay.com/\
        self.pay_return_url = pay_return_url

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.ip_id, 'ip_id')
        self.validate_required(self.auth_begin_time, 'auth_begin_time')
        self.validate_required(self.auth_end_time, 'auth_end_time')
        self.validate_required(self.memo, 'memo')
        self.validate_required(self.guaranteed, 'guaranteed')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.ip_id is not None:
            result['ip_id'] = self.ip_id
        if self.charge_type is not None:
            result['charge_type'] = self.charge_type
        if self.auth_rate is not None:
            result['auth_rate'] = self.auth_rate
        if self.auth_price is not None:
            result['auth_price'] = self.auth_price
        if self.auth_begin_time is not None:
            result['auth_begin_time'] = self.auth_begin_time
        if self.auth_end_time is not None:
            result['auth_end_time'] = self.auth_end_time
        if self.contract is not None:
            result['contract'] = self.contract
        if self.design_draft is not None:
            result['design_draft'] = self.design_draft
        if self.auth_product_scope is not None:
            result['auth_product_scope'] = self.auth_product_scope
        if self.auth_area_scope is not None:
            result['auth_area_scope'] = self.auth_area_scope
        if self.sales_channel is not None:
            result['sales_channel'] = self.sales_channel
        if self.memo is not None:
            result['memo'] = self.memo
        if self.additional_clause is not None:
            result['additional_clause'] = self.additional_clause
        if self.guaranteed is not None:
            result['guaranteed'] = self.guaranteed
        if self.guaranteed_fund is not None:
            result['guaranteed_fund'] = self.guaranteed_fund
        if self.guaranteed_goods_amount is not None:
            result['guaranteed_goods_amount'] = self.guaranteed_goods_amount
        if self.guaranteed_sales is not None:
            result['guaranteed_sales'] = self.guaranteed_sales
        if self.goods_type is not None:
            result['goods_type'] = self.goods_type
        if self.related_order_id is not None:
            result['related_order_id'] = self.related_order_id
        if self.pay_return_url is not None:
            result['pay_return_url'] = self.pay_return_url
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('ip_id') is not None:
            self.ip_id = m.get('ip_id')
        if m.get('charge_type') is not None:
            self.charge_type = m.get('charge_type')
        if m.get('auth_rate') is not None:
            self.auth_rate = m.get('auth_rate')
        if m.get('auth_price') is not None:
            self.auth_price = m.get('auth_price')
        if m.get('auth_begin_time') is not None:
            self.auth_begin_time = m.get('auth_begin_time')
        if m.get('auth_end_time') is not None:
            self.auth_end_time = m.get('auth_end_time')
        if m.get('contract') is not None:
            self.contract = m.get('contract')
        if m.get('design_draft') is not None:
            self.design_draft = m.get('design_draft')
        if m.get('auth_product_scope') is not None:
            self.auth_product_scope = m.get('auth_product_scope')
        if m.get('auth_area_scope') is not None:
            self.auth_area_scope = m.get('auth_area_scope')
        if m.get('sales_channel') is not None:
            self.sales_channel = m.get('sales_channel')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('additional_clause') is not None:
            self.additional_clause = m.get('additional_clause')
        if m.get('guaranteed') is not None:
            self.guaranteed = m.get('guaranteed')
        if m.get('guaranteed_fund') is not None:
            self.guaranteed_fund = m.get('guaranteed_fund')
        if m.get('guaranteed_goods_amount') is not None:
            self.guaranteed_goods_amount = m.get('guaranteed_goods_amount')
        if m.get('guaranteed_sales') is not None:
            self.guaranteed_sales = m.get('guaranteed_sales')
        if m.get('goods_type') is not None:
            self.goods_type = m.get('goods_type')
        if m.get('related_order_id') is not None:
            self.related_order_id = m.get('related_order_id')
        if m.get('pay_return_url') is not None:
            self.pay_return_url = m.get('pay_return_url')
        return self


class StartIpAuthtradeResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        ip_order_id: str = None,
        pay_url: str = None,
        ip_bill_id: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 订单ID
        self.ip_order_id = ip_order_id
        # 保底金支付链接
        self.pay_url = pay_url
        # 保底金账单ID
        self.ip_bill_id = ip_bill_id

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.ip_order_id is not None:
            result['ip_order_id'] = self.ip_order_id
        if self.pay_url is not None:
            result['pay_url'] = self.pay_url
        if self.ip_bill_id is not None:
            result['ip_bill_id'] = self.ip_bill_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('ip_order_id') is not None:
            self.ip_order_id = m.get('ip_order_id')
        if m.get('pay_url') is not None:
            self.pay_url = m.get('pay_url')
        if m.get('ip_bill_id') is not None:
            self.ip_bill_id = m.get('ip_bill_id')
        return self


class UploadIpAuthtradesalesRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        account_id: str = None,
        ip_order_id: str = None,
        only_call_blockchain: bool = None,
        pay_return_url: str = None,
        auth_rate: str = None,
        auth_price: str = None,
        settlement_begin_time: int = None,
        settlement_end_time: int = None,
        price: str = None,
        amount: int = None,
        sales: str = None,
        payment: str = None,
        goods_name: str = None,
        goods_image: str = None,
        sales_channel: str = None,
        goods_url: str = None,
        goods_info: str = None,
        operator: str = None,
        memo: str = None,
        billing_type: int = None,
        goods_id: str = None,
        refund_sales: str = None,
        sales_ext_info: str = None,
        sales_user_info: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 上传记录的用户的链上账户Id
        self.account_id = account_id
        # 订单ID
        self.ip_order_id = ip_order_id
        # true 只上链不走真实支付，false 上链并链下真实支付账单
        self.only_call_blockchain = only_call_blockchain
        # 支付完成后的回调地址。如果为空，默认跳转到https://ipforce.cloud.alipay.com/\
        self.pay_return_url = pay_return_url
        # 授权佣金比例
        self.auth_rate = auth_rate
        # 定向授权按量付费单价
        self.auth_price = auth_price
        # 本次结算周期开始时间
        self.settlement_begin_time = settlement_begin_time
        # 本次结算周期结束时间
        self.settlement_end_time = settlement_end_time
        # 零售价
        self.price = price
        # 终端商品销售数量
        self.amount = amount
        # 销售金额
        self.sales = sales
        # 实付金额
        self.payment = payment
        # 终端商品名称
        self.goods_name = goods_name
        # 终端商品图片
        self.goods_image = goods_image
        # 终端销售渠道
        self.sales_channel = sales_channel
        # 终端商品链接
        self.goods_url = goods_url
        # 商品信息
        self.goods_info = goods_info
        # 数据上传操作者
        self.operator = operator
        # 备注信息
        self.memo = memo
        # 账单结算类型：即时计费0、按周计费1、按月计费2、按季度计费3。默认0
        self.billing_type = billing_type
        # 商品ID
        self.goods_id = goods_id
        # 退款的销售金额，有退款时填写，默认0
        self.refund_sales = refund_sales
        # 订单信息json string: 用户ID/订单状态/订单创建时间戳ms/订单支付时间戳ms等
        self.sales_ext_info = sales_ext_info
        # 用户信息json string: 姓名/手机号/地址等结构化数据
        self.sales_user_info = sales_user_info

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.ip_order_id, 'ip_order_id')
        self.validate_required(self.only_call_blockchain, 'only_call_blockchain')
        self.validate_required(self.settlement_begin_time, 'settlement_begin_time')
        self.validate_required(self.settlement_end_time, 'settlement_end_time')
        self.validate_required(self.price, 'price')
        self.validate_required(self.amount, 'amount')
        self.validate_required(self.sales, 'sales')
        self.validate_required(self.payment, 'payment')
        self.validate_required(self.goods_name, 'goods_name')
        self.validate_required(self.goods_info, 'goods_info')
        self.validate_required(self.operator, 'operator')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.ip_order_id is not None:
            result['ip_order_id'] = self.ip_order_id
        if self.only_call_blockchain is not None:
            result['only_call_blockchain'] = self.only_call_blockchain
        if self.pay_return_url is not None:
            result['pay_return_url'] = self.pay_return_url
        if self.auth_rate is not None:
            result['auth_rate'] = self.auth_rate
        if self.auth_price is not None:
            result['auth_price'] = self.auth_price
        if self.settlement_begin_time is not None:
            result['settlement_begin_time'] = self.settlement_begin_time
        if self.settlement_end_time is not None:
            result['settlement_end_time'] = self.settlement_end_time
        if self.price is not None:
            result['price'] = self.price
        if self.amount is not None:
            result['amount'] = self.amount
        if self.sales is not None:
            result['sales'] = self.sales
        if self.payment is not None:
            result['payment'] = self.payment
        if self.goods_name is not None:
            result['goods_name'] = self.goods_name
        if self.goods_image is not None:
            result['goods_image'] = self.goods_image
        if self.sales_channel is not None:
            result['sales_channel'] = self.sales_channel
        if self.goods_url is not None:
            result['goods_url'] = self.goods_url
        if self.goods_info is not None:
            result['goods_info'] = self.goods_info
        if self.operator is not None:
            result['operator'] = self.operator
        if self.memo is not None:
            result['memo'] = self.memo
        if self.billing_type is not None:
            result['billing_type'] = self.billing_type
        if self.goods_id is not None:
            result['goods_id'] = self.goods_id
        if self.refund_sales is not None:
            result['refund_sales'] = self.refund_sales
        if self.sales_ext_info is not None:
            result['sales_ext_info'] = self.sales_ext_info
        if self.sales_user_info is not None:
            result['sales_user_info'] = self.sales_user_info
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('ip_order_id') is not None:
            self.ip_order_id = m.get('ip_order_id')
        if m.get('only_call_blockchain') is not None:
            self.only_call_blockchain = m.get('only_call_blockchain')
        if m.get('pay_return_url') is not None:
            self.pay_return_url = m.get('pay_return_url')
        if m.get('auth_rate') is not None:
            self.auth_rate = m.get('auth_rate')
        if m.get('auth_price') is not None:
            self.auth_price = m.get('auth_price')
        if m.get('settlement_begin_time') is not None:
            self.settlement_begin_time = m.get('settlement_begin_time')
        if m.get('settlement_end_time') is not None:
            self.settlement_end_time = m.get('settlement_end_time')
        if m.get('price') is not None:
            self.price = m.get('price')
        if m.get('amount') is not None:
            self.amount = m.get('amount')
        if m.get('sales') is not None:
            self.sales = m.get('sales')
        if m.get('payment') is not None:
            self.payment = m.get('payment')
        if m.get('goods_name') is not None:
            self.goods_name = m.get('goods_name')
        if m.get('goods_image') is not None:
            self.goods_image = m.get('goods_image')
        if m.get('sales_channel') is not None:
            self.sales_channel = m.get('sales_channel')
        if m.get('goods_url') is not None:
            self.goods_url = m.get('goods_url')
        if m.get('goods_info') is not None:
            self.goods_info = m.get('goods_info')
        if m.get('operator') is not None:
            self.operator = m.get('operator')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('billing_type') is not None:
            self.billing_type = m.get('billing_type')
        if m.get('goods_id') is not None:
            self.goods_id = m.get('goods_id')
        if m.get('refund_sales') is not None:
            self.refund_sales = m.get('refund_sales')
        if m.get('sales_ext_info') is not None:
            self.sales_ext_info = m.get('sales_ext_info')
        if m.get('sales_user_info') is not None:
            self.sales_user_info = m.get('sales_user_info')
        return self


class UploadIpAuthtradesalesResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        pay_url: str = None,
        ip_bill_id: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 支付信息
        self.pay_url = pay_url
        # 账单ID
        self.ip_bill_id = ip_bill_id

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.pay_url is not None:
            result['pay_url'] = self.pay_url
        if self.ip_bill_id is not None:
            result['ip_bill_id'] = self.ip_bill_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('pay_url') is not None:
            self.pay_url = m.get('pay_url')
        if m.get('ip_bill_id') is not None:
            self.ip_bill_id = m.get('ip_bill_id')
        return self


class CancelIpAuthtradebillRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        ip_bill_id: str = None,
        account_id: str = None,
        memo: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 授权模式销售数据的账单ID
        self.ip_bill_id = ip_bill_id
        # 买家的链上账户Id
        self.account_id = account_id
        # 备注信息
        self.memo = memo

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.ip_bill_id, 'ip_bill_id')
        self.validate_required(self.account_id, 'account_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.ip_bill_id is not None:
            result['ip_bill_id'] = self.ip_bill_id
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.memo is not None:
            result['memo'] = self.memo
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('ip_bill_id') is not None:
            self.ip_bill_id = m.get('ip_bill_id')
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        return self


class CancelIpAuthtradebillResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class QueryIpBillstatusRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        ip_bill_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 账单ID
        self.ip_bill_id = ip_bill_id

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.ip_bill_id, 'ip_bill_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.ip_bill_id is not None:
            result['ip_bill_id'] = self.ip_bill_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('ip_bill_id') is not None:
            self.ip_bill_id = m.get('ip_bill_id')
        return self


class QueryIpBillstatusResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        status: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 交易状态
        # (1: "交易创建,等待买家付款"),
        # (2: "未付款交易超时关闭,或支付完成后全额退款"),
        # (3: "交易支付成功"),
        self.status = status

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.status is not None:
            result['status'] = self.status
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('status') is not None:
            self.status = m.get('status')
        return self


class QueryIpOrderlistRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        buyer_id: str = None,
        seller_id: str = None,
        ip_id: str = None,
        ip_order_id: str = None,
        order_status: int = None,
        ip_name: str = None,
        seller_name: str = None,
        trade_type: int = None,
        goods_type: int = None,
        charge_type: int = None,
        auth_start_time: int = None,
        auth_end_time: int = None,
        order_by: str = None,
        order: str = None,
        page_number: int = None,
        page_size: int = None,
        channel_name: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 买方ID
        self.buyer_id = buyer_id
        # 卖方ID
        self.seller_id = seller_id
        # IP id
        self.ip_id = ip_id
        # 订单ID
        self.ip_order_id = ip_order_id
        # 订单状态
        self.order_status = order_status
        # 根据IP名称模糊查询
        self.ip_name = ip_name
        # 卖方名称，根据卖方名称模糊查询
        self.seller_name = seller_name
        # 交易类型：1 套餐交易， 2 定向授权
        self.trade_type = trade_type
        # 0 IP交易，1 增值服务交易
        self.goods_type = goods_type
        # 收费模式：0 销售抽拥，1 按量计费
        self.charge_type = charge_type
        # 查询订单授权开始时间
        self.auth_start_time = auth_start_time
        # 查询订单授权结束时间
        self.auth_end_time = auth_end_time
        # 排序字段
        self.order_by = order_by
        # 数据排序顺序：正序还是倒序
        self.order = order
        # 页码
        self.page_number = page_number
        # 每页数据量大小
        self.page_size = page_size
        # 渠道名称
        self.channel_name = channel_name

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.order_by, 'order_by')
        self.validate_required(self.order, 'order')
        self.validate_required(self.page_number, 'page_number')
        self.validate_required(self.page_size, 'page_size')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.buyer_id is not None:
            result['buyer_id'] = self.buyer_id
        if self.seller_id is not None:
            result['seller_id'] = self.seller_id
        if self.ip_id is not None:
            result['ip_id'] = self.ip_id
        if self.ip_order_id is not None:
            result['ip_order_id'] = self.ip_order_id
        if self.order_status is not None:
            result['order_status'] = self.order_status
        if self.ip_name is not None:
            result['ip_name'] = self.ip_name
        if self.seller_name is not None:
            result['seller_name'] = self.seller_name
        if self.trade_type is not None:
            result['trade_type'] = self.trade_type
        if self.goods_type is not None:
            result['goods_type'] = self.goods_type
        if self.charge_type is not None:
            result['charge_type'] = self.charge_type
        if self.auth_start_time is not None:
            result['auth_start_time'] = self.auth_start_time
        if self.auth_end_time is not None:
            result['auth_end_time'] = self.auth_end_time
        if self.order_by is not None:
            result['order_by'] = self.order_by
        if self.order is not None:
            result['order'] = self.order
        if self.page_number is not None:
            result['page_number'] = self.page_number
        if self.page_size is not None:
            result['page_size'] = self.page_size
        if self.channel_name is not None:
            result['channel_name'] = self.channel_name
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('buyer_id') is not None:
            self.buyer_id = m.get('buyer_id')
        if m.get('seller_id') is not None:
            self.seller_id = m.get('seller_id')
        if m.get('ip_id') is not None:
            self.ip_id = m.get('ip_id')
        if m.get('ip_order_id') is not None:
            self.ip_order_id = m.get('ip_order_id')
        if m.get('order_status') is not None:
            self.order_status = m.get('order_status')
        if m.get('ip_name') is not None:
            self.ip_name = m.get('ip_name')
        if m.get('seller_name') is not None:
            self.seller_name = m.get('seller_name')
        if m.get('trade_type') is not None:
            self.trade_type = m.get('trade_type')
        if m.get('goods_type') is not None:
            self.goods_type = m.get('goods_type')
        if m.get('charge_type') is not None:
            self.charge_type = m.get('charge_type')
        if m.get('auth_start_time') is not None:
            self.auth_start_time = m.get('auth_start_time')
        if m.get('auth_end_time') is not None:
            self.auth_end_time = m.get('auth_end_time')
        if m.get('order_by') is not None:
            self.order_by = m.get('order_by')
        if m.get('order') is not None:
            self.order = m.get('order')
        if m.get('page_number') is not None:
            self.page_number = m.get('page_number')
        if m.get('page_size') is not None:
            self.page_size = m.get('page_size')
        if m.get('channel_name') is not None:
            self.channel_name = m.get('channel_name')
        return self


class QueryIpOrderlistResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        page_number: int = None,
        page_size: int = None,
        total_order_count: int = None,
        total_payment_amount: str = None,
        total_buyer_count: int = None,
        order_list: List[IPOrder] = None,
        select_order_count: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 页码
        self.page_number = page_number
        # 页面大小
        self.page_size = page_size
        # 订单总数
        self.total_order_count = total_order_count
        # 总金额
        self.total_payment_amount = total_payment_amount
        # 总客户数
        self.total_buyer_count = total_buyer_count
        # 订单列表
        self.order_list = order_list
        # 筛选条件下订单总数
        self.select_order_count = select_order_count

    def validate(self):
        if self.order_list:
            for k in self.order_list:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.page_number is not None:
            result['page_number'] = self.page_number
        if self.page_size is not None:
            result['page_size'] = self.page_size
        if self.total_order_count is not None:
            result['total_order_count'] = self.total_order_count
        if self.total_payment_amount is not None:
            result['total_payment_amount'] = self.total_payment_amount
        if self.total_buyer_count is not None:
            result['total_buyer_count'] = self.total_buyer_count
        result['order_list'] = []
        if self.order_list is not None:
            for k in self.order_list:
                result['order_list'].append(k.to_map() if k else None)
        if self.select_order_count is not None:
            result['select_order_count'] = self.select_order_count
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('page_number') is not None:
            self.page_number = m.get('page_number')
        if m.get('page_size') is not None:
            self.page_size = m.get('page_size')
        if m.get('total_order_count') is not None:
            self.total_order_count = m.get('total_order_count')
        if m.get('total_payment_amount') is not None:
            self.total_payment_amount = m.get('total_payment_amount')
        if m.get('total_buyer_count') is not None:
            self.total_buyer_count = m.get('total_buyer_count')
        self.order_list = []
        if m.get('order_list') is not None:
            for k in m.get('order_list'):
                temp_model = IPOrder()
                self.order_list.append(temp_model.from_map(k))
        if m.get('select_order_count') is not None:
            self.select_order_count = m.get('select_order_count')
        return self


class CreateIpGoodsRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        account_id: str = None,
        ip_name: str = None,
        audience_group: str = None,
        ip_type: str = None,
        image: str = None,
        image_detail: str = None,
        description: str = None,
        docking_people_info: List[DockingPeopleInfo] = None,
        copy_right_type: str = None,
        copy_right: str = None,
        cooperation_note: str = None,
        channel_name: str = None,
        cooperation_case: str = None,
        ip_create_time: int = None,
        future_milestones: str = None,
        promotion_channels: str = None,
        ip_other_name: str = None,
        memo: str = None,
        copy_right_begin_time: int = None,
        copy_right_end_time: int = None,
        ip_gallery_url: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础字段
        self.base_request = base_request
        # 版权方的链上账户Id
        self.account_id = account_id
        # ip的名字
        self.ip_name = ip_name
        # 受众群体，多个用;隔开
        self.audience_group = audience_group
        # ip类型，多个用;隔开
        self.ip_type = ip_type
        # ip主图,存放oss图片链接;隔开
        self.image = image
        # 商品详情图  存放OSS图片链接 用;隔开
        self.image_detail = image_detail
        # ip描述
        self.description = description
        # 对接人信息，json列表
        # [{
        # "name":"123", //联系人名字，必填
        # "mobilePhone":"123",// 联系人手机号,必填
        # "email":"456",// 联系人邮箱,选填
        # "dingDing":"999",// 联系人钉钉号,选填
        # "telePhone":"8888",// 联系人座机,选填
        # "position":"aaa"// 联系人职务,必填
        # }]
        self.docking_people_info = docking_people_info
        # 资质证书类型，0为用户上传，1申请
        self.copy_right_type = copy_right_type
        # 资质，copy_right_type为0的时候，copy_right不能为空，copy_right_type为1的时候，copy_right可以为空
        self.copy_right = copy_right
        # 合作事项
        self.cooperation_note = cooperation_note
        # 传入的渠道信息
        self.channel_name = channel_name
        # 合作案例，图片存放oss链接，多张用,隔开
        self.cooperation_case = cooperation_case
        # ip创建时间,毫秒时间戳
        self.ip_create_time = ip_create_time
        # 未来大事件
        self.future_milestones = future_milestones
        # 推广渠道
        self.promotion_channels = promotion_channels
        # ip别称，多个用;隔开
        self.ip_other_name = ip_other_name
        # 备注信息
        self.memo = memo
        # 资质生效时间， 毫秒时间戳
        self.copy_right_begin_time = copy_right_begin_time
        # 资质生效的结束时间
        self.copy_right_end_time = copy_right_end_time
        # IP图库链接
        self.ip_gallery_url = ip_gallery_url

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.ip_name, 'ip_name')
        self.validate_required(self.audience_group, 'audience_group')
        self.validate_required(self.ip_type, 'ip_type')
        self.validate_required(self.image, 'image')
        self.validate_required(self.image_detail, 'image_detail')
        self.validate_required(self.docking_people_info, 'docking_people_info')
        if self.docking_people_info:
            for k in self.docking_people_info:
                if k:
                    k.validate()
        self.validate_required(self.channel_name, 'channel_name')
        self.validate_required(self.copy_right_begin_time, 'copy_right_begin_time')
        self.validate_required(self.copy_right_end_time, 'copy_right_end_time')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.ip_name is not None:
            result['ip_name'] = self.ip_name
        if self.audience_group is not None:
            result['audience_group'] = self.audience_group
        if self.ip_type is not None:
            result['ip_type'] = self.ip_type
        if self.image is not None:
            result['image'] = self.image
        if self.image_detail is not None:
            result['image_detail'] = self.image_detail
        if self.description is not None:
            result['description'] = self.description
        result['docking_people_info'] = []
        if self.docking_people_info is not None:
            for k in self.docking_people_info:
                result['docking_people_info'].append(k.to_map() if k else None)
        if self.copy_right_type is not None:
            result['copy_right_type'] = self.copy_right_type
        if self.copy_right is not None:
            result['copy_right'] = self.copy_right
        if self.cooperation_note is not None:
            result['cooperation_note'] = self.cooperation_note
        if self.channel_name is not None:
            result['channel_name'] = self.channel_name
        if self.cooperation_case is not None:
            result['cooperation_case'] = self.cooperation_case
        if self.ip_create_time is not None:
            result['ip_create_time'] = self.ip_create_time
        if self.future_milestones is not None:
            result['future_milestones'] = self.future_milestones
        if self.promotion_channels is not None:
            result['promotion_channels'] = self.promotion_channels
        if self.ip_other_name is not None:
            result['ip_other_name'] = self.ip_other_name
        if self.memo is not None:
            result['memo'] = self.memo
        if self.copy_right_begin_time is not None:
            result['copy_right_begin_time'] = self.copy_right_begin_time
        if self.copy_right_end_time is not None:
            result['copy_right_end_time'] = self.copy_right_end_time
        if self.ip_gallery_url is not None:
            result['ip_gallery_url'] = self.ip_gallery_url
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('ip_name') is not None:
            self.ip_name = m.get('ip_name')
        if m.get('audience_group') is not None:
            self.audience_group = m.get('audience_group')
        if m.get('ip_type') is not None:
            self.ip_type = m.get('ip_type')
        if m.get('image') is not None:
            self.image = m.get('image')
        if m.get('image_detail') is not None:
            self.image_detail = m.get('image_detail')
        if m.get('description') is not None:
            self.description = m.get('description')
        self.docking_people_info = []
        if m.get('docking_people_info') is not None:
            for k in m.get('docking_people_info'):
                temp_model = DockingPeopleInfo()
                self.docking_people_info.append(temp_model.from_map(k))
        if m.get('copy_right_type') is not None:
            self.copy_right_type = m.get('copy_right_type')
        if m.get('copy_right') is not None:
            self.copy_right = m.get('copy_right')
        if m.get('cooperation_note') is not None:
            self.cooperation_note = m.get('cooperation_note')
        if m.get('channel_name') is not None:
            self.channel_name = m.get('channel_name')
        if m.get('cooperation_case') is not None:
            self.cooperation_case = m.get('cooperation_case')
        if m.get('ip_create_time') is not None:
            self.ip_create_time = m.get('ip_create_time')
        if m.get('future_milestones') is not None:
            self.future_milestones = m.get('future_milestones')
        if m.get('promotion_channels') is not None:
            self.promotion_channels = m.get('promotion_channels')
        if m.get('ip_other_name') is not None:
            self.ip_other_name = m.get('ip_other_name')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('copy_right_begin_time') is not None:
            self.copy_right_begin_time = m.get('copy_right_begin_time')
        if m.get('copy_right_end_time') is not None:
            self.copy_right_end_time = m.get('copy_right_end_time')
        if m.get('ip_gallery_url') is not None:
            self.ip_gallery_url = m.get('ip_gallery_url')
        return self


class CreateIpGoodsResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        ip_id: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # ip的链上id
        self.ip_id = ip_id

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.ip_id is not None:
            result['ip_id'] = self.ip_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('ip_id') is not None:
            self.ip_id = m.get('ip_id')
        return self


class AddIpChannelRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        ip_id: str = None,
        channel_name: str = None,
        authorization_model: int = None,
        pay_mode: int = None,
        ip_level: int = None,
        trade_need_confirm: bool = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础字段
        self.base_request = base_request
        # ip的链上id
        self.ip_id = ip_id
        # 渠道信息
        self.channel_name = channel_name
        # 商品授权 0普通授权/1独家授权,本期只支持0
        self.authorization_model = authorization_model
        # 计费模式 0:按量 1:按金额
        self.pay_mode = pay_mode
        # ip等级  0:经典IP/1:流量IP/3:设计IP
        self.ip_level = ip_level
        # 交易是否需要确认，默认不需要确认
        self.trade_need_confirm = trade_need_confirm

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.ip_id, 'ip_id')
        self.validate_required(self.channel_name, 'channel_name')
        self.validate_required(self.authorization_model, 'authorization_model')
        self.validate_required(self.pay_mode, 'pay_mode')
        self.validate_required(self.ip_level, 'ip_level')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.ip_id is not None:
            result['ip_id'] = self.ip_id
        if self.channel_name is not None:
            result['channel_name'] = self.channel_name
        if self.authorization_model is not None:
            result['authorization_model'] = self.authorization_model
        if self.pay_mode is not None:
            result['pay_mode'] = self.pay_mode
        if self.ip_level is not None:
            result['ip_level'] = self.ip_level
        if self.trade_need_confirm is not None:
            result['trade_need_confirm'] = self.trade_need_confirm
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('ip_id') is not None:
            self.ip_id = m.get('ip_id')
        if m.get('channel_name') is not None:
            self.channel_name = m.get('channel_name')
        if m.get('authorization_model') is not None:
            self.authorization_model = m.get('authorization_model')
        if m.get('pay_mode') is not None:
            self.pay_mode = m.get('pay_mode')
        if m.get('ip_level') is not None:
            self.ip_level = m.get('ip_level')
        if m.get('trade_need_confirm') is not None:
            self.trade_need_confirm = m.get('trade_need_confirm')
        return self


class AddIpChannelResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class QueryIpOrderinfoRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        ip_order_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 订单ID
        self.ip_order_id = ip_order_id

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.ip_order_id, 'ip_order_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.ip_order_id is not None:
            result['ip_order_id'] = self.ip_order_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('ip_order_id') is not None:
            self.ip_order_id = m.get('ip_order_id')
        return self


class QueryIpOrderinfoResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        ip_order: IPOrder = None,
        ip_sales_info_list: List[IPSalesInfo] = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 订单信息
        self.ip_order = ip_order
        # IP授权销售数据
        self.ip_sales_info_list = ip_sales_info_list

    def validate(self):
        if self.ip_order:
            self.ip_order.validate()
        if self.ip_sales_info_list:
            for k in self.ip_sales_info_list:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.ip_order is not None:
            result['ip_order'] = self.ip_order.to_map()
        result['ip_sales_info_list'] = []
        if self.ip_sales_info_list is not None:
            for k in self.ip_sales_info_list:
                result['ip_sales_info_list'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('ip_order') is not None:
            temp_model = IPOrder()
            self.ip_order = temp_model.from_map(m['ip_order'])
        self.ip_sales_info_list = []
        if m.get('ip_sales_info_list') is not None:
            for k in m.get('ip_sales_info_list'):
                temp_model = IPSalesInfo()
                self.ip_sales_info_list.append(temp_model.from_map(k))
        return self


class BatchqueryIpGoodsRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        ip_id: str = None,
        ip_name: str = None,
        status: int = None,
        channel_name: str = None,
        page_size: int = None,
        page_index: int = None,
        account_id: str = None,
        ip_type: str = None,
        audience_group: str = None,
        create_begin_time: str = None,
        create_end_time: str = None,
        is_create_time_sort_desc: bool = None,
        is_sort_by_pv: int = None,
        is_sort_by_status_change: int = None,
        query_creater_channel: bool = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础信息
        self.base_request = base_request
        # 商品id
        self.ip_id = ip_id
        # ip名称，支持模糊匹配
        self.ip_name = ip_name
        # 商品状态（0:待上架，1:上架，2:下架）
        self.status = status
        # ip的上架渠道
        self.channel_name = channel_name
        # 分页大小
        self.page_size = page_size
        # 分页索引
        self.page_index = page_index
        # ip商品归属方的链上id
        self.account_id = account_id
        # Ip类型
        self.ip_type = ip_type
        # 受众人群
        self.audience_group = audience_group
        # 上架日期开始时间
        self.create_begin_time = create_begin_time
        # 创建的结束日期
        self.create_end_time = create_end_time
        # 是否需要按照创建时间倒序排序
        self.is_create_time_sort_desc = is_create_time_sort_desc
        # 是否需要按照pv排序（0:不需要，1:正序，2:倒序），默认按照pv倒序
        self.is_sort_by_pv = is_sort_by_pv
        # 是否需要按照最近上下架时间排序（0:不需要，1:正序，2:倒序），默认按照倒序
        self.is_sort_by_status_change = is_sort_by_status_change
        # 是否需要返回创建渠道，为空默认不返回
        self.query_creater_channel = query_creater_channel

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.channel_name, 'channel_name')
        self.validate_required(self.page_size, 'page_size')
        self.validate_required(self.page_index, 'page_index')
        self.validate_required(self.create_begin_time, 'create_begin_time')
        if self.create_begin_time is not None:
            self.validate_pattern(self.create_begin_time, 'create_begin_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}([Z]|([\\.]\\d{1,9})?[\\+]\\d{2}[\\:]?\\d{2})')
        self.validate_required(self.create_end_time, 'create_end_time')
        if self.create_end_time is not None:
            self.validate_pattern(self.create_end_time, 'create_end_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}([Z]|([\\.]\\d{1,9})?[\\+]\\d{2}[\\:]?\\d{2})')
        self.validate_required(self.is_create_time_sort_desc, 'is_create_time_sort_desc')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.ip_id is not None:
            result['ip_id'] = self.ip_id
        if self.ip_name is not None:
            result['ip_name'] = self.ip_name
        if self.status is not None:
            result['status'] = self.status
        if self.channel_name is not None:
            result['channel_name'] = self.channel_name
        if self.page_size is not None:
            result['page_size'] = self.page_size
        if self.page_index is not None:
            result['page_index'] = self.page_index
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.ip_type is not None:
            result['ip_type'] = self.ip_type
        if self.audience_group is not None:
            result['audience_group'] = self.audience_group
        if self.create_begin_time is not None:
            result['create_begin_time'] = self.create_begin_time
        if self.create_end_time is not None:
            result['create_end_time'] = self.create_end_time
        if self.is_create_time_sort_desc is not None:
            result['is_create_time_sort_desc'] = self.is_create_time_sort_desc
        if self.is_sort_by_pv is not None:
            result['is_sort_by_pv'] = self.is_sort_by_pv
        if self.is_sort_by_status_change is not None:
            result['is_sort_by_status_change'] = self.is_sort_by_status_change
        if self.query_creater_channel is not None:
            result['query_creater_channel'] = self.query_creater_channel
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('ip_id') is not None:
            self.ip_id = m.get('ip_id')
        if m.get('ip_name') is not None:
            self.ip_name = m.get('ip_name')
        if m.get('status') is not None:
            self.status = m.get('status')
        if m.get('channel_name') is not None:
            self.channel_name = m.get('channel_name')
        if m.get('page_size') is not None:
            self.page_size = m.get('page_size')
        if m.get('page_index') is not None:
            self.page_index = m.get('page_index')
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('ip_type') is not None:
            self.ip_type = m.get('ip_type')
        if m.get('audience_group') is not None:
            self.audience_group = m.get('audience_group')
        if m.get('create_begin_time') is not None:
            self.create_begin_time = m.get('create_begin_time')
        if m.get('create_end_time') is not None:
            self.create_end_time = m.get('create_end_time')
        if m.get('is_create_time_sort_desc') is not None:
            self.is_create_time_sort_desc = m.get('is_create_time_sort_desc')
        if m.get('is_sort_by_pv') is not None:
            self.is_sort_by_pv = m.get('is_sort_by_pv')
        if m.get('is_sort_by_status_change') is not None:
            self.is_sort_by_status_change = m.get('is_sort_by_status_change')
        if m.get('query_creater_channel') is not None:
            self.query_creater_channel = m.get('query_creater_channel')
        return self


class BatchqueryIpGoodsResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        ip_list: List[IpEmphasisInfo] = None,
        all_count: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # ip重要信息
        self.ip_list = ip_list
        # 结果总数，不是列表值，用于分页
        self.all_count = all_count

    def validate(self):
        if self.ip_list:
            for k in self.ip_list:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        result['ip_list'] = []
        if self.ip_list is not None:
            for k in self.ip_list:
                result['ip_list'].append(k.to_map() if k else None)
        if self.all_count is not None:
            result['all_count'] = self.all_count
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        self.ip_list = []
        if m.get('ip_list') is not None:
            for k in m.get('ip_list'):
                temp_model = IpEmphasisInfo()
                self.ip_list.append(temp_model.from_map(k))
        if m.get('all_count') is not None:
            self.all_count = m.get('all_count')
        return self


class QueryIpGoodsdetailwithchannelRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        ip_ids: List[str] = None,
        channel_name: str = None,
        update_pv: bool = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础结构
        self.base_request = base_request
        # ip的链上id
        self.ip_ids = ip_ids
        # 查询的渠道名字
        self.channel_name = channel_name
        # 是否要增加pv，默认不增加
        self.update_pv = update_pv

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.ip_ids, 'ip_ids')
        self.validate_required(self.channel_name, 'channel_name')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.ip_ids is not None:
            result['ip_ids'] = self.ip_ids
        if self.channel_name is not None:
            result['channel_name'] = self.channel_name
        if self.update_pv is not None:
            result['update_pv'] = self.update_pv
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('ip_ids') is not None:
            self.ip_ids = m.get('ip_ids')
        if m.get('channel_name') is not None:
            self.channel_name = m.get('channel_name')
        if m.get('update_pv') is not None:
            self.update_pv = m.get('update_pv')
        return self


class QueryIpGoodsdetailwithchannelResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        ips: List[IpBasicInfoWithChannelInfo] = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # ip的信息详情
        self.ips = ips

    def validate(self):
        if self.ips:
            for k in self.ips:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        result['ips'] = []
        if self.ips is not None:
            for k in self.ips:
                result['ips'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        self.ips = []
        if m.get('ips') is not None:
            for k in m.get('ips'):
                temp_model = IpBasicInfoWithChannelInfo()
                self.ips.append(temp_model.from_map(k))
        return self


class QueryIpDetailRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        ip_ids: List[str] = None,
        skip_not_found_ip: bool = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础字段
        self.base_request = base_request
        # ip的链上id列表
        self.ip_ids = ip_ids
        # 查找不到的ip是否报错，默认false，会报错
        self.skip_not_found_ip = skip_not_found_ip

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.ip_ids, 'ip_ids')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.ip_ids is not None:
            result['ip_ids'] = self.ip_ids
        if self.skip_not_found_ip is not None:
            result['skip_not_found_ip'] = self.skip_not_found_ip
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('ip_ids') is not None:
            self.ip_ids = m.get('ip_ids')
        if m.get('skip_not_found_ip') is not None:
            self.skip_not_found_ip = m.get('skip_not_found_ip')
        return self


class QueryIpDetailResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        ips: List[IpBasicInfoWithChannelInfo] = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # ip的信息列表
        self.ips = ips

    def validate(self):
        if self.ips:
            for k in self.ips:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        result['ips'] = []
        if self.ips is not None:
            for k in self.ips:
                result['ips'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        self.ips = []
        if m.get('ips') is not None:
            for k in m.get('ips'):
                temp_model = IpBasicInfoWithChannelInfo()
                self.ips.append(temp_model.from_map(k))
        return self


class UpdateIpGoodsRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        ip_name: str = None,
        ip_type: str = None,
        audience_group: str = None,
        ip_id: str = None,
        image: str = None,
        image_detail: str = None,
        description: str = None,
        docking_people_info: List[DockingPeopleInfo] = None,
        copy_right_type: str = None,
        copy_right: str = None,
        cooperation_note: str = None,
        channel_name: str = None,
        cooperation_case: str = None,
        ip_create_time: int = None,
        future_milestones: str = None,
        promotion_channels: str = None,
        ip_other_name: str = None,
        memo: str = None,
        copy_right_begin_time: int = None,
        copy_right_end_time: int = None,
        need_approval: bool = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础字段
        self.base_request = base_request
        # ip的名字
        self.ip_name = ip_name
        # ip类型，多个用;隔开
        self.ip_type = ip_type
        # 受众人群，多个用;隔开
        self.audience_group = audience_group
        # ip链上id
        self.ip_id = ip_id
        # ip主图,存放oss图片链接 多个用;隔开
        self.image = image
        # 商品详情图  存放OSS图片链接 多个用;隔开
        self.image_detail = image_detail
        # ip描述
        self.description = description
        # 对接人信息，json列表
        # [{
        # "name":"123", //联系人名字，必填
        # "mobilePhone":"123",// 联系人手机号,必填
        # "email":"456",// 联系人邮箱,选填
        # "dingDing":"999",// 联系人钉钉号,选填
        # "telePhone":"8888",// 联系人座机,选填
        # "position":"aaa"// 联系人职务,必填
        # }]
        self.docking_people_info = docking_people_info
        # 资质证书类型，0为用户上传，1申请
        self.copy_right_type = copy_right_type
        # 资质
        self.copy_right = copy_right
        # 合作事项
        self.cooperation_note = cooperation_note
        # 传入的渠道信息，不是更新项
        self.channel_name = channel_name
        # 合作案例，图片存放oss链接，多张用;隔开
        self.cooperation_case = cooperation_case
        # ip创建时间,毫秒时间戳
        self.ip_create_time = ip_create_time
        # 未来大事件
        self.future_milestones = future_milestones
        # 推广渠道
        self.promotion_channels = promotion_channels
        # ip别名，多个通过;隔开
        self.ip_other_name = ip_other_name
        # 备注信息
        self.memo = memo
        # 资质生效时间 毫秒时间戳
        self.copy_right_begin_time = copy_right_begin_time
        # 资质生效的结束时间
        self.copy_right_end_time = copy_right_end_time
        # 如果商品是审批通过状态，是否需要审批，默认false。该字段提供给运营使用，慎用！！！
        self.need_approval = need_approval

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.ip_name, 'ip_name')
        self.validate_required(self.ip_type, 'ip_type')
        self.validate_required(self.audience_group, 'audience_group')
        self.validate_required(self.ip_id, 'ip_id')
        self.validate_required(self.image, 'image')
        self.validate_required(self.image_detail, 'image_detail')
        self.validate_required(self.docking_people_info, 'docking_people_info')
        if self.docking_people_info:
            for k in self.docking_people_info:
                if k:
                    k.validate()
        self.validate_required(self.channel_name, 'channel_name')
        self.validate_required(self.copy_right_begin_time, 'copy_right_begin_time')
        self.validate_required(self.copy_right_end_time, 'copy_right_end_time')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.ip_name is not None:
            result['ip_name'] = self.ip_name
        if self.ip_type is not None:
            result['ip_type'] = self.ip_type
        if self.audience_group is not None:
            result['audience_group'] = self.audience_group
        if self.ip_id is not None:
            result['ip_id'] = self.ip_id
        if self.image is not None:
            result['image'] = self.image
        if self.image_detail is not None:
            result['image_detail'] = self.image_detail
        if self.description is not None:
            result['description'] = self.description
        result['docking_people_info'] = []
        if self.docking_people_info is not None:
            for k in self.docking_people_info:
                result['docking_people_info'].append(k.to_map() if k else None)
        if self.copy_right_type is not None:
            result['copy_right_type'] = self.copy_right_type
        if self.copy_right is not None:
            result['copy_right'] = self.copy_right
        if self.cooperation_note is not None:
            result['cooperation_note'] = self.cooperation_note
        if self.channel_name is not None:
            result['channel_name'] = self.channel_name
        if self.cooperation_case is not None:
            result['cooperation_case'] = self.cooperation_case
        if self.ip_create_time is not None:
            result['ip_create_time'] = self.ip_create_time
        if self.future_milestones is not None:
            result['future_milestones'] = self.future_milestones
        if self.promotion_channels is not None:
            result['promotion_channels'] = self.promotion_channels
        if self.ip_other_name is not None:
            result['ip_other_name'] = self.ip_other_name
        if self.memo is not None:
            result['memo'] = self.memo
        if self.copy_right_begin_time is not None:
            result['copy_right_begin_time'] = self.copy_right_begin_time
        if self.copy_right_end_time is not None:
            result['copy_right_end_time'] = self.copy_right_end_time
        if self.need_approval is not None:
            result['need_approval'] = self.need_approval
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('ip_name') is not None:
            self.ip_name = m.get('ip_name')
        if m.get('ip_type') is not None:
            self.ip_type = m.get('ip_type')
        if m.get('audience_group') is not None:
            self.audience_group = m.get('audience_group')
        if m.get('ip_id') is not None:
            self.ip_id = m.get('ip_id')
        if m.get('image') is not None:
            self.image = m.get('image')
        if m.get('image_detail') is not None:
            self.image_detail = m.get('image_detail')
        if m.get('description') is not None:
            self.description = m.get('description')
        self.docking_people_info = []
        if m.get('docking_people_info') is not None:
            for k in m.get('docking_people_info'):
                temp_model = DockingPeopleInfo()
                self.docking_people_info.append(temp_model.from_map(k))
        if m.get('copy_right_type') is not None:
            self.copy_right_type = m.get('copy_right_type')
        if m.get('copy_right') is not None:
            self.copy_right = m.get('copy_right')
        if m.get('cooperation_note') is not None:
            self.cooperation_note = m.get('cooperation_note')
        if m.get('channel_name') is not None:
            self.channel_name = m.get('channel_name')
        if m.get('cooperation_case') is not None:
            self.cooperation_case = m.get('cooperation_case')
        if m.get('ip_create_time') is not None:
            self.ip_create_time = m.get('ip_create_time')
        if m.get('future_milestones') is not None:
            self.future_milestones = m.get('future_milestones')
        if m.get('promotion_channels') is not None:
            self.promotion_channels = m.get('promotion_channels')
        if m.get('ip_other_name') is not None:
            self.ip_other_name = m.get('ip_other_name')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('copy_right_begin_time') is not None:
            self.copy_right_begin_time = m.get('copy_right_begin_time')
        if m.get('copy_right_end_time') is not None:
            self.copy_right_end_time = m.get('copy_right_end_time')
        if m.get('need_approval') is not None:
            self.need_approval = m.get('need_approval')
        return self


class UpdateIpGoodsResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class UpdateIpChannelRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        ip_id: str = None,
        channel_name: str = None,
        authorization_model: int = None,
        pay_mode: int = None,
        ip_level: int = None,
        trade_need_confirm: bool = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础字段
        self.base_request = base_request
        # ip的链上id
        self.ip_id = ip_id
        # 渠道信息
        self.channel_name = channel_name
        # 商品授权 0普通授权/1独家授权,本期只支持0
        self.authorization_model = authorization_model
        # 计费模式 0:按量 1:按金额
        self.pay_mode = pay_mode
        # ip等级  0:经典IP/1:流量IP/3:设计IP
        self.ip_level = ip_level
        # 交易是否需要确认，为空则不更新
        self.trade_need_confirm = trade_need_confirm

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.ip_id, 'ip_id')
        self.validate_required(self.channel_name, 'channel_name')
        self.validate_required(self.authorization_model, 'authorization_model')
        self.validate_required(self.pay_mode, 'pay_mode')
        self.validate_required(self.ip_level, 'ip_level')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.ip_id is not None:
            result['ip_id'] = self.ip_id
        if self.channel_name is not None:
            result['channel_name'] = self.channel_name
        if self.authorization_model is not None:
            result['authorization_model'] = self.authorization_model
        if self.pay_mode is not None:
            result['pay_mode'] = self.pay_mode
        if self.ip_level is not None:
            result['ip_level'] = self.ip_level
        if self.trade_need_confirm is not None:
            result['trade_need_confirm'] = self.trade_need_confirm
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('ip_id') is not None:
            self.ip_id = m.get('ip_id')
        if m.get('channel_name') is not None:
            self.channel_name = m.get('channel_name')
        if m.get('authorization_model') is not None:
            self.authorization_model = m.get('authorization_model')
        if m.get('pay_mode') is not None:
            self.pay_mode = m.get('pay_mode')
        if m.get('ip_level') is not None:
            self.ip_level = m.get('ip_level')
        if m.get('trade_need_confirm') is not None:
            self.trade_need_confirm = m.get('trade_need_confirm')
        return self


class UpdateIpChannelResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class OnlineIpRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        ip_id: str = None,
        channel_name: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础字段
        self.base_request = base_request
        # ip的链上id
        self.ip_id = ip_id
        # 渠道
        self.channel_name = channel_name

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.ip_id, 'ip_id')
        self.validate_required(self.channel_name, 'channel_name')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.ip_id is not None:
            result['ip_id'] = self.ip_id
        if self.channel_name is not None:
            result['channel_name'] = self.channel_name
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('ip_id') is not None:
            self.ip_id = m.get('ip_id')
        if m.get('channel_name') is not None:
            self.channel_name = m.get('channel_name')
        return self


class OnlineIpResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class OfflineIpRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        ip_id: str = None,
        channel_name: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # ip基础信息
        self.base_request = base_request
        # ip的链上id
        self.ip_id = ip_id
        # 渠道1
        self.channel_name = channel_name

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.ip_id, 'ip_id')
        self.validate_required(self.channel_name, 'channel_name')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.ip_id is not None:
            result['ip_id'] = self.ip_id
        if self.channel_name is not None:
            result['channel_name'] = self.channel_name
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('ip_id') is not None:
            self.ip_id = m.get('ip_id')
        if m.get('channel_name') is not None:
            self.channel_name = m.get('channel_name')
        return self


class OfflineIpResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class CreateIpAccountRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        external_user_id: str = None,
        external_user_name: str = None,
        role: int = None,
        inviter_id: str = None,
        policy_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础请求参数
        self.base_request = base_request
        # 该用户的在外部系统的用户Id
        self.external_user_id = external_user_id
        # 该用户的在外部系统的用户名称
        self.external_user_name = external_user_name
        # 角色:  1:版权方 2: 版权采购商
        self.role = role
        # 商户合作伙伴id，邀请商户入驻
        self.inviter_id = inviter_id
        # 商户合作伙伴返佣政策id
        self.policy_id = policy_id

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.external_user_id, 'external_user_id')
        self.validate_required(self.external_user_name, 'external_user_name')
        self.validate_required(self.role, 'role')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.external_user_id is not None:
            result['external_user_id'] = self.external_user_id
        if self.external_user_name is not None:
            result['external_user_name'] = self.external_user_name
        if self.role is not None:
            result['role'] = self.role
        if self.inviter_id is not None:
            result['inviter_id'] = self.inviter_id
        if self.policy_id is not None:
            result['policy_id'] = self.policy_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('external_user_id') is not None:
            self.external_user_id = m.get('external_user_id')
        if m.get('external_user_name') is not None:
            self.external_user_name = m.get('external_user_name')
        if m.get('role') is not None:
            self.role = m.get('role')
        if m.get('inviter_id') is not None:
            self.inviter_id = m.get('inviter_id')
        if m.get('policy_id') is not None:
            self.policy_id = m.get('policy_id')
        return self


class CreateIpAccountResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        account_id: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 创建成功后, 为该用户生成的链上账户Id
        self.account_id = account_id

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.account_id is not None:
            result['account_id'] = self.account_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        return self


class FreezeIpAccountRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        account_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础请求参数
        self.base_request = base_request
        # 用户的链上账户Id
        self.account_id = account_id

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.account_id, 'account_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        return self


class FreezeIpAccountResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class UnfreezeIpAccountRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        account_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础请求参数
        self.base_request = base_request
        # 用户的链上账户Id
        self.account_id = account_id

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.account_id, 'account_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        return self


class UnfreezeIpAccountResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class QueryIpAccountRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        account_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础参数
        self.base_request = base_request
        # 用户的链上账户Id
        self.account_id = account_id

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.account_id, 'account_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        return self


class QueryIpAccountResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        external_user_id: str = None,
        external_user_name: str = None,
        role: int = None,
        status: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 该用户的在外部系统的用户Id
        self.external_user_id = external_user_id
        # 该用户的在外部系统的用户名称
        self.external_user_name = external_user_name
        # 1:版权方 2: 版权采购商
        self.role = role
        # 用户状态(0:初始化, 1:申请流程中, 2:可用, 3:被冻结)
        # 买家: 链上账户注册成功即为可用状态。
        # 卖家: 链上账户注册成功为初始化状态, 申请期间涉及2层审核皆为审核流程中状态, 支付宝审核通过即为可用状态。
        self.status = status

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.external_user_id is not None:
            result['external_user_id'] = self.external_user_id
        if self.external_user_name is not None:
            result['external_user_name'] = self.external_user_name
        if self.role is not None:
            result['role'] = self.role
        if self.status is not None:
            result['status'] = self.status
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('external_user_id') is not None:
            self.external_user_id = m.get('external_user_id')
        if m.get('external_user_name') is not None:
            self.external_user_name = m.get('external_user_name')
        if m.get('role') is not None:
            self.role = m.get('role')
        if m.get('status') is not None:
            self.status = m.get('status')
        return self


class ApplyIpAccountRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        account_id: str = None,
        alipay_login_name: str = None,
        merchant_alias_name: str = None,
        merchant_type: int = None,
        merchant_cert_type: int = None,
        merchant_cert_number: str = None,
        merchant_cert_image: str = None,
        merchant_sign_image: str = None,
        mcc: str = None,
        legal_name: str = None,
        legal_cert_no: str = None,
        address_info: IPAddressInfo = None,
        contact_info: IPContactInfo = None,
        settle_rule: IPSettleRule = None,
        card_info: IPCardInfo = None,
        memo: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础参数
        self.base_request = base_request
        # 版权方的链上账户Id
        self.account_id = account_id
        # 支付宝的登陆用户名(必须实名制)
        self.alipay_login_name = alipay_login_name
        # 商户别名, 会展示在账单以及支付结果页中
        self.merchant_alias_name = merchant_alias_name
        # 商户类型(本期仅支持:  1:企业, 6:个人商户)
        self.merchant_type = merchant_type
        # 商户证件类型(本期仅支持: 201: 营业执照, 100: 个人商户身份证)
        # 如果merchant_type为企业, 需要传入201; 如果merchant_type为个人, 需要传入100
        self.merchant_cert_type = merchant_cert_type
        # 商户证件编号(企业提供营业执照),本期人工审核
        self.merchant_cert_number = merchant_cert_number
        # 商户营业执照的图片地址,本期人工审核
        self.merchant_cert_image = merchant_cert_image
        # 税务登记证明的图片,本期人工审核
        self.merchant_sign_image = merchant_sign_image
        # 商户类别码mcc，参见https://gw.alipayobjects.com/os/bmw-prod/05c9a32e-42d1-436b-ace7-13101d91f672.xlsx
        self.mcc = mcc
        # 商户法人名称, merchant_type = 01时必填
        self.legal_name = legal_name
        # 商户法人身份证号码, merchant_type = 1时必填
        self.legal_cert_no = legal_cert_no
        # 商户经营地址
        self.address_info = address_info
        # 商户联系人信息
        self.contact_info = contact_info
        # 默认结算规则
        self.settle_rule = settle_rule
        # 银行卡结算信息, 结算到银行卡时必填, 当前仅支持填入一张卡
        self.card_info = card_info
        # 备注信息
        self.memo = memo

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.alipay_login_name, 'alipay_login_name')
        self.validate_required(self.merchant_alias_name, 'merchant_alias_name')
        self.validate_required(self.merchant_type, 'merchant_type')
        self.validate_required(self.merchant_cert_type, 'merchant_cert_type')
        self.validate_required(self.mcc, 'mcc')
        self.validate_required(self.address_info, 'address_info')
        if self.address_info:
            self.address_info.validate()
        self.validate_required(self.contact_info, 'contact_info')
        if self.contact_info:
            self.contact_info.validate()
        self.validate_required(self.settle_rule, 'settle_rule')
        if self.settle_rule:
            self.settle_rule.validate()
        if self.card_info:
            self.card_info.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.alipay_login_name is not None:
            result['alipay_login_name'] = self.alipay_login_name
        if self.merchant_alias_name is not None:
            result['merchant_alias_name'] = self.merchant_alias_name
        if self.merchant_type is not None:
            result['merchant_type'] = self.merchant_type
        if self.merchant_cert_type is not None:
            result['merchant_cert_type'] = self.merchant_cert_type
        if self.merchant_cert_number is not None:
            result['merchant_cert_number'] = self.merchant_cert_number
        if self.merchant_cert_image is not None:
            result['merchant_cert_image'] = self.merchant_cert_image
        if self.merchant_sign_image is not None:
            result['merchant_sign_image'] = self.merchant_sign_image
        if self.mcc is not None:
            result['mcc'] = self.mcc
        if self.legal_name is not None:
            result['legal_name'] = self.legal_name
        if self.legal_cert_no is not None:
            result['legal_cert_no'] = self.legal_cert_no
        if self.address_info is not None:
            result['address_info'] = self.address_info.to_map()
        if self.contact_info is not None:
            result['contact_info'] = self.contact_info.to_map()
        if self.settle_rule is not None:
            result['settle_rule'] = self.settle_rule.to_map()
        if self.card_info is not None:
            result['card_info'] = self.card_info.to_map()
        if self.memo is not None:
            result['memo'] = self.memo
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('alipay_login_name') is not None:
            self.alipay_login_name = m.get('alipay_login_name')
        if m.get('merchant_alias_name') is not None:
            self.merchant_alias_name = m.get('merchant_alias_name')
        if m.get('merchant_type') is not None:
            self.merchant_type = m.get('merchant_type')
        if m.get('merchant_cert_type') is not None:
            self.merchant_cert_type = m.get('merchant_cert_type')
        if m.get('merchant_cert_number') is not None:
            self.merchant_cert_number = m.get('merchant_cert_number')
        if m.get('merchant_cert_image') is not None:
            self.merchant_cert_image = m.get('merchant_cert_image')
        if m.get('merchant_sign_image') is not None:
            self.merchant_sign_image = m.get('merchant_sign_image')
        if m.get('mcc') is not None:
            self.mcc = m.get('mcc')
        if m.get('legal_name') is not None:
            self.legal_name = m.get('legal_name')
        if m.get('legal_cert_no') is not None:
            self.legal_cert_no = m.get('legal_cert_no')
        if m.get('address_info') is not None:
            temp_model = IPAddressInfo()
            self.address_info = temp_model.from_map(m['address_info'])
        if m.get('contact_info') is not None:
            temp_model = IPContactInfo()
            self.contact_info = temp_model.from_map(m['contact_info'])
        if m.get('settle_rule') is not None:
            temp_model = IPSettleRule()
            self.settle_rule = temp_model.from_map(m['settle_rule'])
        if m.get('card_info') is not None:
            temp_model = IPCardInfo()
            self.card_info = temp_model.from_map(m['card_info'])
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        return self


class ApplyIpAccountResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class CheckIpAccountRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        account_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础参数
        self.base_request = base_request
        # 版权方的链上账户Id
        self.account_id = account_id

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.account_id, 'account_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        return self


class CheckIpAccountResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        status: str = None,
        reject_reason: str = None,
        need_sign: bool = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 申请状态(0:运营审核中, 1:运营审核失败, 2:进件审核中, 3:进件审核失败, 4:进件审核成功)
        self.status = status
        # 运营审核失败原因
        self.reject_reason = reject_reason
        # 是否需要支付宝签约(当为true,需要用户到支付宝进行签约) 签约引导说明: https://opendocs.alipay.com/open/00gfyb
        self.need_sign = need_sign

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.status is not None:
            result['status'] = self.status
        if self.reject_reason is not None:
            result['reject_reason'] = self.reject_reason
        if self.need_sign is not None:
            result['need_sign'] = self.need_sign
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('status') is not None:
            self.status = m.get('status')
        if m.get('reject_reason') is not None:
            self.reject_reason = m.get('reject_reason')
        if m.get('need_sign') is not None:
            self.need_sign = m.get('need_sign')
        return self


class ConfirmIpGoodsRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        ip_id: str = None,
        is_approval: bool = None,
        approval_comments: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础信息
        self.base_request = base_request
        # ip id
        self.ip_id = ip_id
        # 是否审批通过
        self.is_approval = is_approval
        # 审批意见
        self.approval_comments = approval_comments

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.ip_id, 'ip_id')
        self.validate_required(self.is_approval, 'is_approval')
        self.validate_required(self.approval_comments, 'approval_comments')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.ip_id is not None:
            result['ip_id'] = self.ip_id
        if self.is_approval is not None:
            result['is_approval'] = self.is_approval
        if self.approval_comments is not None:
            result['approval_comments'] = self.approval_comments
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('ip_id') is not None:
            self.ip_id = m.get('ip_id')
        if m.get('is_approval') is not None:
            self.is_approval = m.get('is_approval')
        if m.get('approval_comments') is not None:
            self.approval_comments = m.get('approval_comments')
        return self


class ConfirmIpGoodsResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class BatchqueryIpApprovalRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        ip_name: str = None,
        ip_id: str = None,
        approval_status: int = None,
        page_size: int = None,
        page_index: int = None,
        ip_type: str = None,
        audience_group: str = None,
        create_begin_time: str = None,
        create_end_time: str = None,
        account_id: str = None,
        is_create_time_sort_desc: bool = None,
        channel_name: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础信息
        self.base_request = base_request
        # ip名称，支持模糊匹配
        self.ip_name = ip_name
        # IP_id
        self.ip_id = ip_id
        # ip审批状态 0待审批，1 审批通过，2 审批拒绝
        self.approval_status = approval_status
        # 分页
        self.page_size = page_size
        # 分页
        self.page_index = page_index
        # ip类型
        self.ip_type = ip_type
        # 受众人群
        self.audience_group = audience_group
        # 创建时间段起始
        self.create_begin_time = create_begin_time
        # 创建时间段结束
        self.create_end_time = create_end_time
        # 商品的链上租户id
        self.account_id = account_id
        # 是否需要按照创建时间倒序排序
        self.is_create_time_sort_desc = is_create_time_sort_desc
        # 渠道名称
        self.channel_name = channel_name

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.page_size, 'page_size')
        self.validate_required(self.page_index, 'page_index')
        self.validate_required(self.create_begin_time, 'create_begin_time')
        if self.create_begin_time is not None:
            self.validate_pattern(self.create_begin_time, 'create_begin_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}([Z]|([\\.]\\d{1,9})?[\\+]\\d{2}[\\:]?\\d{2})')
        self.validate_required(self.create_end_time, 'create_end_time')
        if self.create_end_time is not None:
            self.validate_pattern(self.create_end_time, 'create_end_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}([Z]|([\\.]\\d{1,9})?[\\+]\\d{2}[\\:]?\\d{2})')
        self.validate_required(self.is_create_time_sort_desc, 'is_create_time_sort_desc')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.ip_name is not None:
            result['ip_name'] = self.ip_name
        if self.ip_id is not None:
            result['ip_id'] = self.ip_id
        if self.approval_status is not None:
            result['approval_status'] = self.approval_status
        if self.page_size is not None:
            result['page_size'] = self.page_size
        if self.page_index is not None:
            result['page_index'] = self.page_index
        if self.ip_type is not None:
            result['ip_type'] = self.ip_type
        if self.audience_group is not None:
            result['audience_group'] = self.audience_group
        if self.create_begin_time is not None:
            result['create_begin_time'] = self.create_begin_time
        if self.create_end_time is not None:
            result['create_end_time'] = self.create_end_time
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.is_create_time_sort_desc is not None:
            result['is_create_time_sort_desc'] = self.is_create_time_sort_desc
        if self.channel_name is not None:
            result['channel_name'] = self.channel_name
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('ip_name') is not None:
            self.ip_name = m.get('ip_name')
        if m.get('ip_id') is not None:
            self.ip_id = m.get('ip_id')
        if m.get('approval_status') is not None:
            self.approval_status = m.get('approval_status')
        if m.get('page_size') is not None:
            self.page_size = m.get('page_size')
        if m.get('page_index') is not None:
            self.page_index = m.get('page_index')
        if m.get('ip_type') is not None:
            self.ip_type = m.get('ip_type')
        if m.get('audience_group') is not None:
            self.audience_group = m.get('audience_group')
        if m.get('create_begin_time') is not None:
            self.create_begin_time = m.get('create_begin_time')
        if m.get('create_end_time') is not None:
            self.create_end_time = m.get('create_end_time')
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('is_create_time_sort_desc') is not None:
            self.is_create_time_sort_desc = m.get('is_create_time_sort_desc')
        if m.get('channel_name') is not None:
            self.channel_name = m.get('channel_name')
        return self


class BatchqueryIpApprovalResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        ip_list: List[IpBasicInfo] = None,
        all_count: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # ip信息
        self.ip_list = ip_list
        # 结果总数，不是列表值，用于分页
        self.all_count = all_count

    def validate(self):
        if self.ip_list:
            for k in self.ip_list:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        result['ip_list'] = []
        if self.ip_list is not None:
            for k in self.ip_list:
                result['ip_list'].append(k.to_map() if k else None)
        if self.all_count is not None:
            result['all_count'] = self.all_count
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        self.ip_list = []
        if m.get('ip_list') is not None:
            for k in m.get('ip_list'):
                temp_model = IpBasicInfo()
                self.ip_list.append(temp_model.from_map(k))
        if m.get('all_count') is not None:
            self.all_count = m.get('all_count')
        return self


class ConfirmIpAccountRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        account_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础参数
        self.base_request = base_request
        # 版权方的链上账户Id
        self.account_id = account_id

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.account_id, 'account_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        return self


class ConfirmIpAccountResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class RefuseIpAccountRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        account_id: str = None,
        reject_reason: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础参数
        self.base_request = base_request
        # 版权方的链上账户Id
        self.account_id = account_id
        # 拒绝原因
        self.reject_reason = reject_reason

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.reject_reason, 'reject_reason')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.reject_reason is not None:
            result['reject_reason'] = self.reject_reason
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('reject_reason') is not None:
            self.reject_reason = m.get('reject_reason')
        return self


class RefuseIpAccountResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class PullIpAccountRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        account_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础参数
        self.base_request = base_request
        # 版权方的链上账户Id
        self.account_id = account_id

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.account_id, 'account_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        return self


class PullIpAccountResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        alipay_login_name: str = None,
        merchant_alias_name: str = None,
        merchant_type: int = None,
        merchant_cert_type: int = None,
        merchant_cert_number: str = None,
        merchant_cert_image: str = None,
        merchant_sign_image: str = None,
        mcc: str = None,
        legal_name: str = None,
        legal_cert_no: str = None,
        address_info: IPAddressInfo = None,
        settle_rule: IPSettleRule = None,
        contact_info: IPContactInfo = None,
        card_info: IPCardInfo = None,
        create_time: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 支付宝的登陆用户名(必须实名制)
        self.alipay_login_name = alipay_login_name
        # 商户别名, 会展示在账单以及支付结果页中
        self.merchant_alias_name = merchant_alias_name
        # 商户类型(本期仅支持: 1:企业, 6:个人商户)
        self.merchant_type = merchant_type
        # 商户证件类型(本期仅支持: 201: 营业执照, 100: 个人商户身份证) 如果merchant_type为企业, 需要传入201; 如果merchant_type为个人, 需要传入100
        self.merchant_cert_type = merchant_cert_type
        # 商户证件编号(企业提供营业执照),本期人工审核
        self.merchant_cert_number = merchant_cert_number
        # 商户营业执照的图片地址,本期人工审核
        self.merchant_cert_image = merchant_cert_image
        # 税务登记证明的图片,本期人工审核
        self.merchant_sign_image = merchant_sign_image
        # 商户类别码mcc，参见https://gw.alipayobjects.com/os/bmw-prod/05c9a32e-42d1-436b-ace7-13101d91f672.xlsx
        self.mcc = mcc
        # 商户法人名称, merchant_type = 01时必填
        self.legal_name = legal_name
        # 商户法人身份证号码, merchant_type = 1时必填
        self.legal_cert_no = legal_cert_no
        # 商户经营地址
        self.address_info = address_info
        # 默认结算规则
        self.settle_rule = settle_rule
        # 商户联系人信息
        self.contact_info = contact_info
        # 银行卡结算信息, 结算到银行卡时必填, 当前仅支持填入一张卡
        self.card_info = card_info
        # 创建账户时间
        self.create_time = create_time

    def validate(self):
        if self.address_info:
            self.address_info.validate()
        if self.settle_rule:
            self.settle_rule.validate()
        if self.contact_info:
            self.contact_info.validate()
        if self.card_info:
            self.card_info.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.alipay_login_name is not None:
            result['alipay_login_name'] = self.alipay_login_name
        if self.merchant_alias_name is not None:
            result['merchant_alias_name'] = self.merchant_alias_name
        if self.merchant_type is not None:
            result['merchant_type'] = self.merchant_type
        if self.merchant_cert_type is not None:
            result['merchant_cert_type'] = self.merchant_cert_type
        if self.merchant_cert_number is not None:
            result['merchant_cert_number'] = self.merchant_cert_number
        if self.merchant_cert_image is not None:
            result['merchant_cert_image'] = self.merchant_cert_image
        if self.merchant_sign_image is not None:
            result['merchant_sign_image'] = self.merchant_sign_image
        if self.mcc is not None:
            result['mcc'] = self.mcc
        if self.legal_name is not None:
            result['legal_name'] = self.legal_name
        if self.legal_cert_no is not None:
            result['legal_cert_no'] = self.legal_cert_no
        if self.address_info is not None:
            result['address_info'] = self.address_info.to_map()
        if self.settle_rule is not None:
            result['settle_rule'] = self.settle_rule.to_map()
        if self.contact_info is not None:
            result['contact_info'] = self.contact_info.to_map()
        if self.card_info is not None:
            result['card_info'] = self.card_info.to_map()
        if self.create_time is not None:
            result['create_time'] = self.create_time
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('alipay_login_name') is not None:
            self.alipay_login_name = m.get('alipay_login_name')
        if m.get('merchant_alias_name') is not None:
            self.merchant_alias_name = m.get('merchant_alias_name')
        if m.get('merchant_type') is not None:
            self.merchant_type = m.get('merchant_type')
        if m.get('merchant_cert_type') is not None:
            self.merchant_cert_type = m.get('merchant_cert_type')
        if m.get('merchant_cert_number') is not None:
            self.merchant_cert_number = m.get('merchant_cert_number')
        if m.get('merchant_cert_image') is not None:
            self.merchant_cert_image = m.get('merchant_cert_image')
        if m.get('merchant_sign_image') is not None:
            self.merchant_sign_image = m.get('merchant_sign_image')
        if m.get('mcc') is not None:
            self.mcc = m.get('mcc')
        if m.get('legal_name') is not None:
            self.legal_name = m.get('legal_name')
        if m.get('legal_cert_no') is not None:
            self.legal_cert_no = m.get('legal_cert_no')
        if m.get('address_info') is not None:
            temp_model = IPAddressInfo()
            self.address_info = temp_model.from_map(m['address_info'])
        if m.get('settle_rule') is not None:
            temp_model = IPSettleRule()
            self.settle_rule = temp_model.from_map(m['settle_rule'])
        if m.get('contact_info') is not None:
            temp_model = IPContactInfo()
            self.contact_info = temp_model.from_map(m['contact_info'])
        if m.get('card_info') is not None:
            temp_model = IPCardInfo()
            self.card_info = temp_model.from_map(m['card_info'])
        if m.get('create_time') is not None:
            self.create_time = m.get('create_time')
        return self


class QueryIpMccRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        memo: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础字段
        self.base_request = base_request
        # 备注信息
        self.memo = memo

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.memo is not None:
            result['memo'] = self.memo
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        return self


class QueryIpMccResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        mcc_list: List[IPMCC] = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # mcc类别列表
        self.mcc_list = mcc_list

    def validate(self):
        if self.mcc_list:
            for k in self.mcc_list:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        result['mcc_list'] = []
        if self.mcc_list is not None:
            for k in self.mcc_list:
                result['mcc_list'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        self.mcc_list = []
        if m.get('mcc_list') is not None:
            for k in m.get('mcc_list'):
                temp_model = IPMCC()
                self.mcc_list.append(temp_model.from_map(k))
        return self


class QueryIpTypeRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        memo: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础参数
        self.base_request = base_request
        # 备注信息
        self.memo = memo

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.memo is not None:
            result['memo'] = self.memo
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        return self


class QueryIpTypeResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        type: List[str] = None,
        audience_group: List[str] = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # ip的type列表
        self.type = type
        # ip的受众人群
        self.audience_group = audience_group

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.type is not None:
            result['type'] = self.type
        if self.audience_group is not None:
            result['audience_group'] = self.audience_group
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('type') is not None:
            self.type = m.get('type')
        if m.get('audience_group') is not None:
            self.audience_group = m.get('audience_group')
        return self


class BatchqueryIpApprovalandchannelRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        ip_name: str = None,
        ip_id: str = None,
        approval_status: int = None,
        ip_type: str = None,
        audience_group: str = None,
        account_id: str = None,
        is_create_time_sort_desc: bool = None,
        page_size: int = None,
        page_index: int = None,
        create_begin_time: str = None,
        create_end_time: str = None,
        channel_name: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础信息
        self.base_request = base_request
        # ip的名字
        self.ip_name = ip_name
        # ip的id
        self.ip_id = ip_id
        # 审批状态
        self.approval_status = approval_status
        # ip类型
        self.ip_type = ip_type
        # 受众人群
        self.audience_group = audience_group
        # 归属账户
        self.account_id = account_id
        # 是否需要按照创建时间倒序排序
        # 
        self.is_create_time_sort_desc = is_create_time_sort_desc
        # 分页大小
        self.page_size = page_size
        # 分页索引
        self.page_index = page_index
        # 开始时间
        self.create_begin_time = create_begin_time
        # 结束时间
        self.create_end_time = create_end_time
        # 渠道名称
        self.channel_name = channel_name

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.is_create_time_sort_desc, 'is_create_time_sort_desc')
        self.validate_required(self.page_size, 'page_size')
        self.validate_required(self.page_index, 'page_index')
        self.validate_required(self.create_begin_time, 'create_begin_time')
        if self.create_begin_time is not None:
            self.validate_pattern(self.create_begin_time, 'create_begin_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}([Z]|([\\.]\\d{1,9})?[\\+]\\d{2}[\\:]?\\d{2})')
        self.validate_required(self.create_end_time, 'create_end_time')
        if self.create_end_time is not None:
            self.validate_pattern(self.create_end_time, 'create_end_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}([Z]|([\\.]\\d{1,9})?[\\+]\\d{2}[\\:]?\\d{2})')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.ip_name is not None:
            result['ip_name'] = self.ip_name
        if self.ip_id is not None:
            result['ip_id'] = self.ip_id
        if self.approval_status is not None:
            result['approval_status'] = self.approval_status
        if self.ip_type is not None:
            result['ip_type'] = self.ip_type
        if self.audience_group is not None:
            result['audience_group'] = self.audience_group
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.is_create_time_sort_desc is not None:
            result['is_create_time_sort_desc'] = self.is_create_time_sort_desc
        if self.page_size is not None:
            result['page_size'] = self.page_size
        if self.page_index is not None:
            result['page_index'] = self.page_index
        if self.create_begin_time is not None:
            result['create_begin_time'] = self.create_begin_time
        if self.create_end_time is not None:
            result['create_end_time'] = self.create_end_time
        if self.channel_name is not None:
            result['channel_name'] = self.channel_name
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('ip_name') is not None:
            self.ip_name = m.get('ip_name')
        if m.get('ip_id') is not None:
            self.ip_id = m.get('ip_id')
        if m.get('approval_status') is not None:
            self.approval_status = m.get('approval_status')
        if m.get('ip_type') is not None:
            self.ip_type = m.get('ip_type')
        if m.get('audience_group') is not None:
            self.audience_group = m.get('audience_group')
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('is_create_time_sort_desc') is not None:
            self.is_create_time_sort_desc = m.get('is_create_time_sort_desc')
        if m.get('page_size') is not None:
            self.page_size = m.get('page_size')
        if m.get('page_index') is not None:
            self.page_index = m.get('page_index')
        if m.get('create_begin_time') is not None:
            self.create_begin_time = m.get('create_begin_time')
        if m.get('create_end_time') is not None:
            self.create_end_time = m.get('create_end_time')
        if m.get('channel_name') is not None:
            self.channel_name = m.get('channel_name')
        return self


class BatchqueryIpApprovalandchannelResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        ip_list: List[IpAllInfo] = None,
        all_count: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # ip信息
        self.ip_list = ip_list
        # 总数
        self.all_count = all_count

    def validate(self):
        if self.ip_list:
            for k in self.ip_list:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        result['ip_list'] = []
        if self.ip_list is not None:
            for k in self.ip_list:
                result['ip_list'].append(k.to_map() if k else None)
        if self.all_count is not None:
            result['all_count'] = self.all_count
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        self.ip_list = []
        if m.get('ip_list') is not None:
            for k in m.get('ip_list'):
                temp_model = IpAllInfo()
                self.ip_list.append(temp_model.from_map(k))
        if m.get('all_count') is not None:
            self.all_count = m.get('all_count')
        return self


class BatchqueryIpAccountRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        account_ids: List[str] = None,
        channel_name: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础参数
        # 
        self.base_request = base_request
        # 账户Id列表(单次不能超过50个)
        self.account_ids = account_ids
        # 渠道名称
        self.channel_name = channel_name

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.account_ids, 'account_ids')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.account_ids is not None:
            result['account_ids'] = self.account_ids
        if self.channel_name is not None:
            result['channel_name'] = self.channel_name
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('account_ids') is not None:
            self.account_ids = m.get('account_ids')
        if m.get('channel_name') is not None:
            self.channel_name = m.get('channel_name')
        return self


class BatchqueryIpAccountResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        apply_infos: List[IPMerchantApplyInfo] = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 批量查询商家信息
        self.apply_infos = apply_infos

    def validate(self):
        if self.apply_infos:
            for k in self.apply_infos:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        result['apply_infos'] = []
        if self.apply_infos is not None:
            for k in self.apply_infos:
                result['apply_infos'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        self.apply_infos = []
        if m.get('apply_infos') is not None:
            for k in m.get('apply_infos'):
                temp_model = IPMerchantApplyInfo()
                self.apply_infos.append(temp_model.from_map(k))
        return self


class BatchqueryIpSellerRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        channel_name: str = None,
        page_size: int = None,
        page_index: int = None,
        account_id: str = None,
        role: int = None,
        contact_name: str = None,
        contact_mobile: str = None,
        status_list: List[int] = None,
        sort_order: str = None,
        create_start_time: int = None,
        create_end_time: int = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础信息
        self.base_request = base_request
        # 不同的平台标识
        self.channel_name = channel_name
        # 分页大小
        self.page_size = page_size
        # 分页索引
        self.page_index = page_index
        # 账户链上ID
        self.account_id = account_id
        # 1 版权方，2 商户
        self.role = role
        # 联系人名称
        self.contact_name = contact_name
        # 联系人电话
        self.contact_mobile = contact_mobile
        # 账户状态列表
        self.status_list = status_list
        # 排序
        self.sort_order = sort_order
        # 筛选更新时间范围，开始区间
        self.create_start_time = create_start_time
        # 筛选更新时间范围，结束区间
        self.create_end_time = create_end_time

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.channel_name, 'channel_name')
        self.validate_required(self.page_size, 'page_size')
        self.validate_required(self.page_index, 'page_index')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.channel_name is not None:
            result['channel_name'] = self.channel_name
        if self.page_size is not None:
            result['page_size'] = self.page_size
        if self.page_index is not None:
            result['page_index'] = self.page_index
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.role is not None:
            result['role'] = self.role
        if self.contact_name is not None:
            result['contact_name'] = self.contact_name
        if self.contact_mobile is not None:
            result['contact_mobile'] = self.contact_mobile
        if self.status_list is not None:
            result['status_list'] = self.status_list
        if self.sort_order is not None:
            result['sort_order'] = self.sort_order
        if self.create_start_time is not None:
            result['create_start_time'] = self.create_start_time
        if self.create_end_time is not None:
            result['create_end_time'] = self.create_end_time
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('channel_name') is not None:
            self.channel_name = m.get('channel_name')
        if m.get('page_size') is not None:
            self.page_size = m.get('page_size')
        if m.get('page_index') is not None:
            self.page_index = m.get('page_index')
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('role') is not None:
            self.role = m.get('role')
        if m.get('contact_name') is not None:
            self.contact_name = m.get('contact_name')
        if m.get('contact_mobile') is not None:
            self.contact_mobile = m.get('contact_mobile')
        if m.get('status_list') is not None:
            self.status_list = m.get('status_list')
        if m.get('sort_order') is not None:
            self.sort_order = m.get('sort_order')
        if m.get('create_start_time') is not None:
            self.create_start_time = m.get('create_start_time')
        if m.get('create_end_time') is not None:
            self.create_end_time = m.get('create_end_time')
        return self


class BatchqueryIpSellerResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        all_count: int = None,
        apply_list: List[IPApplyInfo] = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 结果总数，不是列表值，用于分页
        # 
        self.all_count = all_count
        # 版权方申请列表
        self.apply_list = apply_list

    def validate(self):
        if self.apply_list:
            for k in self.apply_list:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.all_count is not None:
            result['all_count'] = self.all_count
        result['apply_list'] = []
        if self.apply_list is not None:
            for k in self.apply_list:
                result['apply_list'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('all_count') is not None:
            self.all_count = m.get('all_count')
        self.apply_list = []
        if m.get('apply_list') is not None:
            for k in m.get('apply_list'):
                temp_model = IPApplyInfo()
                self.apply_list.append(temp_model.from_map(k))
        return self


class ApplyIpCodeRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        account_id: str = None,
        order_id: str = None,
        count: int = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础参数
        self.base_request = base_request
        # IP商家的链上账户ID
        self.account_id = account_id
        # 套餐交易/授权交易的订单ID
        self.order_id = order_id
        # 申请数量
        self.count = count

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.order_id, 'order_id')
        self.validate_required(self.count, 'count')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.order_id is not None:
            result['order_id'] = self.order_id
        if self.count is not None:
            result['count'] = self.count
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('order_id') is not None:
            self.order_id = m.get('order_id')
        if m.get('count') is not None:
            self.count = m.get('count')
        return self


class ApplyIpCodeResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        code_batch_id: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 正版码的批次ID
        self.code_batch_id = code_batch_id

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.code_batch_id is not None:
            result['code_batch_id'] = self.code_batch_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('code_batch_id') is not None:
            self.code_batch_id = m.get('code_batch_id')
        return self


class PagequeryIpCodeRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        code_batch_id: str = None,
        page_index: int = None,
        page_size: int = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础参数
        self.base_request = base_request
        # 正版码批次编码
        self.code_batch_id = code_batch_id
        # 分页参数:页码
        self.page_index = page_index
        # 分页参数:每页条目数(请小于2000)
        self.page_size = page_size

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.code_batch_id, 'code_batch_id')
        self.validate_required(self.page_index, 'page_index')
        self.validate_required(self.page_size, 'page_size')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.code_batch_id is not None:
            result['code_batch_id'] = self.code_batch_id
        if self.page_index is not None:
            result['page_index'] = self.page_index
        if self.page_size is not None:
            result['page_size'] = self.page_size
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('code_batch_id') is not None:
            self.code_batch_id = m.get('code_batch_id')
        if m.get('page_index') is not None:
            self.page_index = m.get('page_index')
        if m.get('page_size') is not None:
            self.page_size = m.get('page_size')
        return self


class PagequeryIpCodeResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        code_list: List[str] = None,
        order_id: str = None,
        buyer_account_id: str = None,
        seller_account_id: str = None,
        ip_id: str = None,
        ip_name: str = None,
        ip_image: str = None,
        ip_desc: str = None,
        expired_date: int = None,
        total_count: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 正版码列表(小程序扫描不可跳转的码)
        # 注意: 这个接口查到的码为原始编码, 小程序扫描无法跳转, IPMart不适用!!!
        self.code_list = code_list
        # 交易订单ID
        self.order_id = order_id
        # IP商家的链上账户ID
        self.buyer_account_id = buyer_account_id
        # IP版权方的链上账户ID
        self.seller_account_id = seller_account_id
        # IPID
        self.ip_id = ip_id
        # IP名称
        self.ip_name = ip_name
        # IP主图的OSS地址
        self.ip_image = ip_image
        # IP描述
        self.ip_desc = ip_desc
        # 该批次正版码的过期时间戳(毫秒)
        self.expired_date = expired_date
        # 总数量
        self.total_count = total_count

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.code_list is not None:
            result['code_list'] = self.code_list
        if self.order_id is not None:
            result['order_id'] = self.order_id
        if self.buyer_account_id is not None:
            result['buyer_account_id'] = self.buyer_account_id
        if self.seller_account_id is not None:
            result['seller_account_id'] = self.seller_account_id
        if self.ip_id is not None:
            result['ip_id'] = self.ip_id
        if self.ip_name is not None:
            result['ip_name'] = self.ip_name
        if self.ip_image is not None:
            result['ip_image'] = self.ip_image
        if self.ip_desc is not None:
            result['ip_desc'] = self.ip_desc
        if self.expired_date is not None:
            result['expired_date'] = self.expired_date
        if self.total_count is not None:
            result['total_count'] = self.total_count
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('code_list') is not None:
            self.code_list = m.get('code_list')
        if m.get('order_id') is not None:
            self.order_id = m.get('order_id')
        if m.get('buyer_account_id') is not None:
            self.buyer_account_id = m.get('buyer_account_id')
        if m.get('seller_account_id') is not None:
            self.seller_account_id = m.get('seller_account_id')
        if m.get('ip_id') is not None:
            self.ip_id = m.get('ip_id')
        if m.get('ip_name') is not None:
            self.ip_name = m.get('ip_name')
        if m.get('ip_image') is not None:
            self.ip_image = m.get('ip_image')
        if m.get('ip_desc') is not None:
            self.ip_desc = m.get('ip_desc')
        if m.get('expired_date') is not None:
            self.expired_date = m.get('expired_date')
        if m.get('total_count') is not None:
            self.total_count = m.get('total_count')
        return self


class CheckIpCodeRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        code: str = None,
        user_id: str = None,
        user_name: str = None,
        phone_number: str = None,
        gps: str = None,
        avatar: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础参数
        self.base_request = base_request
        # 正版码的编码
        self.code = code
        # 扫码用户的ID
        self.user_id = user_id
        # 扫码用户的名称
        self.user_name = user_name
        # 扫码用户的手机号
        self.phone_number = phone_number
        # 扫码用户的位置信息
        self.gps = gps
        # 用户头像地址
        self.avatar = avatar

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.code, 'code')
        self.validate_required(self.user_id, 'user_id')
        self.validate_required(self.user_name, 'user_name')
        self.validate_required(self.avatar, 'avatar')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.code is not None:
            result['code'] = self.code
        if self.user_id is not None:
            result['user_id'] = self.user_id
        if self.user_name is not None:
            result['user_name'] = self.user_name
        if self.phone_number is not None:
            result['phone_number'] = self.phone_number
        if self.gps is not None:
            result['gps'] = self.gps
        if self.avatar is not None:
            result['avatar'] = self.avatar
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('code') is not None:
            self.code = m.get('code')
        if m.get('user_id') is not None:
            self.user_id = m.get('user_id')
        if m.get('user_name') is not None:
            self.user_name = m.get('user_name')
        if m.get('phone_number') is not None:
            self.phone_number = m.get('phone_number')
        if m.get('gps') is not None:
            self.gps = m.get('gps')
        if m.get('avatar') is not None:
            self.avatar = m.get('avatar')
        return self


class CheckIpCodeResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        scanned_count: int = None,
        scanned_list: List[IPCodeScannedInfo] = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 被扫描的次数(包含本次)
        self.scanned_count = scanned_count
        # 扫描历史列表(仅展示最近扫描的50次信息)
        self.scanned_list = scanned_list

    def validate(self):
        if self.scanned_list:
            for k in self.scanned_list:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.scanned_count is not None:
            result['scanned_count'] = self.scanned_count
        result['scanned_list'] = []
        if self.scanned_list is not None:
            for k in self.scanned_list:
                result['scanned_list'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('scanned_count') is not None:
            self.scanned_count = m.get('scanned_count')
        self.scanned_list = []
        if m.get('scanned_list') is not None:
            for k in m.get('scanned_list'):
                temp_model = IPCodeScannedInfo()
                self.scanned_list.append(temp_model.from_map(k))
        return self


class ConfirmIpUpdateapprovalRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        ip_id: str = None,
        is_approval: bool = None,
        approval_comments: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础字段
        self.base_request = base_request
        # ip的id
        self.ip_id = ip_id
        # 是否审批通过
        self.is_approval = is_approval
        # 审批信息
        self.approval_comments = approval_comments

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.ip_id, 'ip_id')
        self.validate_required(self.is_approval, 'is_approval')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.ip_id is not None:
            result['ip_id'] = self.ip_id
        if self.is_approval is not None:
            result['is_approval'] = self.is_approval
        if self.approval_comments is not None:
            result['approval_comments'] = self.approval_comments
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('ip_id') is not None:
            self.ip_id = m.get('ip_id')
        if m.get('is_approval') is not None:
            self.is_approval = m.get('is_approval')
        if m.get('approval_comments') is not None:
            self.approval_comments = m.get('approval_comments')
        return self


class ConfirmIpUpdateapprovalResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class SetIpSkuRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        ip_id: str = None,
        channel_name: str = None,
        skus: List[IpSkuEmphasisInfo] = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础字段
        self.base_request = base_request
        # ip的id
        self.ip_id = ip_id
        # 渠道名字
        self.channel_name = channel_name
        # sku数组
        self.skus = skus

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.ip_id, 'ip_id')
        self.validate_required(self.channel_name, 'channel_name')
        self.validate_required(self.skus, 'skus')
        if self.skus:
            for k in self.skus:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.ip_id is not None:
            result['ip_id'] = self.ip_id
        if self.channel_name is not None:
            result['channel_name'] = self.channel_name
        result['skus'] = []
        if self.skus is not None:
            for k in self.skus:
                result['skus'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('ip_id') is not None:
            self.ip_id = m.get('ip_id')
        if m.get('channel_name') is not None:
            self.channel_name = m.get('channel_name')
        self.skus = []
        if m.get('skus') is not None:
            for k in m.get('skus'):
                temp_model = IpSkuEmphasisInfo()
                self.skus.append(temp_model.from_map(k))
        return self


class SetIpSkuResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class QueryIpGoodsupdateRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        ip_ids: List[str] = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础字段
        self.base_request = base_request
        # ipid的列表，最多20个
        self.ip_ids = ip_ids

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.ip_ids, 'ip_ids')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.ip_ids is not None:
            result['ip_ids'] = self.ip_ids
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('ip_ids') is not None:
            self.ip_ids = m.get('ip_ids')
        return self


class QueryIpGoodsupdateResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        ip_list: List[IpBasicInfo] = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # ip的更新数据
        self.ip_list = ip_list

    def validate(self):
        if self.ip_list:
            for k in self.ip_list:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        result['ip_list'] = []
        if self.ip_list is not None:
            for k in self.ip_list:
                result['ip_list'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        self.ip_list = []
        if m.get('ip_list') is not None:
            for k in m.get('ip_list'):
                temp_model = IpBasicInfo()
                self.ip_list.append(temp_model.from_map(k))
        return self


class PagequeryIpBillRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        ip_order_id: str = None,
        bill_status: int = None,
        order_by: str = None,
        order: str = None,
        page_number: int = None,
        page_size: int = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础请求参数
        self.base_request = base_request
        # 订单ID
        self.ip_order_id = ip_order_id
        # 账单状态，预留字段
        self.bill_status = bill_status
        # 排序字段
        self.order_by = order_by
        # 排序顺序：正序还是倒序
        self.order = order
        # 页码
        self.page_number = page_number
        # 每页数据量大小
        self.page_size = page_size

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.ip_order_id, 'ip_order_id')
        self.validate_required(self.order_by, 'order_by')
        self.validate_required(self.order, 'order')
        self.validate_required(self.page_number, 'page_number')
        self.validate_required(self.page_size, 'page_size')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.ip_order_id is not None:
            result['ip_order_id'] = self.ip_order_id
        if self.bill_status is not None:
            result['bill_status'] = self.bill_status
        if self.order_by is not None:
            result['order_by'] = self.order_by
        if self.order is not None:
            result['order'] = self.order
        if self.page_number is not None:
            result['page_number'] = self.page_number
        if self.page_size is not None:
            result['page_size'] = self.page_size
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('ip_order_id') is not None:
            self.ip_order_id = m.get('ip_order_id')
        if m.get('bill_status') is not None:
            self.bill_status = m.get('bill_status')
        if m.get('order_by') is not None:
            self.order_by = m.get('order_by')
        if m.get('order') is not None:
            self.order = m.get('order')
        if m.get('page_number') is not None:
            self.page_number = m.get('page_number')
        if m.get('page_size') is not None:
            self.page_size = m.get('page_size')
        return self


class PagequeryIpBillResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        page_number: int = None,
        page_size: int = None,
        select_bill_count: int = None,
        bill_list: List[IPBill] = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 页码
        self.page_number = page_number
        # 页面数据量大小
        self.page_size = page_size
        # 筛选条件下账单总数
        self.select_bill_count = select_bill_count
        # 账单信息列表
        self.bill_list = bill_list

    def validate(self):
        if self.bill_list:
            for k in self.bill_list:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.page_number is not None:
            result['page_number'] = self.page_number
        if self.page_size is not None:
            result['page_size'] = self.page_size
        if self.select_bill_count is not None:
            result['select_bill_count'] = self.select_bill_count
        result['bill_list'] = []
        if self.bill_list is not None:
            for k in self.bill_list:
                result['bill_list'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('page_number') is not None:
            self.page_number = m.get('page_number')
        if m.get('page_size') is not None:
            self.page_size = m.get('page_size')
        if m.get('select_bill_count') is not None:
            self.select_bill_count = m.get('select_bill_count')
        self.bill_list = []
        if m.get('bill_list') is not None:
            for k in m.get('bill_list'):
                temp_model = IPBill()
                self.bill_list.append(temp_model.from_map(k))
        return self


class QueryIpSkuconfigRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        channel_name: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础字段
        self.base_request = base_request
        # 渠道名称
        self.channel_name = channel_name

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.channel_name, 'channel_name')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.channel_name is not None:
            result['channel_name'] = self.channel_name
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('channel_name') is not None:
            self.channel_name = m.get('channel_name')
        return self


class QueryIpSkuconfigResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        skus: List[IpSkuConfigWithLevel] = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # sku信息
        self.skus = skus

    def validate(self):
        if self.skus:
            for k in self.skus:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        result['skus'] = []
        if self.skus is not None:
            for k in self.skus:
                result['skus'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        self.skus = []
        if m.get('skus') is not None:
            for k in m.get('skus'):
                temp_model = IpSkuConfigWithLevel()
                self.skus.append(temp_model.from_map(k))
        return self


class ImportIpAccountRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        alipay_login_name: str = None,
        merchant_type: int = None,
        merchant_alias_name: str = None,
        legal_name: str = None,
        legal_cert_no: str = None,
        settle_target: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础入参
        self.base_request = base_request
        # 支付宝的登陆用户名(必须实名制)
        self.alipay_login_name = alipay_login_name
        # 商户类型(本期仅支持: 1:企业, 6:个人商户)
        self.merchant_type = merchant_type
        # 商户别名, 会展示在账单以及支付结果页中
        self.merchant_alias_name = merchant_alias_name
        # 商户法人名称, merchant_type = 1时必填
        self.legal_name = legal_name
        # 商户法人身份证号码, merchant_type = 1时必填
        self.legal_cert_no = legal_cert_no
        # 结算目标账户(银行卡/支付宝)
        self.settle_target = settle_target

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.alipay_login_name, 'alipay_login_name')
        self.validate_required(self.merchant_type, 'merchant_type')
        self.validate_required(self.merchant_alias_name, 'merchant_alias_name')
        self.validate_required(self.settle_target, 'settle_target')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.alipay_login_name is not None:
            result['alipay_login_name'] = self.alipay_login_name
        if self.merchant_type is not None:
            result['merchant_type'] = self.merchant_type
        if self.merchant_alias_name is not None:
            result['merchant_alias_name'] = self.merchant_alias_name
        if self.legal_name is not None:
            result['legal_name'] = self.legal_name
        if self.legal_cert_no is not None:
            result['legal_cert_no'] = self.legal_cert_no
        if self.settle_target is not None:
            result['settle_target'] = self.settle_target
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('alipay_login_name') is not None:
            self.alipay_login_name = m.get('alipay_login_name')
        if m.get('merchant_type') is not None:
            self.merchant_type = m.get('merchant_type')
        if m.get('merchant_alias_name') is not None:
            self.merchant_alias_name = m.get('merchant_alias_name')
        if m.get('legal_name') is not None:
            self.legal_name = m.get('legal_name')
        if m.get('legal_cert_no') is not None:
            self.legal_cert_no = m.get('legal_cert_no')
        if m.get('settle_target') is not None:
            self.settle_target = m.get('settle_target')
        return self


class ImportIpAccountResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        account_id: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 导入后的新链上账户Id
        self.account_id = account_id

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.account_id is not None:
            result['account_id'] = self.account_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        return self


class RemoveIpSkuRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        ip_id: str = None,
        channel_name: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础字段
        self.base_request = base_request
        # IP id
        self.ip_id = ip_id
        # 渠道名称
        self.channel_name = channel_name

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.ip_id, 'ip_id')
        self.validate_required(self.channel_name, 'channel_name')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.ip_id is not None:
            result['ip_id'] = self.ip_id
        if self.channel_name is not None:
            result['channel_name'] = self.channel_name
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('ip_id') is not None:
            self.ip_id = m.get('ip_id')
        if m.get('channel_name') is not None:
            self.channel_name = m.get('channel_name')
        return self


class RemoveIpSkuResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class CreateIpSuperviseapproveRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        order_id: str = None,
        ext_info: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础字段
        self.base_request = base_request
        # 订单id
        self.order_id = order_id
        # 监修报审内容，业务相关字段自行组织成json，统一存储
        self.ext_info = ext_info

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.order_id, 'order_id')
        self.validate_required(self.ext_info, 'ext_info')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.order_id is not None:
            result['order_id'] = self.order_id
        if self.ext_info is not None:
            result['ext_info'] = self.ext_info
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('order_id') is not None:
            self.order_id = m.get('order_id')
        if m.get('ext_info') is not None:
            self.ext_info = m.get('ext_info')
        return self


class CreateIpSuperviseapproveResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class ConfirmIpSuperviseapproveRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        order_id: str = None,
        stage: int = None,
        is_approval: bool = None,
        approval_comments: str = None,
        approval_ext_info: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础字段
        self.base_request = base_request
        # 监修报审关联的订单id
        self.order_id = order_id
        # 当前期望的审批阶段（用于校验）
        self.stage = stage
        # 是否审批通过
        self.is_approval = is_approval
        # 审批备注
        self.approval_comments = approval_comments
        # 审批额外信息
        self.approval_ext_info = approval_ext_info

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.order_id, 'order_id')
        self.validate_required(self.stage, 'stage')
        self.validate_required(self.is_approval, 'is_approval')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.order_id is not None:
            result['order_id'] = self.order_id
        if self.stage is not None:
            result['stage'] = self.stage
        if self.is_approval is not None:
            result['is_approval'] = self.is_approval
        if self.approval_comments is not None:
            result['approval_comments'] = self.approval_comments
        if self.approval_ext_info is not None:
            result['approval_ext_info'] = self.approval_ext_info
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('order_id') is not None:
            self.order_id = m.get('order_id')
        if m.get('stage') is not None:
            self.stage = m.get('stage')
        if m.get('is_approval') is not None:
            self.is_approval = m.get('is_approval')
        if m.get('approval_comments') is not None:
            self.approval_comments = m.get('approval_comments')
        if m.get('approval_ext_info') is not None:
            self.approval_ext_info = m.get('approval_ext_info')
        return self


class ConfirmIpSuperviseapproveResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class PushIpSuperviseapproveRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        order_id: str = None,
        stage: int = None,
        ext_info: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础字段
        self.base_request = base_request
        # 关联的订单id
        self.order_id = order_id
        # 当前期望的阶段（用于校验，若是重新提交，则阶段值相等，若推进下一阶段，则阶段值+1）
        self.stage = stage
        # 监修报审的阶段具体内容，组织成json保存
        self.ext_info = ext_info

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.order_id, 'order_id')
        self.validate_required(self.stage, 'stage')
        self.validate_required(self.ext_info, 'ext_info')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.order_id is not None:
            result['order_id'] = self.order_id
        if self.stage is not None:
            result['stage'] = self.stage
        if self.ext_info is not None:
            result['ext_info'] = self.ext_info
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('order_id') is not None:
            self.order_id = m.get('order_id')
        if m.get('stage') is not None:
            self.stage = m.get('stage')
        if m.get('ext_info') is not None:
            self.ext_info = m.get('ext_info')
        return self


class PushIpSuperviseapproveResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class QueryIpSuperviseapproveRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        order_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础字段
        self.base_request = base_request
        # 关联的订单id
        self.order_id = order_id

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.order_id, 'order_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.order_id is not None:
            result['order_id'] = self.order_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('order_id') is not None:
            self.order_id = m.get('order_id')
        return self


class QueryIpSuperviseapproveResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        supervise_approve: SuperviseApprove = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 监修报审最新阶段的详情
        self.supervise_approve = supervise_approve

    def validate(self):
        if self.supervise_approve:
            self.supervise_approve.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.supervise_approve is not None:
            result['supervise_approve'] = self.supervise_approve.to_map()
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('supervise_approve') is not None:
            temp_model = SuperviseApprove()
            self.supervise_approve = temp_model.from_map(m['supervise_approve'])
        return self


class ReceiveIpCodeRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        code: str = None,
        user_id: str = None,
        user_name: str = None,
        phone_number: str = None,
        gps: str = None,
        avatar: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础参数
        self.base_request = base_request
        # 正版码的编码
        self.code = code
        # 领取用户的ID
        self.user_id = user_id
        # 领取用户的名称
        self.user_name = user_name
        # 领取用户的手机号
        self.phone_number = phone_number
        # 领取用户的位置信息
        self.gps = gps
        # 用户头像地址
        self.avatar = avatar

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.code, 'code')
        self.validate_required(self.user_id, 'user_id')
        self.validate_required(self.user_name, 'user_name')
        self.validate_required(self.avatar, 'avatar')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.code is not None:
            result['code'] = self.code
        if self.user_id is not None:
            result['user_id'] = self.user_id
        if self.user_name is not None:
            result['user_name'] = self.user_name
        if self.phone_number is not None:
            result['phone_number'] = self.phone_number
        if self.gps is not None:
            result['gps'] = self.gps
        if self.avatar is not None:
            result['avatar'] = self.avatar
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('code') is not None:
            self.code = m.get('code')
        if m.get('user_id') is not None:
            self.user_id = m.get('user_id')
        if m.get('user_name') is not None:
            self.user_name = m.get('user_name')
        if m.get('phone_number') is not None:
            self.phone_number = m.get('phone_number')
        if m.get('gps') is not None:
            self.gps = m.get('gps')
        if m.get('avatar') is not None:
            self.avatar = m.get('avatar')
        return self


class ReceiveIpCodeResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class PagequeryIpCodeinfoRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        user_id: str = None,
        page_number: int = None,
        page_size: int = None,
        type: int = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础参数
        self.base_request = base_request
        # 用户ID
        self.user_id = user_id
        # 页码
        self.page_number = page_number
        # 每页数据量大小
        self.page_size = page_size
        # 0 扫描过的正版码，1 领取过的正版码
        self.type = type

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.user_id, 'user_id')
        self.validate_required(self.page_number, 'page_number')
        self.validate_required(self.page_size, 'page_size')
        self.validate_required(self.type, 'type')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.user_id is not None:
            result['user_id'] = self.user_id
        if self.page_number is not None:
            result['page_number'] = self.page_number
        if self.page_size is not None:
            result['page_size'] = self.page_size
        if self.type is not None:
            result['type'] = self.type
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('user_id') is not None:
            self.user_id = m.get('user_id')
        if m.get('page_number') is not None:
            self.page_number = m.get('page_number')
        if m.get('page_size') is not None:
            self.page_size = m.get('page_size')
        if m.get('type') is not None:
            self.type = m.get('type')
        return self


class PagequeryIpCodeinfoResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        page_number: int = None,
        page_size: int = None,
        code_count: int = None,
        code_list: List[IPCodeScannedInfo] = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 页码
        self.page_number = page_number
        # 页面数据量大小
        self.page_size = page_size
        # 领取到的正版码总数
        self.code_count = code_count
        # 正版码列表信息
        self.code_list = code_list

    def validate(self):
        if self.code_list:
            for k in self.code_list:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.page_number is not None:
            result['page_number'] = self.page_number
        if self.page_size is not None:
            result['page_size'] = self.page_size
        if self.code_count is not None:
            result['code_count'] = self.code_count
        result['code_list'] = []
        if self.code_list is not None:
            for k in self.code_list:
                result['code_list'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('page_number') is not None:
            self.page_number = m.get('page_number')
        if m.get('page_size') is not None:
            self.page_size = m.get('page_size')
        if m.get('code_count') is not None:
            self.code_count = m.get('code_count')
        self.code_list = []
        if m.get('code_list') is not None:
            for k in m.get('code_list'):
                temp_model = IPCodeScannedInfo()
                self.code_list.append(temp_model.from_map(k))
        return self


class CreateIpValueaddRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        account_id: str = None,
        service_name: str = None,
        images: str = None,
        images_detail: str = None,
        description: str = None,
        docking_people: List[DockingPeopleInfo] = None,
        copy_right: str = None,
        memo: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础字段
        self.base_request = base_request
        # 创建增值服务的账户id
        self.account_id = account_id
        # 服务名字
        self.service_name = service_name
        # 商品主图，存放OSS图片链接,多张用;隔开
        self.images = images
        # 商品详情图  存放OSS图片链接,多张用;隔开
        self.images_detail = images_detail
        # 商品描述
        self.description = description
        # 联系人
        self.docking_people = docking_people
        # 资质证明
        self.copy_right = copy_right
        # 备注
        self.memo = memo

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.service_name, 'service_name')
        self.validate_required(self.images, 'images')
        self.validate_required(self.images_detail, 'images_detail')
        self.validate_required(self.docking_people, 'docking_people')
        if self.docking_people:
            for k in self.docking_people:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.service_name is not None:
            result['service_name'] = self.service_name
        if self.images is not None:
            result['images'] = self.images
        if self.images_detail is not None:
            result['images_detail'] = self.images_detail
        if self.description is not None:
            result['description'] = self.description
        result['docking_people'] = []
        if self.docking_people is not None:
            for k in self.docking_people:
                result['docking_people'].append(k.to_map() if k else None)
        if self.copy_right is not None:
            result['copy_right'] = self.copy_right
        if self.memo is not None:
            result['memo'] = self.memo
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('service_name') is not None:
            self.service_name = m.get('service_name')
        if m.get('images') is not None:
            self.images = m.get('images')
        if m.get('images_detail') is not None:
            self.images_detail = m.get('images_detail')
        if m.get('description') is not None:
            self.description = m.get('description')
        self.docking_people = []
        if m.get('docking_people') is not None:
            for k in m.get('docking_people'):
                temp_model = DockingPeopleInfo()
                self.docking_people.append(temp_model.from_map(k))
        if m.get('copy_right') is not None:
            self.copy_right = m.get('copy_right')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        return self


class CreateIpValueaddResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        service_id: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 服务id
        self.service_id = service_id

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.service_id is not None:
            result['service_id'] = self.service_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('service_id') is not None:
            self.service_id = m.get('service_id')
        return self


class UpdateIpValueaddRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        service_id: str = None,
        service_name: str = None,
        image: str = None,
        image_detail: str = None,
        description: str = None,
        docking_people: List[DockingPeopleInfo] = None,
        copy_right: str = None,
        memo: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础字段
        self.base_request = base_request
        # 服务id
        self.service_id = service_id
        # 增值服务名字
        self.service_name = service_name
        # 主图。存放OSS图片链接,多张用;隔开
        self.image = image
        # 商品详情图  存放OSS图片链接.多张用;隔开
        self.image_detail = image_detail
        # 描述
        self.description = description
        # 联系人
        self.docking_people = docking_people
        # 资质证明
        self.copy_right = copy_right
        # 备注
        self.memo = memo

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.service_id, 'service_id')
        self.validate_required(self.service_name, 'service_name')
        self.validate_required(self.image, 'image')
        self.validate_required(self.image_detail, 'image_detail')
        self.validate_required(self.docking_people, 'docking_people')
        if self.docking_people:
            for k in self.docking_people:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.service_id is not None:
            result['service_id'] = self.service_id
        if self.service_name is not None:
            result['service_name'] = self.service_name
        if self.image is not None:
            result['image'] = self.image
        if self.image_detail is not None:
            result['image_detail'] = self.image_detail
        if self.description is not None:
            result['description'] = self.description
        result['docking_people'] = []
        if self.docking_people is not None:
            for k in self.docking_people:
                result['docking_people'].append(k.to_map() if k else None)
        if self.copy_right is not None:
            result['copy_right'] = self.copy_right
        if self.memo is not None:
            result['memo'] = self.memo
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('service_id') is not None:
            self.service_id = m.get('service_id')
        if m.get('service_name') is not None:
            self.service_name = m.get('service_name')
        if m.get('image') is not None:
            self.image = m.get('image')
        if m.get('image_detail') is not None:
            self.image_detail = m.get('image_detail')
        if m.get('description') is not None:
            self.description = m.get('description')
        self.docking_people = []
        if m.get('docking_people') is not None:
            for k in m.get('docking_people'):
                temp_model = DockingPeopleInfo()
                self.docking_people.append(temp_model.from_map(k))
        if m.get('copy_right') is not None:
            self.copy_right = m.get('copy_right')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        return self


class UpdateIpValueaddResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class SetIpValueaddskuRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        service_id: str = None,
        skus: List[IpSkuEmphasisInfo] = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础字段
        self.base_request = base_request
        # 服务id
        self.service_id = service_id
        # sku
        self.skus = skus

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.service_id, 'service_id')
        self.validate_required(self.skus, 'skus')
        if self.skus:
            for k in self.skus:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.service_id is not None:
            result['service_id'] = self.service_id
        result['skus'] = []
        if self.skus is not None:
            for k in self.skus:
                result['skus'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('service_id') is not None:
            self.service_id = m.get('service_id')
        self.skus = []
        if m.get('skus') is not None:
            for k in m.get('skus'):
                temp_model = IpSkuEmphasisInfo()
                self.skus.append(temp_model.from_map(k))
        return self


class SetIpValueaddskuResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class OnlineIpValueaddRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        service_id: str = None,
        is_online: bool = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础字段
        self.base_request = base_request
        # 服务id
        self.service_id = service_id
        # 是否上线，否为下线
        self.is_online = is_online

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.service_id, 'service_id')
        self.validate_required(self.is_online, 'is_online')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.service_id is not None:
            result['service_id'] = self.service_id
        if self.is_online is not None:
            result['is_online'] = self.is_online
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('service_id') is not None:
            self.service_id = m.get('service_id')
        if m.get('is_online') is not None:
            self.is_online = m.get('is_online')
        return self


class OnlineIpValueaddResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class QueryIpValueaddRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        service_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础字段
        self.base_request = base_request
        # 查询服务id
        self.service_id = service_id

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.service_id, 'service_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.service_id is not None:
            result['service_id'] = self.service_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('service_id') is not None:
            self.service_id = m.get('service_id')
        return self


class QueryIpValueaddResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        value_added_info: ValueAddedServiceInfoWithSku = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 增值服务详情
        self.value_added_info = value_added_info

    def validate(self):
        if self.value_added_info:
            self.value_added_info.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.value_added_info is not None:
            result['value_added_info'] = self.value_added_info.to_map()
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('value_added_info') is not None:
            temp_model = ValueAddedServiceInfoWithSku()
            self.value_added_info = temp_model.from_map(m['value_added_info'])
        return self


class PagequeryIpValueaddRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        account_id: str = None,
        service_name: str = None,
        status: int = None,
        page_index: int = None,
        page_size: int = None,
        begin_create_time: str = None,
        eng_create_time: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础字段
        self.base_request = base_request
        # 归属账户id
        self.account_id = account_id
        # 服务名字，模糊匹配
        self.service_name = service_name
        # 服务状态（0:待审核 1:审核拒绝 2:上线【审核通过】 3: 下线）
        self.status = status
        # 第几页
        self.page_index = page_index
        # 每页长度
        self.page_size = page_size
        # 开始时间
        self.begin_create_time = begin_create_time
        # 结束时间
        self.eng_create_time = eng_create_time

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.page_index, 'page_index')
        self.validate_required(self.page_size, 'page_size')
        self.validate_required(self.begin_create_time, 'begin_create_time')
        if self.begin_create_time is not None:
            self.validate_pattern(self.begin_create_time, 'begin_create_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}([Z]|([\\.]\\d{1,9})?[\\+]\\d{2}[\\:]?\\d{2})')
        self.validate_required(self.eng_create_time, 'eng_create_time')
        if self.eng_create_time is not None:
            self.validate_pattern(self.eng_create_time, 'eng_create_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}([Z]|([\\.]\\d{1,9})?[\\+]\\d{2}[\\:]?\\d{2})')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.service_name is not None:
            result['service_name'] = self.service_name
        if self.status is not None:
            result['status'] = self.status
        if self.page_index is not None:
            result['page_index'] = self.page_index
        if self.page_size is not None:
            result['page_size'] = self.page_size
        if self.begin_create_time is not None:
            result['begin_create_time'] = self.begin_create_time
        if self.eng_create_time is not None:
            result['eng_create_time'] = self.eng_create_time
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('service_name') is not None:
            self.service_name = m.get('service_name')
        if m.get('status') is not None:
            self.status = m.get('status')
        if m.get('page_index') is not None:
            self.page_index = m.get('page_index')
        if m.get('page_size') is not None:
            self.page_size = m.get('page_size')
        if m.get('begin_create_time') is not None:
            self.begin_create_time = m.get('begin_create_time')
        if m.get('eng_create_time') is not None:
            self.eng_create_time = m.get('eng_create_time')
        return self


class PagequeryIpValueaddResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        data: List[ValueAddedServiceInfo] = None,
        all_count: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 增值服务列表
        self.data = data
        # 总数
        self.all_count = all_count

    def validate(self):
        if self.data:
            for k in self.data:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        result['data'] = []
        if self.data is not None:
            for k in self.data:
                result['data'].append(k.to_map() if k else None)
        if self.all_count is not None:
            result['all_count'] = self.all_count
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        self.data = []
        if m.get('data') is not None:
            for k in m.get('data'):
                temp_model = ValueAddedServiceInfo()
                self.data.append(temp_model.from_map(k))
        if m.get('all_count') is not None:
            self.all_count = m.get('all_count')
        return self


class UploadIpTradesalesRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        account_id: str = None,
        ip_order_id: str = None,
        only_call_blockchain: bool = None,
        billing_type: int = None,
        pay_return_url: str = None,
        auth_rate: str = None,
        auth_price: str = None,
        total_amount: int = None,
        total_sales: str = None,
        total_refund_sales: str = None,
        total_payment: str = None,
        ip_sales_info_list: List[IPSalesInfo] = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 请求参数
        self.base_request = base_request
        # 上传记录的用户的链上账户Id
        self.account_id = account_id
        # 订单ID
        self.ip_order_id = ip_order_id
        # true 只上链不走真实支付，false 上链并链下真实支付账单
        self.only_call_blockchain = only_call_blockchain
        # 账单结算类型：即时计费0、按周计费1、按月计费2、按季度计费3。默认0
        self.billing_type = billing_type
        # 支付完成后的回调地址。如果为空，默认跳转到https://ipforce.cloud.alipay.com/\
        self.pay_return_url = pay_return_url
        # 授权佣金比例
        self.auth_rate = auth_rate
        # 定向授权按量付费单价
        self.auth_price = auth_price
        # 商品销售数量
        self.total_amount = total_amount
        # 销售金额
        self.total_sales = total_sales
        # 总的退款金额。不填默认为0
        self.total_refund_sales = total_refund_sales
        # 实付金额（授权交易）
        self.total_payment = total_payment
        # 销售数据列表
        self.ip_sales_info_list = ip_sales_info_list

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.ip_order_id, 'ip_order_id')
        self.validate_required(self.only_call_blockchain, 'only_call_blockchain')
        self.validate_required(self.total_amount, 'total_amount')
        self.validate_required(self.total_sales, 'total_sales')
        self.validate_required(self.total_payment, 'total_payment')
        self.validate_required(self.ip_sales_info_list, 'ip_sales_info_list')
        if self.ip_sales_info_list:
            for k in self.ip_sales_info_list:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.ip_order_id is not None:
            result['ip_order_id'] = self.ip_order_id
        if self.only_call_blockchain is not None:
            result['only_call_blockchain'] = self.only_call_blockchain
        if self.billing_type is not None:
            result['billing_type'] = self.billing_type
        if self.pay_return_url is not None:
            result['pay_return_url'] = self.pay_return_url
        if self.auth_rate is not None:
            result['auth_rate'] = self.auth_rate
        if self.auth_price is not None:
            result['auth_price'] = self.auth_price
        if self.total_amount is not None:
            result['total_amount'] = self.total_amount
        if self.total_sales is not None:
            result['total_sales'] = self.total_sales
        if self.total_refund_sales is not None:
            result['total_refund_sales'] = self.total_refund_sales
        if self.total_payment is not None:
            result['total_payment'] = self.total_payment
        result['ip_sales_info_list'] = []
        if self.ip_sales_info_list is not None:
            for k in self.ip_sales_info_list:
                result['ip_sales_info_list'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('ip_order_id') is not None:
            self.ip_order_id = m.get('ip_order_id')
        if m.get('only_call_blockchain') is not None:
            self.only_call_blockchain = m.get('only_call_blockchain')
        if m.get('billing_type') is not None:
            self.billing_type = m.get('billing_type')
        if m.get('pay_return_url') is not None:
            self.pay_return_url = m.get('pay_return_url')
        if m.get('auth_rate') is not None:
            self.auth_rate = m.get('auth_rate')
        if m.get('auth_price') is not None:
            self.auth_price = m.get('auth_price')
        if m.get('total_amount') is not None:
            self.total_amount = m.get('total_amount')
        if m.get('total_sales') is not None:
            self.total_sales = m.get('total_sales')
        if m.get('total_refund_sales') is not None:
            self.total_refund_sales = m.get('total_refund_sales')
        if m.get('total_payment') is not None:
            self.total_payment = m.get('total_payment')
        self.ip_sales_info_list = []
        if m.get('ip_sales_info_list') is not None:
            for k in m.get('ip_sales_info_list'):
                temp_model = IPSalesInfo()
                self.ip_sales_info_list.append(temp_model.from_map(k))
        return self


class UploadIpTradesalesResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        pay_url: str = None,
        ip_bill_id: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 支付链接
        self.pay_url = pay_url
        # 账单ID
        self.ip_bill_id = ip_bill_id

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.pay_url is not None:
            result['pay_url'] = self.pay_url
        if self.ip_bill_id is not None:
            result['ip_bill_id'] = self.ip_bill_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('pay_url') is not None:
            self.pay_url = m.get('pay_url')
        if m.get('ip_bill_id') is not None:
            self.ip_bill_id = m.get('ip_bill_id')
        return self


class AuthIpUserRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        auth_code: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础参数
        self.base_request = base_request
        # 用户授权code
        self.auth_code = auth_code

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.auth_code, 'auth_code')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.auth_code is not None:
            result['auth_code'] = self.auth_code
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('auth_code') is not None:
            self.auth_code = m.get('auth_code')
        return self


class AuthIpUserResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        user_id: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 用户ID
        self.user_id = user_id

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.user_id is not None:
            result['user_id'] = self.user_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('user_id') is not None:
            self.user_id = m.get('user_id')
        return self


class RemoveIpGoodsRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        ip_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础字段
        self.base_request = base_request
        # ip id
        self.ip_id = ip_id

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.ip_id, 'ip_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.ip_id is not None:
            result['ip_id'] = self.ip_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('ip_id') is not None:
            self.ip_id = m.get('ip_id')
        return self


class RemoveIpGoodsResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class CountIpNumRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        account_id: str = None,
        channel_name: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础字段
        self.base_request = base_request
        # 账户id，为空则查全局
        self.account_id = account_id
        # 渠道名称
        self.channel_name = channel_name

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.channel_name is not None:
            result['channel_name'] = self.channel_name
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('channel_name') is not None:
            self.channel_name = m.get('channel_name')
        return self


class CountIpNumResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        counter_detail: List[ChannelCounter] = None,
        all_count: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 各个渠道的统计
        self.counter_detail = counter_detail
        # 总计值
        self.all_count = all_count

    def validate(self):
        if self.counter_detail:
            for k in self.counter_detail:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        result['counter_detail'] = []
        if self.counter_detail is not None:
            for k in self.counter_detail:
                result['counter_detail'].append(k.to_map() if k else None)
        if self.all_count is not None:
            result['all_count'] = self.all_count
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        self.counter_detail = []
        if m.get('counter_detail') is not None:
            for k in m.get('counter_detail'):
                temp_model = ChannelCounter()
                self.counter_detail.append(temp_model.from_map(k))
        if m.get('all_count') is not None:
            self.all_count = m.get('all_count')
        return self


class CountIpPvRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        account_id: str = None,
        channel_name: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础字段
        self.base_request = base_request
        # 账户id，为空则统计全局
        self.account_id = account_id
        # 渠道名称
        self.channel_name = channel_name

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.channel_name is not None:
            result['channel_name'] = self.channel_name
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('channel_name') is not None:
            self.channel_name = m.get('channel_name')
        return self


class CountIpPvResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        all_count: int = None,
        counter_details: List[ChannelCounter] = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 总计
        self.all_count = all_count
        # 渠道统计值
        self.counter_details = counter_details

    def validate(self):
        if self.counter_details:
            for k in self.counter_details:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.all_count is not None:
            result['all_count'] = self.all_count
        result['counter_details'] = []
        if self.counter_details is not None:
            for k in self.counter_details:
                result['counter_details'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('all_count') is not None:
            self.all_count = m.get('all_count')
        self.counter_details = []
        if m.get('counter_details') is not None:
            for k in m.get('counter_details'):
                temp_model = ChannelCounter()
                self.counter_details.append(temp_model.from_map(k))
        return self


class QueryIpCodeRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        code: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础参数
        self.base_request = base_request
        # 正版码的编码
        self.code = code

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.code, 'code')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.code is not None:
            result['code'] = self.code
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('code') is not None:
            self.code = m.get('code')
        return self


class QueryIpCodeResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        code_info: IPCodeScannedInfo = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 正版码信息
        self.code_info = code_info

    def validate(self):
        if self.code_info:
            self.code_info.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.code_info is not None:
            result['code_info'] = self.code_info.to_map()
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('code_info') is not None:
            temp_model = IPCodeScannedInfo()
            self.code_info = temp_model.from_map(m['code_info'])
        return self


class CountIpAccountRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        chain_id: str = None,
        product_code: str = None,
        channel_name: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础参数
        self.base_request = base_request
        # 支持多链多合约,该参数为指明需要操作哪个智能合约环境(长度不超过50个字符)
        self.chain_id = chain_id
        # 场景码(入驻时申请)(长度不超过50个字符)
        self.product_code = product_code
        # null返回所有数据，非空返回对应渠道的数据
        self.channel_name = channel_name

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.product_code is not None:
            result['product_code'] = self.product_code
        if self.channel_name is not None:
            result['channel_name'] = self.channel_name
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('product_code') is not None:
            self.product_code = m.get('product_code')
        if m.get('channel_name') is not None:
            self.channel_name = m.get('channel_name')
        return self


class CountIpAccountResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        user_count: int = None,
        seller_count: int = None,
        buyer_count: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 用户数量
        self.user_count = user_count
        # 版权方数量
        self.seller_count = seller_count
        # 版权方数量
        self.buyer_count = buyer_count

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.user_count is not None:
            result['user_count'] = self.user_count
        if self.seller_count is not None:
            result['seller_count'] = self.seller_count
        if self.buyer_count is not None:
            result['buyer_count'] = self.buyer_count
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('user_count') is not None:
            self.user_count = m.get('user_count')
        if m.get('seller_count') is not None:
            self.seller_count = m.get('seller_count')
        if m.get('buyer_count') is not None:
            self.buyer_count = m.get('buyer_count')
        return self


class QueryIpOrderstatisticRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        seller_id: str = None,
        ip_id: str = None,
        channel_name: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础参数
        self.base_request = base_request
        # 卖方ID
        self.seller_id = seller_id
        # IP id
        self.ip_id = ip_id
        # 渠道名称
        self.channel_name = channel_name

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.seller_id is not None:
            result['seller_id'] = self.seller_id
        if self.ip_id is not None:
            result['ip_id'] = self.ip_id
        if self.channel_name is not None:
            result['channel_name'] = self.channel_name
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('seller_id') is not None:
            self.seller_id = m.get('seller_id')
        if m.get('ip_id') is not None:
            self.ip_id = m.get('ip_id')
        if m.get('channel_name') is not None:
            self.channel_name = m.get('channel_name')
        return self


class QueryIpOrderstatisticResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        total_order_count: int = None,
        total_payment_amount: str = None,
        total_buyer_count: int = None,
        order_sta_list: List[ChannelCounter] = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 订单总数
        self.total_order_count = total_order_count
        # 总金额
        self.total_payment_amount = total_payment_amount
        # 总客户数
        self.total_buyer_count = total_buyer_count
        # 统计数据
        self.order_sta_list = order_sta_list

    def validate(self):
        if self.order_sta_list:
            for k in self.order_sta_list:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.total_order_count is not None:
            result['total_order_count'] = self.total_order_count
        if self.total_payment_amount is not None:
            result['total_payment_amount'] = self.total_payment_amount
        if self.total_buyer_count is not None:
            result['total_buyer_count'] = self.total_buyer_count
        result['order_sta_list'] = []
        if self.order_sta_list is not None:
            for k in self.order_sta_list:
                result['order_sta_list'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('total_order_count') is not None:
            self.total_order_count = m.get('total_order_count')
        if m.get('total_payment_amount') is not None:
            self.total_payment_amount = m.get('total_payment_amount')
        if m.get('total_buyer_count') is not None:
            self.total_buyer_count = m.get('total_buyer_count')
        self.order_sta_list = []
        if m.get('order_sta_list') is not None:
            for k in m.get('order_sta_list'):
                temp_model = ChannelCounter()
                self.order_sta_list.append(temp_model.from_map(k))
        return self


class UpdateIpGoodsgalleryRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        account_id: str = None,
        ip_id: str = None,
        ip_gallery_url: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础参数
        self.base_request = base_request
        # 版权方链上账户ID
        self.account_id = account_id
        # ip链上id
        self.ip_id = ip_id
        # IP图库链接，一个压缩包
        self.ip_gallery_url = ip_gallery_url

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.ip_id, 'ip_id')
        self.validate_required(self.ip_gallery_url, 'ip_gallery_url')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.ip_id is not None:
            result['ip_id'] = self.ip_id
        if self.ip_gallery_url is not None:
            result['ip_gallery_url'] = self.ip_gallery_url
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('ip_id') is not None:
            self.ip_id = m.get('ip_id')
        if m.get('ip_gallery_url') is not None:
            self.ip_gallery_url = m.get('ip_gallery_url')
        return self


class UpdateIpGoodsgalleryResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class QueryIpGoodsgalleryRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        account_id: str = None,
        ip_id: str = None,
        ip_order_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础参数
        self.base_request = base_request
        # 账户链上ID
        self.account_id = account_id
        # IP链上ID，只有版权方可以根据IPID查询图库信息。如果传入IPID，优先根据IPID查询图库信息。
        self.ip_id = ip_id
        # IP授权订单ID，版权方和商家均可根据订单ID查询图库信息
        self.ip_order_id = ip_order_id

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.account_id, 'account_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.ip_id is not None:
            result['ip_id'] = self.ip_id
        if self.ip_order_id is not None:
            result['ip_order_id'] = self.ip_order_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('ip_id') is not None:
            self.ip_id = m.get('ip_id')
        if m.get('ip_order_id') is not None:
            self.ip_order_id = m.get('ip_order_id')
        return self


class QueryIpGoodsgalleryResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        ip_gallery_url: str = None,
        ip_gallery_temporary_url: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 图库链接
        self.ip_gallery_url = ip_gallery_url
        # 图库临时下载链接，过期时间2小时
        self.ip_gallery_temporary_url = ip_gallery_temporary_url

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.ip_gallery_url is not None:
            result['ip_gallery_url'] = self.ip_gallery_url
        if self.ip_gallery_temporary_url is not None:
            result['ip_gallery_temporary_url'] = self.ip_gallery_temporary_url
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('ip_gallery_url') is not None:
            self.ip_gallery_url = m.get('ip_gallery_url')
        if m.get('ip_gallery_temporary_url') is not None:
            self.ip_gallery_temporary_url = m.get('ip_gallery_temporary_url')
        return self


class SetIpCodeinfoRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        account_id: str = None,
        order_id: str = None,
        goods_info_list: List[IPCodeGoodsInfo] = None,
        ad_info_list: List[IPCodeAdvertisingInfo] = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础参数
        self.base_request = base_request
        # 正版码对应的订单上版权方的账户链上ID
        self.account_id = account_id
        # 订单ID
        self.order_id = order_id
        # 正版码商品信息配置列表
        self.goods_info_list = goods_info_list
        # 正版码资源位配置信息列表
        self.ad_info_list = ad_info_list

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.order_id, 'order_id')
        if self.goods_info_list:
            for k in self.goods_info_list:
                if k:
                    k.validate()
        if self.ad_info_list:
            for k in self.ad_info_list:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.order_id is not None:
            result['order_id'] = self.order_id
        result['goods_info_list'] = []
        if self.goods_info_list is not None:
            for k in self.goods_info_list:
                result['goods_info_list'].append(k.to_map() if k else None)
        result['ad_info_list'] = []
        if self.ad_info_list is not None:
            for k in self.ad_info_list:
                result['ad_info_list'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('order_id') is not None:
            self.order_id = m.get('order_id')
        self.goods_info_list = []
        if m.get('goods_info_list') is not None:
            for k in m.get('goods_info_list'):
                temp_model = IPCodeGoodsInfo()
                self.goods_info_list.append(temp_model.from_map(k))
        self.ad_info_list = []
        if m.get('ad_info_list') is not None:
            for k in m.get('ad_info_list'):
                temp_model = IPCodeAdvertisingInfo()
                self.ad_info_list.append(temp_model.from_map(k))
        return self


class SetIpCodeinfoResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class PagequeryIpGalleryinstructionRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        account_id: str = None,
        ip_order_id: str = None,
        page_number: int = None,
        page_size: int = None,
        order: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础参数
        self.base_request = base_request
        # 账户链上ID
        self.account_id = account_id
        # 授权订单ID
        self.ip_order_id = ip_order_id
        # 页码
        self.page_number = page_number
        # 每页数据量大小
        self.page_size = page_size
        # 数据排序顺序：正序还是倒序。默认按照下载时间排序。
        self.order = order

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.ip_order_id, 'ip_order_id')
        self.validate_required(self.page_number, 'page_number')
        self.validate_required(self.page_size, 'page_size')
        self.validate_required(self.order, 'order')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.ip_order_id is not None:
            result['ip_order_id'] = self.ip_order_id
        if self.page_number is not None:
            result['page_number'] = self.page_number
        if self.page_size is not None:
            result['page_size'] = self.page_size
        if self.order is not None:
            result['order'] = self.order
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('ip_order_id') is not None:
            self.ip_order_id = m.get('ip_order_id')
        if m.get('page_number') is not None:
            self.page_number = m.get('page_number')
        if m.get('page_size') is not None:
            self.page_size = m.get('page_size')
        if m.get('order') is not None:
            self.order = m.get('order')
        return self


class PagequeryIpGalleryinstructionResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        page_number: int = None,
        page_size: int = None,
        total_count: int = None,
        gallery_instruction_list: List[IPGalleryInstruction] = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 页码
        self.page_number = page_number
        # 每页数据量大小
        self.page_size = page_size
        # 符合条件的数据总数
        self.total_count = total_count
        # 图库系在记录信息
        self.gallery_instruction_list = gallery_instruction_list

    def validate(self):
        if self.gallery_instruction_list:
            for k in self.gallery_instruction_list:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.page_number is not None:
            result['page_number'] = self.page_number
        if self.page_size is not None:
            result['page_size'] = self.page_size
        if self.total_count is not None:
            result['total_count'] = self.total_count
        result['gallery_instruction_list'] = []
        if self.gallery_instruction_list is not None:
            for k in self.gallery_instruction_list:
                result['gallery_instruction_list'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('page_number') is not None:
            self.page_number = m.get('page_number')
        if m.get('page_size') is not None:
            self.page_size = m.get('page_size')
        if m.get('total_count') is not None:
            self.total_count = m.get('total_count')
        self.gallery_instruction_list = []
        if m.get('gallery_instruction_list') is not None:
            for k in m.get('gallery_instruction_list'):
                temp_model = IPGalleryInstruction()
                self.gallery_instruction_list.append(temp_model.from_map(k))
        return self


class ConfirmIpOrdergalleryRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        account_id: str = None,
        ip_order_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础参数
        self.base_request = base_request
        # 必须传入：IP 版权方账户链上ID
        self.account_id = account_id
        # 授权订单ID
        self.ip_order_id = ip_order_id

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.ip_order_id, 'ip_order_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.ip_order_id is not None:
            result['ip_order_id'] = self.ip_order_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('ip_order_id') is not None:
            self.ip_order_id = m.get('ip_order_id')
        return self


class ConfirmIpOrdergalleryResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class ConfirmIpAuthtradeRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        account_id: str = None,
        ip_order_id: str = None,
        confirm_result: bool = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础请求参数
        self.base_request = base_request
        # 审核账户ID
        self.account_id = account_id
        # 授权订单ID
        self.ip_order_id = ip_order_id
        # 是否同意授权
        self.confirm_result = confirm_result

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.ip_order_id, 'ip_order_id')
        self.validate_required(self.confirm_result, 'confirm_result')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.ip_order_id is not None:
            result['ip_order_id'] = self.ip_order_id
        if self.confirm_result is not None:
            result['confirm_result'] = self.confirm_result
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('ip_order_id') is not None:
            self.ip_order_id = m.get('ip_order_id')
        if m.get('confirm_result') is not None:
            self.confirm_result = m.get('confirm_result')
        return self


class ConfirmIpAuthtradeResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        ip_order_id: str = None,
        pay_url: str = None,
        ip_bill_id: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 订单ID
        self.ip_order_id = ip_order_id
        # 保底金支付链接
        self.pay_url = pay_url
        # 保底金账单ID
        self.ip_bill_id = ip_bill_id

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.ip_order_id is not None:
            result['ip_order_id'] = self.ip_order_id
        if self.pay_url is not None:
            result['pay_url'] = self.pay_url
        if self.ip_bill_id is not None:
            result['ip_bill_id'] = self.ip_bill_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('ip_order_id') is not None:
            self.ip_order_id = m.get('ip_order_id')
        if m.get('pay_url') is not None:
            self.pay_url = m.get('pay_url')
        if m.get('ip_bill_id') is not None:
            self.ip_bill_id = m.get('ip_bill_id')
        return self


class ConfirmIpPackagetradeRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        account_id: str = None,
        ip_order_id: str = None,
        confirm_result: bool = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础请求参数
        self.base_request = base_request
        # 审核账户ID
        self.account_id = account_id
        # 授权订单ID
        self.ip_order_id = ip_order_id
        # 是否同意授权
        # 
        self.confirm_result = confirm_result

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.ip_order_id, 'ip_order_id')
        self.validate_required(self.confirm_result, 'confirm_result')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.ip_order_id is not None:
            result['ip_order_id'] = self.ip_order_id
        if self.confirm_result is not None:
            result['confirm_result'] = self.confirm_result
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('ip_order_id') is not None:
            self.ip_order_id = m.get('ip_order_id')
        if m.get('confirm_result') is not None:
            self.confirm_result = m.get('confirm_result')
        return self


class ConfirmIpPackagetradeResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        ip_order_id: str = None,
        pay_url: str = None,
        ip_bill_id: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 订单ID
        self.ip_order_id = ip_order_id
        # 保底金支付链接
        self.pay_url = pay_url
        # 保底金账单ID
        self.ip_bill_id = ip_bill_id

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.ip_order_id is not None:
            result['ip_order_id'] = self.ip_order_id
        if self.pay_url is not None:
            result['pay_url'] = self.pay_url
        if self.ip_bill_id is not None:
            result['ip_bill_id'] = self.ip_bill_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('ip_order_id') is not None:
            self.ip_order_id = m.get('ip_order_id')
        if m.get('pay_url') is not None:
            self.pay_url = m.get('pay_url')
        if m.get('ip_bill_id') is not None:
            self.ip_bill_id = m.get('ip_bill_id')
        return self


class ApplyIpPackagetradeRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        account_id: str = None,
        ip_id: str = None,
        only_call_blockchain: bool = None,
        price_range: str = None,
        amount: int = None,
        expected_total_price: str = None,
        auth_begin_time: int = None,
        auth_end_time: int = None,
        memo: str = None,
        additional_clause: str = None,
        auth_product_scope: str = None,
        auth_area_scope: str = None,
        sales_channel: str = None,
        goods_type: int = None,
        related_order_id: str = None,
        pay_return_url: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础参数
        self.base_request = base_request
        # 买方的链上账户Id
        self.account_id = account_id
        # IP授权交易时传入IP ID；增值服务交易时传入服务ID
        self.ip_id = ip_id
        # true 只上链不走真实支付，false 上链并链下真实支付账单
        self.only_call_blockchain = only_call_blockchain
        # 终端商品价格区间
        self.price_range = price_range
        # 套餐中包含终端商品数量
        self.amount = amount
        # 套餐交易应付金额，单位元，保留两位小数
        self.expected_total_price = expected_total_price
        # 授权合作开始期限（毫秒时间戳）
        self.auth_begin_time = auth_begin_time
        # 授权合作结束期限（毫秒时间戳）
        self.auth_end_time = auth_end_time
        # 备注信息
        self.memo = memo
        # 附加条款
        self.additional_clause = additional_clause
        # 授权产品范围
        self.auth_product_scope = auth_product_scope
        # 授权地域范围
        self.auth_area_scope = auth_area_scope
        # 商品销售渠道
        self.sales_channel = sales_channel
        # 0 IP交易，1 增值服务交易
        self.goods_type = goods_type
        # 增值服务交易绑定的ip授权交易订单，增值服务交易必填
        self.related_order_id = related_order_id
        # 支付完成后的回调地址。如果为空，默认跳转到https://ipforce.cloud.alipay.com/\
        self.pay_return_url = pay_return_url

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.ip_id, 'ip_id')
        self.validate_required(self.only_call_blockchain, 'only_call_blockchain')
        self.validate_required(self.price_range, 'price_range')
        self.validate_required(self.amount, 'amount')
        self.validate_required(self.expected_total_price, 'expected_total_price')
        self.validate_required(self.auth_begin_time, 'auth_begin_time')
        self.validate_required(self.auth_end_time, 'auth_end_time')
        self.validate_required(self.memo, 'memo')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.ip_id is not None:
            result['ip_id'] = self.ip_id
        if self.only_call_blockchain is not None:
            result['only_call_blockchain'] = self.only_call_blockchain
        if self.price_range is not None:
            result['price_range'] = self.price_range
        if self.amount is not None:
            result['amount'] = self.amount
        if self.expected_total_price is not None:
            result['expected_total_price'] = self.expected_total_price
        if self.auth_begin_time is not None:
            result['auth_begin_time'] = self.auth_begin_time
        if self.auth_end_time is not None:
            result['auth_end_time'] = self.auth_end_time
        if self.memo is not None:
            result['memo'] = self.memo
        if self.additional_clause is not None:
            result['additional_clause'] = self.additional_clause
        if self.auth_product_scope is not None:
            result['auth_product_scope'] = self.auth_product_scope
        if self.auth_area_scope is not None:
            result['auth_area_scope'] = self.auth_area_scope
        if self.sales_channel is not None:
            result['sales_channel'] = self.sales_channel
        if self.goods_type is not None:
            result['goods_type'] = self.goods_type
        if self.related_order_id is not None:
            result['related_order_id'] = self.related_order_id
        if self.pay_return_url is not None:
            result['pay_return_url'] = self.pay_return_url
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('ip_id') is not None:
            self.ip_id = m.get('ip_id')
        if m.get('only_call_blockchain') is not None:
            self.only_call_blockchain = m.get('only_call_blockchain')
        if m.get('price_range') is not None:
            self.price_range = m.get('price_range')
        if m.get('amount') is not None:
            self.amount = m.get('amount')
        if m.get('expected_total_price') is not None:
            self.expected_total_price = m.get('expected_total_price')
        if m.get('auth_begin_time') is not None:
            self.auth_begin_time = m.get('auth_begin_time')
        if m.get('auth_end_time') is not None:
            self.auth_end_time = m.get('auth_end_time')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('additional_clause') is not None:
            self.additional_clause = m.get('additional_clause')
        if m.get('auth_product_scope') is not None:
            self.auth_product_scope = m.get('auth_product_scope')
        if m.get('auth_area_scope') is not None:
            self.auth_area_scope = m.get('auth_area_scope')
        if m.get('sales_channel') is not None:
            self.sales_channel = m.get('sales_channel')
        if m.get('goods_type') is not None:
            self.goods_type = m.get('goods_type')
        if m.get('related_order_id') is not None:
            self.related_order_id = m.get('related_order_id')
        if m.get('pay_return_url') is not None:
            self.pay_return_url = m.get('pay_return_url')
        return self


class ApplyIpPackagetradeResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        ip_order_id: str = None,
        pay_url: str = None,
        ip_bill_id: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 订单ID
        self.ip_order_id = ip_order_id
        # 支付信息
        self.pay_url = pay_url
        # 账单ID
        # 
        self.ip_bill_id = ip_bill_id

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.ip_order_id is not None:
            result['ip_order_id'] = self.ip_order_id
        if self.pay_url is not None:
            result['pay_url'] = self.pay_url
        if self.ip_bill_id is not None:
            result['ip_bill_id'] = self.ip_bill_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('ip_order_id') is not None:
            self.ip_order_id = m.get('ip_order_id')
        if m.get('pay_url') is not None:
            self.pay_url = m.get('pay_url')
        if m.get('ip_bill_id') is not None:
            self.ip_bill_id = m.get('ip_bill_id')
        return self


class ApplyIpAuthtradeRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        account_id: str = None,
        ip_id: str = None,
        charge_type: int = None,
        auth_rate: str = None,
        auth_price: str = None,
        auth_begin_time: int = None,
        auth_end_time: int = None,
        contract: str = None,
        design_draft: str = None,
        auth_product_scope: str = None,
        auth_area_scope: str = None,
        sales_channel: str = None,
        memo: str = None,
        additional_clause: str = None,
        guaranteed: bool = None,
        guaranteed_fund: str = None,
        guaranteed_goods_amount: int = None,
        guaranteed_sales: str = None,
        goods_type: int = None,
        related_order_id: str = None,
        pay_return_url: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础请求参数
        self.base_request = base_request
        # 采购者的链上账户Id
        self.account_id = account_id
        # IP授权交易时传入IP ID；增值服务交易时传入服务ID
        self.ip_id = ip_id
        # 收费模式：0 销售抽佣, 1 按量付费
        self.charge_type = charge_type
        # 授权计费比例
        self.auth_rate = auth_rate
        # 按量付费的收费单价（按量付费模式必填）
        self.auth_price = auth_price
        # 授权合作开始期限（毫秒时间戳）
        self.auth_begin_time = auth_begin_time
        # 授权合作结束期限（毫秒时间戳）
        self.auth_end_time = auth_end_time
        # 合同（文件URL）
        self.contract = contract
        # 设计稿（文件URL）
        self.design_draft = design_draft
        # 授权产品范围
        self.auth_product_scope = auth_product_scope
        # 授权地域范围
        self.auth_area_scope = auth_area_scope
        # 商品销售渠道
        self.sales_channel = sales_channel
        # 备注消息(不超过256个字符)
        self.memo = memo
        # 附加条款
        self.additional_clause = additional_clause
        # 是否有保底金
        self.guaranteed = guaranteed
        # 支付的保底金金额
        self.guaranteed_fund = guaranteed_fund
        # 保底商品个数（按量付费），订单销售数量超过保底部分需按量付费
        self.guaranteed_goods_amount = guaranteed_goods_amount
        # 保底商品销售金额（销售抽佣），订单销售额超过保底部分需按比例抽拥
        self.guaranteed_sales = guaranteed_sales
        # 0 IP交易，1 增值服务交易
        self.goods_type = goods_type
        # 增值服务交易绑定的ip授权交易订单，增值服务交易必填
        self.related_order_id = related_order_id
        # 支付完成后的回调地址。如果为空，默认跳转到https://ipforce.cloud.alipay.com/\
        self.pay_return_url = pay_return_url

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.ip_id, 'ip_id')
        self.validate_required(self.auth_begin_time, 'auth_begin_time')
        self.validate_required(self.auth_end_time, 'auth_end_time')
        self.validate_required(self.memo, 'memo')
        self.validate_required(self.guaranteed, 'guaranteed')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.ip_id is not None:
            result['ip_id'] = self.ip_id
        if self.charge_type is not None:
            result['charge_type'] = self.charge_type
        if self.auth_rate is not None:
            result['auth_rate'] = self.auth_rate
        if self.auth_price is not None:
            result['auth_price'] = self.auth_price
        if self.auth_begin_time is not None:
            result['auth_begin_time'] = self.auth_begin_time
        if self.auth_end_time is not None:
            result['auth_end_time'] = self.auth_end_time
        if self.contract is not None:
            result['contract'] = self.contract
        if self.design_draft is not None:
            result['design_draft'] = self.design_draft
        if self.auth_product_scope is not None:
            result['auth_product_scope'] = self.auth_product_scope
        if self.auth_area_scope is not None:
            result['auth_area_scope'] = self.auth_area_scope
        if self.sales_channel is not None:
            result['sales_channel'] = self.sales_channel
        if self.memo is not None:
            result['memo'] = self.memo
        if self.additional_clause is not None:
            result['additional_clause'] = self.additional_clause
        if self.guaranteed is not None:
            result['guaranteed'] = self.guaranteed
        if self.guaranteed_fund is not None:
            result['guaranteed_fund'] = self.guaranteed_fund
        if self.guaranteed_goods_amount is not None:
            result['guaranteed_goods_amount'] = self.guaranteed_goods_amount
        if self.guaranteed_sales is not None:
            result['guaranteed_sales'] = self.guaranteed_sales
        if self.goods_type is not None:
            result['goods_type'] = self.goods_type
        if self.related_order_id is not None:
            result['related_order_id'] = self.related_order_id
        if self.pay_return_url is not None:
            result['pay_return_url'] = self.pay_return_url
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('ip_id') is not None:
            self.ip_id = m.get('ip_id')
        if m.get('charge_type') is not None:
            self.charge_type = m.get('charge_type')
        if m.get('auth_rate') is not None:
            self.auth_rate = m.get('auth_rate')
        if m.get('auth_price') is not None:
            self.auth_price = m.get('auth_price')
        if m.get('auth_begin_time') is not None:
            self.auth_begin_time = m.get('auth_begin_time')
        if m.get('auth_end_time') is not None:
            self.auth_end_time = m.get('auth_end_time')
        if m.get('contract') is not None:
            self.contract = m.get('contract')
        if m.get('design_draft') is not None:
            self.design_draft = m.get('design_draft')
        if m.get('auth_product_scope') is not None:
            self.auth_product_scope = m.get('auth_product_scope')
        if m.get('auth_area_scope') is not None:
            self.auth_area_scope = m.get('auth_area_scope')
        if m.get('sales_channel') is not None:
            self.sales_channel = m.get('sales_channel')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('additional_clause') is not None:
            self.additional_clause = m.get('additional_clause')
        if m.get('guaranteed') is not None:
            self.guaranteed = m.get('guaranteed')
        if m.get('guaranteed_fund') is not None:
            self.guaranteed_fund = m.get('guaranteed_fund')
        if m.get('guaranteed_goods_amount') is not None:
            self.guaranteed_goods_amount = m.get('guaranteed_goods_amount')
        if m.get('guaranteed_sales') is not None:
            self.guaranteed_sales = m.get('guaranteed_sales')
        if m.get('goods_type') is not None:
            self.goods_type = m.get('goods_type')
        if m.get('related_order_id') is not None:
            self.related_order_id = m.get('related_order_id')
        if m.get('pay_return_url') is not None:
            self.pay_return_url = m.get('pay_return_url')
        return self


class ApplyIpAuthtradeResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        ip_order_id: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 订单ID
        self.ip_order_id = ip_order_id

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.ip_order_id is not None:
            result['ip_order_id'] = self.ip_order_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('ip_order_id') is not None:
            self.ip_order_id = m.get('ip_order_id')
        return self


class QueryIpCodeinfoRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        account_id: str = None,
        order_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础请求参数
        self.base_request = base_request
        # 账户链上ID
        self.account_id = account_id
        # 订单ID
        self.order_id = order_id

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.order_id, 'order_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.order_id is not None:
            result['order_id'] = self.order_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('order_id') is not None:
            self.order_id = m.get('order_id')
        return self


class QueryIpCodeinfoResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        order_id: str = None,
        goods_info_list: List[IPCodeGoodsInfo] = None,
        ad_info_list: List[IPCodeAdvertisingInfo] = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 订单ID
        self.order_id = order_id
        # 正版码商品信息配置列表
        self.goods_info_list = goods_info_list
        # 正版码资源位配置信息列表
        self.ad_info_list = ad_info_list

    def validate(self):
        if self.goods_info_list:
            for k in self.goods_info_list:
                if k:
                    k.validate()
        if self.ad_info_list:
            for k in self.ad_info_list:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.order_id is not None:
            result['order_id'] = self.order_id
        result['goods_info_list'] = []
        if self.goods_info_list is not None:
            for k in self.goods_info_list:
                result['goods_info_list'].append(k.to_map() if k else None)
        result['ad_info_list'] = []
        if self.ad_info_list is not None:
            for k in self.ad_info_list:
                result['ad_info_list'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('order_id') is not None:
            self.order_id = m.get('order_id')
        self.goods_info_list = []
        if m.get('goods_info_list') is not None:
            for k in m.get('goods_info_list'):
                temp_model = IPCodeGoodsInfo()
                self.goods_info_list.append(temp_model.from_map(k))
        self.ad_info_list = []
        if m.get('ad_info_list') is not None:
            for k in m.get('ad_info_list'):
                temp_model = IPCodeAdvertisingInfo()
                self.ad_info_list.append(temp_model.from_map(k))
        return self


class BatchqueryIpApprovalwithupdateRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        ip_name: str = None,
        ip_id: str = None,
        approval_status: int = None,
        page_size: int = None,
        page_index: int = None,
        ip_type: str = None,
        audience_group: str = None,
        create_begin_time: str = None,
        create_end_time: str = None,
        account_id: str = None,
        is_create_time_sort_desc: bool = None,
        channel_name: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础字段
        self.base_request = base_request
        # ip名称
        self.ip_name = ip_name
        # ip的id
        self.ip_id = ip_id
        # ip审批状态 0待审批，1 审批通过，2 审批拒绝
        self.approval_status = approval_status
        # 分页
        self.page_size = page_size
        # 分页
        self.page_index = page_index
        # ip类型
        self.ip_type = ip_type
        # 受众人群
        self.audience_group = audience_group
        # 开始时间
        self.create_begin_time = create_begin_time
        # 结束时间
        self.create_end_time = create_end_time
        # 商品的链上租户id
        self.account_id = account_id
        # 是否需要按照创建时间倒序排序
        # 
        self.is_create_time_sort_desc = is_create_time_sort_desc
        # 渠道名称
        self.channel_name = channel_name

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.page_size, 'page_size')
        self.validate_required(self.page_index, 'page_index')
        self.validate_required(self.create_begin_time, 'create_begin_time')
        if self.create_begin_time is not None:
            self.validate_pattern(self.create_begin_time, 'create_begin_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}([Z]|([\\.]\\d{1,9})?[\\+]\\d{2}[\\:]?\\d{2})')
        self.validate_required(self.create_end_time, 'create_end_time')
        if self.create_end_time is not None:
            self.validate_pattern(self.create_end_time, 'create_end_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}([Z]|([\\.]\\d{1,9})?[\\+]\\d{2}[\\:]?\\d{2})')
        self.validate_required(self.is_create_time_sort_desc, 'is_create_time_sort_desc')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.ip_name is not None:
            result['ip_name'] = self.ip_name
        if self.ip_id is not None:
            result['ip_id'] = self.ip_id
        if self.approval_status is not None:
            result['approval_status'] = self.approval_status
        if self.page_size is not None:
            result['page_size'] = self.page_size
        if self.page_index is not None:
            result['page_index'] = self.page_index
        if self.ip_type is not None:
            result['ip_type'] = self.ip_type
        if self.audience_group is not None:
            result['audience_group'] = self.audience_group
        if self.create_begin_time is not None:
            result['create_begin_time'] = self.create_begin_time
        if self.create_end_time is not None:
            result['create_end_time'] = self.create_end_time
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.is_create_time_sort_desc is not None:
            result['is_create_time_sort_desc'] = self.is_create_time_sort_desc
        if self.channel_name is not None:
            result['channel_name'] = self.channel_name
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('ip_name') is not None:
            self.ip_name = m.get('ip_name')
        if m.get('ip_id') is not None:
            self.ip_id = m.get('ip_id')
        if m.get('approval_status') is not None:
            self.approval_status = m.get('approval_status')
        if m.get('page_size') is not None:
            self.page_size = m.get('page_size')
        if m.get('page_index') is not None:
            self.page_index = m.get('page_index')
        if m.get('ip_type') is not None:
            self.ip_type = m.get('ip_type')
        if m.get('audience_group') is not None:
            self.audience_group = m.get('audience_group')
        if m.get('create_begin_time') is not None:
            self.create_begin_time = m.get('create_begin_time')
        if m.get('create_end_time') is not None:
            self.create_end_time = m.get('create_end_time')
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('is_create_time_sort_desc') is not None:
            self.is_create_time_sort_desc = m.get('is_create_time_sort_desc')
        if m.get('channel_name') is not None:
            self.channel_name = m.get('channel_name')
        return self


class BatchqueryIpApprovalwithupdateResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        ip_list: List[IpBasicInfoWithUpdate] = None,
        all_count: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 带上更新信息
        self.ip_list = ip_list
        # 总数
        self.all_count = all_count

    def validate(self):
        if self.ip_list:
            for k in self.ip_list:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        result['ip_list'] = []
        if self.ip_list is not None:
            for k in self.ip_list:
                result['ip_list'].append(k.to_map() if k else None)
        if self.all_count is not None:
            result['all_count'] = self.all_count
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        self.ip_list = []
        if m.get('ip_list') is not None:
            for k in m.get('ip_list'):
                temp_model = IpBasicInfoWithUpdate()
                self.ip_list.append(temp_model.from_map(k))
        if m.get('all_count') is not None:
            self.all_count = m.get('all_count')
        return self


class UpdateIpAccountRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        account_id: str = None,
        merchant_alias_name: str = None,
        merchant_type: int = None,
        merchant_cert_type: int = None,
        merchant_cert_number: str = None,
        contact_info: IPContactInfo = None,
        contact_address: IPAddressInfo = None,
        memo: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础参数
        self.base_request = base_request
        # 链上账户id
        self.account_id = account_id
        # 商户账户名称
        self.merchant_alias_name = merchant_alias_name
        # 商户类型(本期仅支持: 1:企业, 6:个人商户)
        self.merchant_type = merchant_type
        # 商户证件类型，201--统一社会信用证--营业执照号；
        self.merchant_cert_type = merchant_cert_type
        # 本期支持统一社会信用证代码
        self.merchant_cert_number = merchant_cert_number
        # 联系人信息
        self.contact_info = contact_info
        # 商户经营地址
        self.contact_address = contact_address
        # 备注信息
        self.memo = memo

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.merchant_alias_name, 'merchant_alias_name')
        self.validate_required(self.merchant_type, 'merchant_type')
        self.validate_required(self.merchant_cert_type, 'merchant_cert_type')
        if self.contact_info:
            self.contact_info.validate()
        if self.contact_address:
            self.contact_address.validate()

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.merchant_alias_name is not None:
            result['merchant_alias_name'] = self.merchant_alias_name
        if self.merchant_type is not None:
            result['merchant_type'] = self.merchant_type
        if self.merchant_cert_type is not None:
            result['merchant_cert_type'] = self.merchant_cert_type
        if self.merchant_cert_number is not None:
            result['merchant_cert_number'] = self.merchant_cert_number
        if self.contact_info is not None:
            result['contact_info'] = self.contact_info.to_map()
        if self.contact_address is not None:
            result['contact_address'] = self.contact_address.to_map()
        if self.memo is not None:
            result['memo'] = self.memo
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('merchant_alias_name') is not None:
            self.merchant_alias_name = m.get('merchant_alias_name')
        if m.get('merchant_type') is not None:
            self.merchant_type = m.get('merchant_type')
        if m.get('merchant_cert_type') is not None:
            self.merchant_cert_type = m.get('merchant_cert_type')
        if m.get('merchant_cert_number') is not None:
            self.merchant_cert_number = m.get('merchant_cert_number')
        if m.get('contact_info') is not None:
            temp_model = IPContactInfo()
            self.contact_info = temp_model.from_map(m['contact_info'])
        if m.get('contact_address') is not None:
            temp_model = IPAddressInfo()
            self.contact_address = temp_model.from_map(m['contact_address'])
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        return self


class UpdateIpAccountResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class QueryIpAccountsettlementRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        account_id: str = None,
        is_filtered: bool = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础参数
        self.base_request = base_request
        # 版权方的链上id
        self.account_id = account_id
        # 为空，返回所有数据，true，返回入驻数据，false，返回未入驻数据
        self.is_filtered = is_filtered

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.account_id, 'account_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.is_filtered is not None:
            result['is_filtered'] = self.is_filtered
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('is_filtered') is not None:
            self.is_filtered = m.get('is_filtered')
        return self


class QueryIpAccountsettlementResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        account_id: str = None,
        channel_list: List[AccountInChannels] = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 账号id
        self.account_id = account_id
        # 入驻的渠道列表
        self.channel_list = channel_list

    def validate(self):
        if self.channel_list:
            for k in self.channel_list:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.account_id is not None:
            result['account_id'] = self.account_id
        result['channel_list'] = []
        if self.channel_list is not None:
            for k in self.channel_list:
                result['channel_list'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        self.channel_list = []
        if m.get('channel_list') is not None:
            for k in m.get('channel_list'):
                temp_model = AccountInChannels()
                self.channel_list.append(temp_model.from_map(k))
        return self


class AddIpAccountsettlementRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        account_id: str = None,
        channel_name: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础参数
        self.base_request = base_request
        # 版权方id
        self.account_id = account_id
        # 要开通的渠道
        self.channel_name = channel_name

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.channel_name, 'channel_name')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.channel_name is not None:
            result['channel_name'] = self.channel_name
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('channel_name') is not None:
            self.channel_name = m.get('channel_name')
        return self


class AddIpAccountsettlementResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class SignIpOrdercontractRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        ip_order_id: str = None,
        contract_file_url: str = None,
        memo: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础请求参数
        self.base_request = base_request
        # 订单ID
        self.ip_order_id = ip_order_id
        # 订单合同文件OSS文件key
        self.contract_file_url = contract_file_url
        # 备注信息
        self.memo = memo

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.ip_order_id, 'ip_order_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.ip_order_id is not None:
            result['ip_order_id'] = self.ip_order_id
        if self.contract_file_url is not None:
            result['contract_file_url'] = self.contract_file_url
        if self.memo is not None:
            result['memo'] = self.memo
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('ip_order_id') is not None:
            self.ip_order_id = m.get('ip_order_id')
        if m.get('contract_file_url') is not None:
            self.contract_file_url = m.get('contract_file_url')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        return self


class SignIpOrdercontractResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        signed_contract_file: str = None,
        signed_contract_file_url: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 签署完成的文件OSS key。只有在签署流程全部完成后才会返回该数据。
        self.signed_contract_file = signed_contract_file
        # 签署完成的文件下载链接。只有在签署流程全部完成后才会返回该数据。
        self.signed_contract_file_url = signed_contract_file_url

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.signed_contract_file is not None:
            result['signed_contract_file'] = self.signed_contract_file
        if self.signed_contract_file_url is not None:
            result['signed_contract_file_url'] = self.signed_contract_file_url
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('signed_contract_file') is not None:
            self.signed_contract_file = m.get('signed_contract_file')
        if m.get('signed_contract_file_url') is not None:
            self.signed_contract_file_url = m.get('signed_contract_file_url')
        return self


class SetIpOrdergoodsidsRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        ip_order_id: str = None,
        goods_id_list: List[str] = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础请求参数
        self.base_request = base_request
        # 订单ID
        self.ip_order_id = ip_order_id
        # 商品ID列表
        self.goods_id_list = goods_id_list

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.ip_order_id, 'ip_order_id')
        self.validate_required(self.goods_id_list, 'goods_id_list')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.ip_order_id is not None:
            result['ip_order_id'] = self.ip_order_id
        if self.goods_id_list is not None:
            result['goods_id_list'] = self.goods_id_list
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('ip_order_id') is not None:
            self.ip_order_id = m.get('ip_order_id')
        if m.get('goods_id_list') is not None:
            self.goods_id_list = m.get('goods_id_list')
        return self


class SetIpOrdergoodsidsResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class PagequeryIpSalesbydayRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        page_number: int = None,
        page_size: int = None,
        ip_order_id: str = None,
        date: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础请求参数
        self.base_request = base_request
        # 页码
        self.page_number = page_number
        # 每页数据量大小
        self.page_size = page_size
        # 订单ID筛选条件
        self.ip_order_id = ip_order_id
        # 日期
        self.date = date

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.page_number, 'page_number')
        self.validate_required(self.page_size, 'page_size')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.page_number is not None:
            result['page_number'] = self.page_number
        if self.page_size is not None:
            result['page_size'] = self.page_size
        if self.ip_order_id is not None:
            result['ip_order_id'] = self.ip_order_id
        if self.date is not None:
            result['date'] = self.date
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('page_number') is not None:
            self.page_number = m.get('page_number')
        if m.get('page_size') is not None:
            self.page_size = m.get('page_size')
        if m.get('ip_order_id') is not None:
            self.ip_order_id = m.get('ip_order_id')
        if m.get('date') is not None:
            self.date = m.get('date')
        return self


class PagequeryIpSalesbydayResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        page_number: int = None,
        page_size: int = None,
        total_count: int = None,
        sales_bday_list: List[SalesByDay] = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 页码
        self.page_number = page_number
        # 页面数据量大小
        self.page_size = page_size
        # 数据总数
        self.total_count = total_count
        # T+1日的销售数据统计数据列表
        self.sales_bday_list = sales_bday_list

    def validate(self):
        if self.sales_bday_list:
            for k in self.sales_bday_list:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.page_number is not None:
            result['page_number'] = self.page_number
        if self.page_size is not None:
            result['page_size'] = self.page_size
        if self.total_count is not None:
            result['total_count'] = self.total_count
        result['sales_b_day_list'] = []
        if self.sales_bday_list is not None:
            for k in self.sales_bday_list:
                result['sales_b_day_list'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('page_number') is not None:
            self.page_number = m.get('page_number')
        if m.get('page_size') is not None:
            self.page_size = m.get('page_size')
        if m.get('total_count') is not None:
            self.total_count = m.get('total_count')
        self.sales_bday_list = []
        if m.get('sales_b_day_list') is not None:
            for k in m.get('sales_b_day_list'):
                temp_model = SalesByDay()
                self.sales_bday_list.append(temp_model.from_map(k))
        return self


class CreateIpCopyrightRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        file_name: str = None,
        file_url: str = None,
        file_type: str = None,
        cert_name: str = None,
        cert_type: str = None,
        cert_no: str = None,
        create_certificate: bool = None,
        certificate_type: str = None,
        certificate_package: bool = None,
        org_id: str = None,
        phone_num: str = None,
        memo: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础参数
        self.base_request = base_request
        # 【暂不支持中文】文件名称
        self.file_name = file_name
        # 文件oss地址
        self.file_url = file_url
        # 文件类型，IMAGE：图片文件；TEXT：文本文件；VIDEO：视屏；AUDIO：音频；ZIP：压缩包；FILE：其他文件
        self.file_type = file_type
        # 【需要真实的】版权方法人证件名称
        self.cert_name = cert_name
        # 证件类型
        self.cert_type = cert_type
        # 【需要真实的】版权方法人证件号码
        self.cert_no = cert_no
        # 是否创建证书，此时默认选true
        self.create_certificate = create_certificate
        # 证书类型，公证处证书，值为NotaryOffice
        self.certificate_type = certificate_type
        # 是否创建证据包，默认选否，如果没有创建公证书，不支持证据包
        self.certificate_package = certificate_package
        # 公证处ID，默认为LUJIANG，鹭江公证处
        self.org_id = org_id
        # 电话号码，生成公证处证书需要，格式范例，(86-573)2651630或(86)13738258505
        self.phone_num = phone_num
        # 备注，最长不超过512字符
        self.memo = memo

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.file_name, 'file_name')
        self.validate_required(self.file_url, 'file_url')
        self.validate_required(self.file_type, 'file_type')
        self.validate_required(self.cert_name, 'cert_name')
        self.validate_required(self.cert_type, 'cert_type')
        self.validate_required(self.cert_no, 'cert_no')
        self.validate_required(self.create_certificate, 'create_certificate')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.file_name is not None:
            result['file_name'] = self.file_name
        if self.file_url is not None:
            result['file_url'] = self.file_url
        if self.file_type is not None:
            result['file_type'] = self.file_type
        if self.cert_name is not None:
            result['cert_name'] = self.cert_name
        if self.cert_type is not None:
            result['cert_type'] = self.cert_type
        if self.cert_no is not None:
            result['cert_no'] = self.cert_no
        if self.create_certificate is not None:
            result['create_certificate'] = self.create_certificate
        if self.certificate_type is not None:
            result['certificate_type'] = self.certificate_type
        if self.certificate_package is not None:
            result['certificate_package'] = self.certificate_package
        if self.org_id is not None:
            result['org_id'] = self.org_id
        if self.phone_num is not None:
            result['phone_num'] = self.phone_num
        if self.memo is not None:
            result['memo'] = self.memo
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('file_name') is not None:
            self.file_name = m.get('file_name')
        if m.get('file_url') is not None:
            self.file_url = m.get('file_url')
        if m.get('file_type') is not None:
            self.file_type = m.get('file_type')
        if m.get('cert_name') is not None:
            self.cert_name = m.get('cert_name')
        if m.get('cert_type') is not None:
            self.cert_type = m.get('cert_type')
        if m.get('cert_no') is not None:
            self.cert_no = m.get('cert_no')
        if m.get('create_certificate') is not None:
            self.create_certificate = m.get('create_certificate')
        if m.get('certificate_type') is not None:
            self.certificate_type = m.get('certificate_type')
        if m.get('certificate_package') is not None:
            self.certificate_package = m.get('certificate_package')
        if m.get('org_id') is not None:
            self.org_id = m.get('org_id')
        if m.get('phone_num') is not None:
            self.phone_num = m.get('phone_num')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        return self


class CreateIpCopyrightResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        copyright_register_id: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 版权登记id
        self.copyright_register_id = copyright_register_id

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.copyright_register_id is not None:
            result['copyright_register_id'] = self.copyright_register_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('copyright_register_id') is not None:
            self.copyright_register_id = m.get('copyright_register_id')
        return self


class QueryIpCopyrightRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        copyright_register_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础参数
        self.base_request = base_request
        # 版权登记id
        self.copyright_register_id = copyright_register_id

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.copyright_register_id, 'copyright_register_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.copyright_register_id is not None:
            result['copyright_register_id'] = self.copyright_register_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('copyright_register_id') is not None:
            self.copyright_register_id = m.get('copyright_register_id')
        return self


class QueryIpCopyrightResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        status: str = None,
        hash: str = None,
        tx_hash: str = None,
        block_height: int = None,
        timestamp: int = None,
        certificate_oss: str = None,
        certificate_downurl: str = None,
        certificate_no: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 存证状态，PROCESSING：存证中；SUCCESS：存证成功；FAIL：存证失败
        self.status = status
        # 文件hash
        self.hash = hash
        # 存证交易hash
        self.tx_hash = tx_hash
        # 存证块高
        self.block_height = block_height
        # 存证时间
        self.timestamp = timestamp
        # 证书oss地址
        self.certificate_oss = certificate_oss
        # 证书下载链接
        self.certificate_downurl = certificate_downurl
        # 公证处证书编号
        self.certificate_no = certificate_no

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.status is not None:
            result['status'] = self.status
        if self.hash is not None:
            result['hash'] = self.hash
        if self.tx_hash is not None:
            result['tx_hash'] = self.tx_hash
        if self.block_height is not None:
            result['block_height'] = self.block_height
        if self.timestamp is not None:
            result['timestamp'] = self.timestamp
        if self.certificate_oss is not None:
            result['certificate_oss'] = self.certificate_oss
        if self.certificate_downurl is not None:
            result['certificate_downurl'] = self.certificate_downurl
        if self.certificate_no is not None:
            result['certificate_no'] = self.certificate_no
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('status') is not None:
            self.status = m.get('status')
        if m.get('hash') is not None:
            self.hash = m.get('hash')
        if m.get('tx_hash') is not None:
            self.tx_hash = m.get('tx_hash')
        if m.get('block_height') is not None:
            self.block_height = m.get('block_height')
        if m.get('timestamp') is not None:
            self.timestamp = m.get('timestamp')
        if m.get('certificate_oss') is not None:
            self.certificate_oss = m.get('certificate_oss')
        if m.get('certificate_downurl') is not None:
            self.certificate_downurl = m.get('certificate_downurl')
        if m.get('certificate_no') is not None:
            self.certificate_no = m.get('certificate_no')
        return self


class SetIpOrdermemoRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        ip_order_id: str = None,
        memo: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础请求参数
        self.base_request = base_request
        # 订单ID
        self.ip_order_id = ip_order_id
        # 备注信息
        self.memo = memo

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.ip_order_id, 'ip_order_id')
        self.validate_required(self.memo, 'memo')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.ip_order_id is not None:
            result['ip_order_id'] = self.ip_order_id
        if self.memo is not None:
            result['memo'] = self.memo
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('ip_order_id') is not None:
            self.ip_order_id = m.get('ip_order_id')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        return self


class SetIpOrdermemoResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class ConfirmIpAccountsettlementRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        account_id: str = None,
        channel_name: str = None,
        approve_comment: str = None,
        memo: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础参数
        self.base_request = base_request
        # 版权方的链上id
        self.account_id = account_id
        # 开通的渠道名称
        self.channel_name = channel_name
        # 审批意见，refuse,不同意开通，agree，同意开通，默认为agree，本期暂不支持不同意开通
        self.approve_comment = approve_comment
        # 备注信息
        self.memo = memo

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.account_id, 'account_id')
        self.validate_required(self.channel_name, 'channel_name')
        self.validate_required(self.approve_comment, 'approve_comment')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.account_id is not None:
            result['account_id'] = self.account_id
        if self.channel_name is not None:
            result['channel_name'] = self.channel_name
        if self.approve_comment is not None:
            result['approve_comment'] = self.approve_comment
        if self.memo is not None:
            result['memo'] = self.memo
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('account_id') is not None:
            self.account_id = m.get('account_id')
        if m.get('channel_name') is not None:
            self.channel_name = m.get('channel_name')
        if m.get('approve_comment') is not None:
            self.approve_comment = m.get('approve_comment')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        return self


class ConfirmIpAccountsettlementResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class PagequeryIpSalesRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        ip_order_id: str = None,
        ip_bill_id: str = None,
        order_by: str = None,
        order: str = None,
        page_number: int = None,
        page_size: int = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础请求参数
        self.base_request = base_request
        # 订单ID。和账单ID 两个字段只能选填一个
        self.ip_order_id = ip_order_id
        # 账单ID。和订单ID 两个字段只能选填一个
        self.ip_bill_id = ip_bill_id
        # 排序字段
        self.order_by = order_by
        # 排序顺序：正序还是倒序
        self.order = order
        # 页码
        self.page_number = page_number
        # 每页数据量大小
        self.page_size = page_size

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.order_by, 'order_by')
        self.validate_required(self.order, 'order')
        self.validate_required(self.page_number, 'page_number')
        self.validate_required(self.page_size, 'page_size')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.ip_order_id is not None:
            result['ip_order_id'] = self.ip_order_id
        if self.ip_bill_id is not None:
            result['ip_bill_id'] = self.ip_bill_id
        if self.order_by is not None:
            result['order_by'] = self.order_by
        if self.order is not None:
            result['order'] = self.order
        if self.page_number is not None:
            result['page_number'] = self.page_number
        if self.page_size is not None:
            result['page_size'] = self.page_size
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('ip_order_id') is not None:
            self.ip_order_id = m.get('ip_order_id')
        if m.get('ip_bill_id') is not None:
            self.ip_bill_id = m.get('ip_bill_id')
        if m.get('order_by') is not None:
            self.order_by = m.get('order_by')
        if m.get('order') is not None:
            self.order = m.get('order')
        if m.get('page_number') is not None:
            self.page_number = m.get('page_number')
        if m.get('page_size') is not None:
            self.page_size = m.get('page_size')
        return self


class PagequeryIpSalesResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        ip_order_id: str = None,
        ip_bill_id: str = None,
        ip_sales_info_list: List[IPSalesInfo] = None,
        page_number: int = None,
        page_size: int = None,
        total_count: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 订单ID
        self.ip_order_id = ip_order_id
        # 账单ID
        self.ip_bill_id = ip_bill_id
        # IP授权销售数据
        self.ip_sales_info_list = ip_sales_info_list
        # 页码
        self.page_number = page_number
        # 页面大小
        self.page_size = page_size
        # 销售数据总数
        self.total_count = total_count

    def validate(self):
        if self.ip_sales_info_list:
            for k in self.ip_sales_info_list:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.ip_order_id is not None:
            result['ip_order_id'] = self.ip_order_id
        if self.ip_bill_id is not None:
            result['ip_bill_id'] = self.ip_bill_id
        result['ip_sales_info_list'] = []
        if self.ip_sales_info_list is not None:
            for k in self.ip_sales_info_list:
                result['ip_sales_info_list'].append(k.to_map() if k else None)
        if self.page_number is not None:
            result['page_number'] = self.page_number
        if self.page_size is not None:
            result['page_size'] = self.page_size
        if self.total_count is not None:
            result['total_count'] = self.total_count
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('ip_order_id') is not None:
            self.ip_order_id = m.get('ip_order_id')
        if m.get('ip_bill_id') is not None:
            self.ip_bill_id = m.get('ip_bill_id')
        self.ip_sales_info_list = []
        if m.get('ip_sales_info_list') is not None:
            for k in m.get('ip_sales_info_list'):
                temp_model = IPSalesInfo()
                self.ip_sales_info_list.append(temp_model.from_map(k))
        if m.get('page_number') is not None:
            self.page_number = m.get('page_number')
        if m.get('page_size') is not None:
            self.page_size = m.get('page_size')
        if m.get('total_count') is not None:
            self.total_count = m.get('total_count')
        return self


class BatchqueryIpAccountsettlementRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        channel_name: str = None,
        apply_status: str = None,
        page_size: int = None,
        page_index: int = None,
        memo: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础参数
        self.base_request = base_request
        # 渠道名称
        self.channel_name = channel_name
        # 申请状态，0为全部，1为待审核，2为已审核
        self.apply_status = apply_status
        # 分页大小
        self.page_size = page_size
        # 分页索引
        self.page_index = page_index
        # 备注信息
        self.memo = memo

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.channel_name, 'channel_name')
        self.validate_required(self.apply_status, 'apply_status')
        self.validate_required(self.page_size, 'page_size')
        self.validate_required(self.page_index, 'page_index')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.channel_name is not None:
            result['channel_name'] = self.channel_name
        if self.apply_status is not None:
            result['apply_status'] = self.apply_status
        if self.page_size is not None:
            result['page_size'] = self.page_size
        if self.page_index is not None:
            result['page_index'] = self.page_index
        if self.memo is not None:
            result['memo'] = self.memo
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('channel_name') is not None:
            self.channel_name = m.get('channel_name')
        if m.get('apply_status') is not None:
            self.apply_status = m.get('apply_status')
        if m.get('page_size') is not None:
            self.page_size = m.get('page_size')
        if m.get('page_index') is not None:
            self.page_index = m.get('page_index')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        return self


class BatchqueryIpAccountsettlementResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        account_info: List[AccountSettlementInfo] = None,
        all_count: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 渠道对应的版权方信息
        self.account_info = account_info
        # 结果总数，不是列表值，用于分页
        self.all_count = all_count

    def validate(self):
        if self.account_info:
            for k in self.account_info:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        result['account_info'] = []
        if self.account_info is not None:
            for k in self.account_info:
                result['account_info'].append(k.to_map() if k else None)
        if self.all_count is not None:
            result['all_count'] = self.all_count
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        self.account_info = []
        if m.get('account_info') is not None:
            for k in m.get('account_info'):
                temp_model = AccountSettlementInfo()
                self.account_info.append(temp_model.from_map(k))
        if m.get('all_count') is not None:
            self.all_count = m.get('all_count')
        return self


class PullIpCodeRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        base_request: BaseRequestInfo = None,
        code_batch_id: str = None,
        page_index: int = None,
        page_size: int = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 基础参数
        self.base_request = base_request
        # 正版码批次编码
        self.code_batch_id = code_batch_id
        # 分页参数:页码
        self.page_index = page_index
        # 分页参数:每页条目数(请小于2000)
        self.page_size = page_size

    def validate(self):
        self.validate_required(self.base_request, 'base_request')
        if self.base_request:
            self.base_request.validate()
        self.validate_required(self.code_batch_id, 'code_batch_id')
        self.validate_required(self.page_index, 'page_index')
        self.validate_required(self.page_size, 'page_size')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.base_request is not None:
            result['base_request'] = self.base_request.to_map()
        if self.code_batch_id is not None:
            result['code_batch_id'] = self.code_batch_id
        if self.page_index is not None:
            result['page_index'] = self.page_index
        if self.page_size is not None:
            result['page_size'] = self.page_size
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('base_request') is not None:
            temp_model = BaseRequestInfo()
            self.base_request = temp_model.from_map(m['base_request'])
        if m.get('code_batch_id') is not None:
            self.code_batch_id = m.get('code_batch_id')
        if m.get('page_index') is not None:
            self.page_index = m.get('page_index')
        if m.get('page_size') is not None:
            self.page_size = m.get('page_size')
        return self


class PullIpCodeResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        code_list: List[str] = None,
        order_id: str = None,
        buyer_account_id: str = None,
        seller_account_id: str = None,
        ip_id: str = None,
        ip_name: str = None,
        ip_image: str = None,
        ip_desc: str = None,
        expired_date: int = None,
        total_count: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 正版码列表(小程序扫描可跳转)
        self.code_list = code_list
        # 交易订单ID
        self.order_id = order_id
        # IP商家的链上账户ID
        self.buyer_account_id = buyer_account_id
        # IP版权方的链上账户ID
        self.seller_account_id = seller_account_id
        # IPID
        self.ip_id = ip_id
        # IP名称
        self.ip_name = ip_name
        # IP主图的OSS地址
        self.ip_image = ip_image
        # IP描述
        self.ip_desc = ip_desc
        # 该批次正版码的过期时间戳(毫秒)
        self.expired_date = expired_date
        # 总数量
        self.total_count = total_count

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.code_list is not None:
            result['code_list'] = self.code_list
        if self.order_id is not None:
            result['order_id'] = self.order_id
        if self.buyer_account_id is not None:
            result['buyer_account_id'] = self.buyer_account_id
        if self.seller_account_id is not None:
            result['seller_account_id'] = self.seller_account_id
        if self.ip_id is not None:
            result['ip_id'] = self.ip_id
        if self.ip_name is not None:
            result['ip_name'] = self.ip_name
        if self.ip_image is not None:
            result['ip_image'] = self.ip_image
        if self.ip_desc is not None:
            result['ip_desc'] = self.ip_desc
        if self.expired_date is not None:
            result['expired_date'] = self.expired_date
        if self.total_count is not None:
            result['total_count'] = self.total_count
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('code_list') is not None:
            self.code_list = m.get('code_list')
        if m.get('order_id') is not None:
            self.order_id = m.get('order_id')
        if m.get('buyer_account_id') is not None:
            self.buyer_account_id = m.get('buyer_account_id')
        if m.get('seller_account_id') is not None:
            self.seller_account_id = m.get('seller_account_id')
        if m.get('ip_id') is not None:
            self.ip_id = m.get('ip_id')
        if m.get('ip_name') is not None:
            self.ip_name = m.get('ip_name')
        if m.get('ip_image') is not None:
            self.ip_image = m.get('ip_image')
        if m.get('ip_desc') is not None:
            self.ip_desc = m.get('ip_desc')
        if m.get('expired_date') is not None:
            self.expired_date = m.get('expired_date')
        if m.get('total_count') is not None:
            self.total_count = m.get('total_count')
        return self


class QueryBlockanalysisBlockRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        block_number: int = None,
        chain_id: str = None,
        delegated_tenant_ids: List[str] = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 区块高度
        self.block_number = block_number
        # 链ID
        self.chain_id = chain_id
        # 代理查询区块信息，传入代理租户需有代理权限。接口会返回调用者和被代理租户能查看的所有交易信息。
        self.delegated_tenant_ids = delegated_tenant_ids

    def validate(self):
        self.validate_required(self.block_number, 'block_number')
        self.validate_required(self.chain_id, 'chain_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.block_number is not None:
            result['block_number'] = self.block_number
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.delegated_tenant_ids is not None:
            result['delegated_tenant_ids'] = self.delegated_tenant_ids
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('block_number') is not None:
            self.block_number = m.get('block_number')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('delegated_tenant_ids') is not None:
            self.delegated_tenant_ids = m.get('delegated_tenant_ids')
        return self


class QueryBlockanalysisBlockResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        block: Block = None,
        block_number: int = None,
        chain_id: str = None,
        filtered_tx_count: int = None,
        total_tx_count: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 区块信息
        self.block = block
        # 区块高度
        self.block_number = block_number
        # 链ID
        self.chain_id = chain_id
        # 过滤后的交易数量
        self.filtered_tx_count = filtered_tx_count
        # 区块中交易总数
        self.total_tx_count = total_tx_count

    def validate(self):
        if self.block:
            self.block.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.block is not None:
            result['block'] = self.block.to_map()
        if self.block_number is not None:
            result['block_number'] = self.block_number
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.filtered_tx_count is not None:
            result['filtered_tx_count'] = self.filtered_tx_count
        if self.total_tx_count is not None:
            result['total_tx_count'] = self.total_tx_count
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('block') is not None:
            temp_model = Block()
            self.block = temp_model.from_map(m['block'])
        if m.get('block_number') is not None:
            self.block_number = m.get('block_number')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('filtered_tx_count') is not None:
            self.filtered_tx_count = m.get('filtered_tx_count')
        if m.get('total_tx_count') is not None:
            self.total_tx_count = m.get('total_tx_count')
        return self


class QueryBlockanalysisLastblocknumberRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        return self


class QueryBlockanalysisLastblocknumberResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        block_number: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 区块链最高区块高度
        self.block_number = block_number

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.block_number is not None:
            result['block_number'] = self.block_number
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('block_number') is not None:
            self.block_number = m.get('block_number')
        return self


class QueryBlockanalysisOpenedequitiesRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        count: int = None,
        page: int = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 每页数据量
        self.count = count
        # 页数
        self.page = page

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.count is not None:
            result['count'] = self.count
        if self.page is not None:
            result['page'] = self.page
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('count') is not None:
            self.count = m.get('count')
        if m.get('page') is not None:
            self.page = m.get('page')
        return self


class QueryBlockanalysisOpenedequitiesResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        equities: List[OpenedEquity] = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 权益商品信息详细信息list
        self.equities = equities

    def validate(self):
        if self.equities:
            for k in self.equities:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        result['equities'] = []
        if self.equities is not None:
            for k in self.equities:
                result['equities'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        self.equities = []
        if m.get('equities') is not None:
            for k in m.get('equities'):
                temp_model = OpenedEquity()
                self.equities.append(temp_model.from_map(k))
        return self


class QueryBlockanalysisUserpriceupdatedequitiesRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        count: int = None,
        page: int = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 每页数量
        self.count = count
        # 页码
        self.page = page

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.count is not None:
            result['count'] = self.count
        if self.page is not None:
            result['page'] = self.page
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('count') is not None:
            self.count = m.get('count')
        if m.get('page') is not None:
            self.page = m.get('page')
        return self


class QueryBlockanalysisUserpriceupdatedequitiesResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        equities: List[UserPriceEquity] = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 权益商品信息详细信息list
        self.equities = equities

    def validate(self):
        if self.equities:
            for k in self.equities:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        result['equities'] = []
        if self.equities is not None:
            for k in self.equities:
                result['equities'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        self.equities = []
        if m.get('equities') is not None:
            for k in m.get('equities'):
                temp_model = UserPriceEquity()
                self.equities.append(temp_model.from_map(k))
        return self


class QueryBlockanalysisUnwriteoffvalueRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        asset_id: str = None,
        chain_id: str = None,
        opt_tenant_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 资产ID
        self.asset_id = asset_id
        # 链ID
        self.chain_id = chain_id
        # 要查询的租户ID
        self.opt_tenant_id = opt_tenant_id

    def validate(self):
        self.validate_required(self.asset_id, 'asset_id')
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.opt_tenant_id, 'opt_tenant_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.asset_id is not None:
            result['asset_id'] = self.asset_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.opt_tenant_id is not None:
            result['opt_tenant_id'] = self.opt_tenant_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('asset_id') is not None:
            self.asset_id = m.get('asset_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('opt_tenant_id') is not None:
            self.opt_tenant_id = m.get('opt_tenant_id')
        return self


class QueryBlockanalysisUnwriteoffvalueResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        asset_id: str = None,
        tenant_id: str = None,
        total_value: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 资产ID
        self.asset_id = asset_id
        # 租户ID
        self.tenant_id = tenant_id
        # 未核销的资产总额（单位：元）
        self.total_value = total_value

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.asset_id is not None:
            result['asset_id'] = self.asset_id
        if self.tenant_id is not None:
            result['tenant_id'] = self.tenant_id
        if self.total_value is not None:
            result['total_value'] = self.total_value
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('asset_id') is not None:
            self.asset_id = m.get('asset_id')
        if m.get('tenant_id') is not None:
            self.tenant_id = m.get('tenant_id')
        if m.get('total_value') is not None:
            self.total_value = m.get('total_value')
        return self


class UpdateBlockanalysisDelegaterelationRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        delegated_tenant_id: str = None,
        opt_tenant_id: str = None,
        opt_type: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 被代理的租户ID
        self.delegated_tenant_id = delegated_tenant_id
        # 代理租户ID
        self.opt_tenant_id = opt_tenant_id
        # 操作类型，ADD表示添加，SUB表示撤销
        self.opt_type = opt_type

    def validate(self):
        self.validate_required(self.delegated_tenant_id, 'delegated_tenant_id')
        self.validate_required(self.opt_tenant_id, 'opt_tenant_id')
        self.validate_required(self.opt_type, 'opt_type')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.delegated_tenant_id is not None:
            result['delegated_tenant_id'] = self.delegated_tenant_id
        if self.opt_tenant_id is not None:
            result['opt_tenant_id'] = self.opt_tenant_id
        if self.opt_type is not None:
            result['opt_type'] = self.opt_type
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('delegated_tenant_id') is not None:
            self.delegated_tenant_id = m.get('delegated_tenant_id')
        if m.get('opt_tenant_id') is not None:
            self.opt_tenant_id = m.get('opt_tenant_id')
        if m.get('opt_type') is not None:
            self.opt_type = m.get('opt_type')
        return self


class UpdateBlockanalysisDelegaterelationResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class UpdateBlockanalysisWhitelistRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        opt_tenant_id: str = None,
        opt_type: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 租户ID
        self.opt_tenant_id = opt_tenant_id
        # 操作类型
        self.opt_type = opt_type

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.opt_tenant_id, 'opt_tenant_id')
        self.validate_required(self.opt_type, 'opt_type')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.opt_tenant_id is not None:
            result['opt_tenant_id'] = self.opt_tenant_id
        if self.opt_type is not None:
            result['opt_type'] = self.opt_type
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('opt_tenant_id') is not None:
            self.opt_tenant_id = m.get('opt_tenant_id')
        if m.get('opt_type') is not None:
            self.opt_type = m.get('opt_type')
        return self


class UpdateBlockanalysisWhitelistResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        return self


class QueryBlockanalysisDelegaterelationRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        delegated_tenant_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 被代理的租户ID
        self.delegated_tenant_id = delegated_tenant_id

    def validate(self):
        self.validate_required(self.delegated_tenant_id, 'delegated_tenant_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.delegated_tenant_id is not None:
            result['delegated_tenant_id'] = self.delegated_tenant_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('delegated_tenant_id') is not None:
            self.delegated_tenant_id = m.get('delegated_tenant_id')
        return self


class QueryBlockanalysisDelegaterelationResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        delegate_relation_infos: List[DelegateRelationInfo] = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 代理授权关系信息
        self.delegate_relation_infos = delegate_relation_infos

    def validate(self):
        if self.delegate_relation_infos:
            for k in self.delegate_relation_infos:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        result['delegate_relation_infos'] = []
        if self.delegate_relation_infos is not None:
            for k in self.delegate_relation_infos:
                result['delegate_relation_infos'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        self.delegate_relation_infos = []
        if m.get('delegate_relation_infos') is not None:
            for k in m.get('delegate_relation_infos'):
                temp_model = DelegateRelationInfo()
                self.delegate_relation_infos.append(temp_model.from_map(k))
        return self


class QueryBlockanalysisWhitelistRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        tenant_id: str = None,
        chain_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 查询该租户的白名单信息
        self.tenant_id = tenant_id
        # 查询链的白名单信息
        self.chain_id = chain_id

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.tenant_id is not None:
            result['tenant_id'] = self.tenant_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('tenant_id') is not None:
            self.tenant_id = m.get('tenant_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        return self


class QueryBlockanalysisWhitelistResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        white_list: List[APIWhiteListInfo] = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 接口白名单信息
        self.white_list = white_list

    def validate(self):
        if self.white_list:
            for k in self.white_list:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        result['white_list'] = []
        if self.white_list is not None:
            for k in self.white_list:
                result['white_list'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        self.white_list = []
        if m.get('white_list') is not None:
            for k in m.get('white_list'):
                temp_model = APIWhiteListInfo()
                self.white_list.append(temp_model.from_map(k))
        return self


class QueryBlockanalysisTransactionRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        tx_hash: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 交易hash
        self.tx_hash = tx_hash

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.tx_hash, 'tx_hash')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.tx_hash is not None:
            result['tx_hash'] = self.tx_hash
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('tx_hash') is not None:
            self.tx_hash = m.get('tx_hash')
        return self


class QueryBlockanalysisTransactionResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        block_number: int = None,
        data: str = None,
        from_: str = None,
        receipt: BlockReceipt = None,
        timestamp: str = None,
        to: str = None,
        tx_hash: str = None,
        tx_type: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 区块高度
        self.block_number = block_number
        # 交易数据，hex格式
        self.data = data
        # 交易发起方
        self.from_ = from_
        # 交易单据信息
        self.receipt = receipt
        # 交易时间戳
        self.timestamp = timestamp
        # 交易接收方
        self.to = to
        # 交易hash
        self.tx_hash = tx_hash
        # 交易类型
        self.tx_type = tx_type

    def validate(self):
        if self.receipt:
            self.receipt.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.block_number is not None:
            result['block_number'] = self.block_number
        if self.data is not None:
            result['data'] = self.data
        if self.from_ is not None:
            result['from'] = self.from_
        if self.receipt is not None:
            result['receipt'] = self.receipt.to_map()
        if self.timestamp is not None:
            result['timestamp'] = self.timestamp
        if self.to is not None:
            result['to'] = self.to
        if self.tx_hash is not None:
            result['tx_hash'] = self.tx_hash
        if self.tx_type is not None:
            result['tx_type'] = self.tx_type
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('block_number') is not None:
            self.block_number = m.get('block_number')
        if m.get('data') is not None:
            self.data = m.get('data')
        if m.get('from') is not None:
            self.from_ = m.get('from')
        if m.get('receipt') is not None:
            temp_model = BlockReceipt()
            self.receipt = temp_model.from_map(m['receipt'])
        if m.get('timestamp') is not None:
            self.timestamp = m.get('timestamp')
        if m.get('to') is not None:
            self.to = m.get('to')
        if m.get('tx_hash') is not None:
            self.tx_hash = m.get('tx_hash')
        if m.get('tx_type') is not None:
            self.tx_type = m.get('tx_type')
        return self


class QueryBlockanalysisEquityauthlistRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        count: int = None,
        equity_id: str = None,
        page: int = None,
        delegated_tenant_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 分页查询每页数量
        self.count = count
        # 商品ID
        self.equity_id = equity_id
        # 分页查询页码
        self.page = page
        # 代理租户ID
        self.delegated_tenant_id = delegated_tenant_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.count, 'count')
        self.validate_required(self.equity_id, 'equity_id')
        self.validate_required(self.page, 'page')
        self.validate_required(self.delegated_tenant_id, 'delegated_tenant_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.count is not None:
            result['count'] = self.count
        if self.equity_id is not None:
            result['equity_id'] = self.equity_id
        if self.page is not None:
            result['page'] = self.page
        if self.delegated_tenant_id is not None:
            result['delegated_tenant_id'] = self.delegated_tenant_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('count') is not None:
            self.count = m.get('count')
        if m.get('equity_id') is not None:
            self.equity_id = m.get('equity_id')
        if m.get('page') is not None:
            self.page = m.get('page')
        if m.get('delegated_tenant_id') is not None:
            self.delegated_tenant_id = m.get('delegated_tenant_id')
        return self


class QueryBlockanalysisEquityauthlistResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        equity_auth_list: List[EquityAuthInfo] = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 商品授权信息（一客一价信息）列表
        self.equity_auth_list = equity_auth_list

    def validate(self):
        if self.equity_auth_list:
            for k in self.equity_auth_list:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        result['equity_auth_list'] = []
        if self.equity_auth_list is not None:
            for k in self.equity_auth_list:
                result['equity_auth_list'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        self.equity_auth_list = []
        if m.get('equity_auth_list') is not None:
            for k in m.get('equity_auth_list'):
                temp_model = EquityAuthInfo()
                self.equity_auth_list.append(temp_model.from_map(k))
        return self


class QueryBlockanalysisNextblockRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        block_number: int = None,
        chain_id: str = None,
        delegated_tenant_ids: List[str] = None,
        timeout: int = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 区块高度
        self.block_number = block_number
        # 链ID
        self.chain_id = chain_id
        # 代理查询区块信息，传入代理租户需有代理权限。接口会返回调用者和被代理租户能查看的所有交易信息。
        self.delegated_tenant_ids = delegated_tenant_ids
        # 查询区块超时时间，单位s，范围小于6s
        self.timeout = timeout

    def validate(self):
        self.validate_required(self.block_number, 'block_number')
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.timeout, 'timeout')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.block_number is not None:
            result['block_number'] = self.block_number
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.delegated_tenant_ids is not None:
            result['delegated_tenant_ids'] = self.delegated_tenant_ids
        if self.timeout is not None:
            result['timeout'] = self.timeout
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('block_number') is not None:
            self.block_number = m.get('block_number')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('delegated_tenant_ids') is not None:
            self.delegated_tenant_ids = m.get('delegated_tenant_ids')
        if m.get('timeout') is not None:
            self.timeout = m.get('timeout')
        return self


class QueryBlockanalysisNextblockResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        block: Block = None,
        block_number: int = None,
        chain_id: str = None,
        filtered_tx_count: int = None,
        total_tx_count: int = None,
        next_block_number: int = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 区块信息
        self.block = block
        # 区块高度
        self.block_number = block_number
        # 链ID
        self.chain_id = chain_id
        # 过滤后的交易数量
        self.filtered_tx_count = filtered_tx_count
        # 区块中交易总数
        self.total_tx_count = total_tx_count
        # 下一个需要检查的高度
        self.next_block_number = next_block_number

    def validate(self):
        if self.block:
            self.block.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.block is not None:
            result['block'] = self.block.to_map()
        if self.block_number is not None:
            result['block_number'] = self.block_number
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.filtered_tx_count is not None:
            result['filtered_tx_count'] = self.filtered_tx_count
        if self.total_tx_count is not None:
            result['total_tx_count'] = self.total_tx_count
        if self.next_block_number is not None:
            result['next_block_number'] = self.next_block_number
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('block') is not None:
            temp_model = Block()
            self.block = temp_model.from_map(m['block'])
        if m.get('block_number') is not None:
            self.block_number = m.get('block_number')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('filtered_tx_count') is not None:
            self.filtered_tx_count = m.get('filtered_tx_count')
        if m.get('total_tx_count') is not None:
            self.total_tx_count = m.get('total_tx_count')
        if m.get('next_block_number') is not None:
            self.next_block_number = m.get('next_block_number')
        return self


class QueryMypointsSkuRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        env: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 区块链ID
        self.chain_id = chain_id
        # 环境标识
        self.env = env

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.env, 'env')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.env is not None:
            result['env'] = self.env
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('env') is not None:
            self.env = m.get('env')
        return self


class QueryMypointsSkuResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        skus: List[SKUItem] = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 商品列表
        self.skus = skus

    def validate(self):
        if self.skus:
            for k in self.skus:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        result['skus'] = []
        if self.skus is not None:
            for k in self.skus:
                result['skus'].append(k.to_map() if k else None)
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        self.skus = []
        if m.get('skus') is not None:
            for k in m.get('skus'):
                temp_model = SKUItem()
                self.skus.append(temp_model.from_map(k))
        return self


class QueryMypointsMerchantbalanceRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        env: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 环境标识
        self.env = env

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.env, 'env')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.env is not None:
            result['env'] = self.env
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('env') is not None:
            self.env = m.get('env')
        return self


class QueryMypointsMerchantbalanceResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        budget_available_balance: int = None,
        budget_balance: int = None,
        budget_code: str = None,
        pid: str = None,
        point_lib_balance: int = None,
        point_lib_code: str = None,
        tenant_id: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 积分库可用余额
        self.budget_available_balance = budget_available_balance
        # 预算库余额
        self.budget_balance = budget_balance
        # 预算库代码
        self.budget_code = budget_code
        # 商户的支付宝商家ID
        self.pid = pid
        # 积分库余额
        self.point_lib_balance = point_lib_balance
        # 积分库代码
        self.point_lib_code = point_lib_code
        # 商户的金融云租户ID
        self.tenant_id = tenant_id

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.budget_available_balance is not None:
            result['budget_available_balance'] = self.budget_available_balance
        if self.budget_balance is not None:
            result['budget_balance'] = self.budget_balance
        if self.budget_code is not None:
            result['budget_code'] = self.budget_code
        if self.pid is not None:
            result['pid'] = self.pid
        if self.point_lib_balance is not None:
            result['point_lib_balance'] = self.point_lib_balance
        if self.point_lib_code is not None:
            result['point_lib_code'] = self.point_lib_code
        if self.tenant_id is not None:
            result['tenant_id'] = self.tenant_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('budget_available_balance') is not None:
            self.budget_available_balance = m.get('budget_available_balance')
        if m.get('budget_balance') is not None:
            self.budget_balance = m.get('budget_balance')
        if m.get('budget_code') is not None:
            self.budget_code = m.get('budget_code')
        if m.get('pid') is not None:
            self.pid = m.get('pid')
        if m.get('point_lib_balance') is not None:
            self.point_lib_balance = m.get('point_lib_balance')
        if m.get('point_lib_code') is not None:
            self.point_lib_code = m.get('point_lib_code')
        if m.get('tenant_id') is not None:
            self.tenant_id = m.get('tenant_id')
        return self


class ExecMypointsPreorderskuRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        count: int = None,
        env: str = None,
        memo: str = None,
        order_no: str = None,
        sku_id: str = None,
        total_cost: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 预下单数量
        self.count = count
        # 环境标识
        self.env = env
        # 备注
        self.memo = memo
        # 业务幂等号，商户需要保证每笔订单号唯一
        self.order_no = order_no
        # 商品ID
        self.sku_id = sku_id
        # 总花费花费(询价接口结果)
        self.total_cost = total_cost

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.count, 'count')
        self.validate_required(self.env, 'env')
        self.validate_required(self.order_no, 'order_no')
        self.validate_required(self.sku_id, 'sku_id')
        self.validate_required(self.total_cost, 'total_cost')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.count is not None:
            result['count'] = self.count
        if self.env is not None:
            result['env'] = self.env
        if self.memo is not None:
            result['memo'] = self.memo
        if self.order_no is not None:
            result['order_no'] = self.order_no
        if self.sku_id is not None:
            result['sku_id'] = self.sku_id
        if self.total_cost is not None:
            result['total_cost'] = self.total_cost
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('count') is not None:
            self.count = m.get('count')
        if m.get('env') is not None:
            self.env = m.get('env')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('order_no') is not None:
            self.order_no = m.get('order_no')
        if m.get('sku_id') is not None:
            self.sku_id = m.get('sku_id')
        if m.get('total_cost') is not None:
            self.total_cost = m.get('total_cost')
        return self


class ExecMypointsPreorderskuResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        count: int = None,
        order_no: str = None,
        pre_order_id: str = None,
        sku_id: str = None,
        total_amount: int = None,
        total_cost: str = None,
        need_retry: bool = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 数量
        self.count = count
        # 业务幂等ID
        self.order_no = order_no
        # 预下单Id
        self.pre_order_id = pre_order_id
        # 商品ID
        self.sku_id = sku_id
        # 总集分宝数量(单位:个)
        self.total_amount = total_amount
        # 总费用
        self.total_cost = total_cost
        # 是否需要重试
        self.need_retry = need_retry

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.count is not None:
            result['count'] = self.count
        if self.order_no is not None:
            result['order_no'] = self.order_no
        if self.pre_order_id is not None:
            result['pre_order_id'] = self.pre_order_id
        if self.sku_id is not None:
            result['sku_id'] = self.sku_id
        if self.total_amount is not None:
            result['total_amount'] = self.total_amount
        if self.total_cost is not None:
            result['total_cost'] = self.total_cost
        if self.need_retry is not None:
            result['need_retry'] = self.need_retry
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('count') is not None:
            self.count = m.get('count')
        if m.get('order_no') is not None:
            self.order_no = m.get('order_no')
        if m.get('pre_order_id') is not None:
            self.pre_order_id = m.get('pre_order_id')
        if m.get('sku_id') is not None:
            self.sku_id = m.get('sku_id')
        if m.get('total_amount') is not None:
            self.total_amount = m.get('total_amount')
        if m.get('total_cost') is not None:
            self.total_cost = m.get('total_cost')
        if m.get('need_retry') is not None:
            self.need_retry = m.get('need_retry')
        return self


class ExecMypointsOrderskuRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        env: str = None,
        order_no: str = None,
        phone_number: str = None,
        pre_order_id: str = None,
        sku_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 环境标识
        self.env = env
        # 业务幂等号
        self.order_no = order_no
        # 手机号
        self.phone_number = phone_number
        # 预下单号
        self.pre_order_id = pre_order_id
        # 商品ID
        self.sku_id = sku_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.env, 'env')
        self.validate_required(self.order_no, 'order_no')
        self.validate_required(self.phone_number, 'phone_number')
        self.validate_required(self.pre_order_id, 'pre_order_id')
        self.validate_required(self.sku_id, 'sku_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.env is not None:
            result['env'] = self.env
        if self.order_no is not None:
            result['order_no'] = self.order_no
        if self.phone_number is not None:
            result['phone_number'] = self.phone_number
        if self.pre_order_id is not None:
            result['pre_order_id'] = self.pre_order_id
        if self.sku_id is not None:
            result['sku_id'] = self.sku_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('env') is not None:
            self.env = m.get('env')
        if m.get('order_no') is not None:
            self.order_no = m.get('order_no')
        if m.get('phone_number') is not None:
            self.phone_number = m.get('phone_number')
        if m.get('pre_order_id') is not None:
            self.pre_order_id = m.get('pre_order_id')
        if m.get('sku_id') is not None:
            self.sku_id = m.get('sku_id')
        return self


class ExecMypointsOrderskuResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        card_id: str = None,
        card_value: int = None,
        need_retry: bool = None,
        order_no: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 卡密ID
        self.card_id = card_id
        # 集分宝卡密的面值(单位:个)
        self.card_value = card_value
        # 是否需要重试
        self.need_retry = need_retry
        # 业务幂等ID
        self.order_no = order_no

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.card_id is not None:
            result['card_id'] = self.card_id
        if self.card_value is not None:
            result['card_value'] = self.card_value
        if self.need_retry is not None:
            result['need_retry'] = self.need_retry
        if self.order_no is not None:
            result['order_no'] = self.order_no
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('card_id') is not None:
            self.card_id = m.get('card_id')
        if m.get('card_value') is not None:
            self.card_value = m.get('card_value')
        if m.get('need_retry') is not None:
            self.need_retry = m.get('need_retry')
        if m.get('order_no') is not None:
            self.order_no = m.get('order_no')
        return self


class QueryMypointsSkufeeRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        count: int = None,
        env: str = None,
        memo: str = None,
        order_no: str = None,
        sku_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 预下单数量
        self.count = count
        # 环境标识(sandbox/prod)
        self.env = env
        # 备注信息
        self.memo = memo
        # 业务幂等号
        self.order_no = order_no
        # 商品ID
        self.sku_id = sku_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.count, 'count')
        self.validate_required(self.env, 'env')
        self.validate_required(self.order_no, 'order_no')
        self.validate_required(self.sku_id, 'sku_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.count is not None:
            result['count'] = self.count
        if self.env is not None:
            result['env'] = self.env
        if self.memo is not None:
            result['memo'] = self.memo
        if self.order_no is not None:
            result['order_no'] = self.order_no
        if self.sku_id is not None:
            result['sku_id'] = self.sku_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('count') is not None:
            self.count = m.get('count')
        if m.get('env') is not None:
            self.env = m.get('env')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('order_no') is not None:
            self.order_no = m.get('order_no')
        if m.get('sku_id') is not None:
            self.sku_id = m.get('sku_id')
        return self


class QueryMypointsSkufeeResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        count: int = None,
        rate: str = None,
        sku_id: str = None,
        total_amount: int = None,
        total_cost: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 预下单的数量
        self.count = count
        # 费率
        self.rate = rate
        # 商品ID
        self.sku_id = sku_id
        # 总集分宝数量（个）
        self.total_amount = total_amount
        # 总费用
        self.total_cost = total_cost

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.count is not None:
            result['count'] = self.count
        if self.rate is not None:
            result['rate'] = self.rate
        if self.sku_id is not None:
            result['sku_id'] = self.sku_id
        if self.total_amount is not None:
            result['total_amount'] = self.total_amount
        if self.total_cost is not None:
            result['total_cost'] = self.total_cost
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('count') is not None:
            self.count = m.get('count')
        if m.get('rate') is not None:
            self.rate = m.get('rate')
        if m.get('sku_id') is not None:
            self.sku_id = m.get('sku_id')
        if m.get('total_amount') is not None:
            self.total_amount = m.get('total_amount')
        if m.get('total_cost') is not None:
            self.total_cost = m.get('total_cost')
        return self


class QueryMypointsPreorderinstructionRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        env: str = None,
        order_no: str = None,
        sku_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 环境标识
        self.env = env
        # 业务幂等ID
        self.order_no = order_no
        # 商品ID
        self.sku_id = sku_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.env, 'env')
        self.validate_required(self.order_no, 'order_no')
        self.validate_required(self.sku_id, 'sku_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.env is not None:
            result['env'] = self.env
        if self.order_no is not None:
            result['order_no'] = self.order_no
        if self.sku_id is not None:
            result['sku_id'] = self.sku_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('env') is not None:
            self.env = m.get('env')
        if m.get('order_no') is not None:
            self.order_no = m.get('order_no')
        if m.get('sku_id') is not None:
            self.sku_id = m.get('sku_id')
        return self


class QueryMypointsPreorderinstructionResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        biz_id: str = None,
        budget_code: str = None,
        chain_id: str = None,
        env: str = None,
        extend_info: str = None,
        memo: str = None,
        pid: str = None,
        product_code: str = None,
        pre_order_id: str = None,
        remain_count: int = None,
        sku_amount: int = None,
        sku_id: str = None,
        sku_value: str = None,
        status: int = None,
        tenant_id: str = None,
        total_amount: int = None,
        total_count: int = None,
        total_value: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 业务请求单号
        self.biz_id = biz_id
        # 商家的预算库代码
        self.budget_code = budget_code
        # 链ID
        self.chain_id = chain_id
        # 环境标识
        self.env = env
        # 扩展信息
        self.extend_info = extend_info
        # 备注信息
        self.memo = memo
        # 商家在支付宝域的标识
        self.pid = pid
        # 集分宝产品码
        self.product_code = product_code
        # 集分宝SKU预下单ID
        self.pre_order_id = pre_order_id
        # 订单中剩余的可下单商品数量
        self.remain_count = remain_count
        # 包含集分宝数量(个)
        self.sku_amount = sku_amount
        # 集分宝SKU的ID
        self.sku_id = sku_id
        # SKU面值
        self.sku_value = sku_value
        # 流水状态(0初始状态, 1采购失败可重试, 2采购失败不可重试, 3采购成功, 4预算库创建失败可重试, 5预算库创建失败不可重试, 6预算库叉棍见成功, 7预算调拨失败可重试, 8预算库调拨失败不可重试, 9预算库调拨成功)
        self.status = status
        # 商户在金融云的租户ID
        self.tenant_id = tenant_id
        # 总下单集分宝数量
        self.total_amount = total_amount
        # 集分宝SKU的预下单数量
        self.total_count = total_count
        # 总下单金额
        self.total_value = total_value

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.biz_id is not None:
            result['biz_id'] = self.biz_id
        if self.budget_code is not None:
            result['budget_code'] = self.budget_code
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.env is not None:
            result['env'] = self.env
        if self.extend_info is not None:
            result['extend_info'] = self.extend_info
        if self.memo is not None:
            result['memo'] = self.memo
        if self.pid is not None:
            result['pid'] = self.pid
        if self.product_code is not None:
            result['product_code'] = self.product_code
        if self.pre_order_id is not None:
            result['pre_order_id'] = self.pre_order_id
        if self.remain_count is not None:
            result['remain_count'] = self.remain_count
        if self.sku_amount is not None:
            result['sku_amount'] = self.sku_amount
        if self.sku_id is not None:
            result['sku_id'] = self.sku_id
        if self.sku_value is not None:
            result['sku_value'] = self.sku_value
        if self.status is not None:
            result['status'] = self.status
        if self.tenant_id is not None:
            result['tenant_id'] = self.tenant_id
        if self.total_amount is not None:
            result['total_amount'] = self.total_amount
        if self.total_count is not None:
            result['total_count'] = self.total_count
        if self.total_value is not None:
            result['total_value'] = self.total_value
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('biz_id') is not None:
            self.biz_id = m.get('biz_id')
        if m.get('budget_code') is not None:
            self.budget_code = m.get('budget_code')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('env') is not None:
            self.env = m.get('env')
        if m.get('extend_info') is not None:
            self.extend_info = m.get('extend_info')
        if m.get('memo') is not None:
            self.memo = m.get('memo')
        if m.get('pid') is not None:
            self.pid = m.get('pid')
        if m.get('product_code') is not None:
            self.product_code = m.get('product_code')
        if m.get('pre_order_id') is not None:
            self.pre_order_id = m.get('pre_order_id')
        if m.get('remain_count') is not None:
            self.remain_count = m.get('remain_count')
        if m.get('sku_amount') is not None:
            self.sku_amount = m.get('sku_amount')
        if m.get('sku_id') is not None:
            self.sku_id = m.get('sku_id')
        if m.get('sku_value') is not None:
            self.sku_value = m.get('sku_value')
        if m.get('status') is not None:
            self.status = m.get('status')
        if m.get('tenant_id') is not None:
            self.tenant_id = m.get('tenant_id')
        if m.get('total_amount') is not None:
            self.total_amount = m.get('total_amount')
        if m.get('total_count') is not None:
            self.total_count = m.get('total_count')
        if m.get('total_value') is not None:
            self.total_value = m.get('total_value')
        return self


class QueryMypointsOrderinstructionRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        product_instance_id: str = None,
        chain_id: str = None,
        env: str = None,
        order_no: str = None,
        sku_id: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        self.product_instance_id = product_instance_id
        # 链ID
        self.chain_id = chain_id
        # 环境标识
        self.env = env
        # 业务幂等号
        self.order_no = order_no
        # SKU ID
        self.sku_id = sku_id

    def validate(self):
        self.validate_required(self.chain_id, 'chain_id')
        self.validate_required(self.env, 'env')
        self.validate_required(self.order_no, 'order_no')
        self.validate_required(self.sku_id, 'sku_id')

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.product_instance_id is not None:
            result['product_instance_id'] = self.product_instance_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.env is not None:
            result['env'] = self.env
        if self.order_no is not None:
            result['order_no'] = self.order_no
        if self.sku_id is not None:
            result['sku_id'] = self.sku_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('product_instance_id') is not None:
            self.product_instance_id = m.get('product_instance_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('env') is not None:
            self.env = m.get('env')
        if m.get('order_no') is not None:
            self.order_no = m.get('order_no')
        if m.get('sku_id') is not None:
            self.sku_id = m.get('sku_id')
        return self


class QueryMypointsOrderinstructionResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        biz_id: str = None,
        chain_id: str = None,
        env: str = None,
        extend_info: str = None,
        order_id: str = None,
        pre_order_id: str = None,
        sku_amount: int = None,
        sku_id: str = None,
        sku_value: str = None,
        status: int = None,
        tenant_id: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 业务请求单号
        self.biz_id = biz_id
        # 链ID
        self.chain_id = chain_id
        # 环境标识
        self.env = env
        # 扩展信息
        self.extend_info = extend_info
        # 订单ID(env+chain_id+tenant_id+sku_id+biz_id)
        self.order_id = order_id
        # 预下单ID
        self.pre_order_id = pre_order_id
        # 包含集分宝数量(个)
        self.sku_amount = sku_amount
        # SKU ID
        self.sku_id = sku_id
        # 面值
        self.sku_value = sku_value
        # 状态(0:初始,1:失败可重试,2:失败不可重试,3:成功)
        self.status = status
        # 商家在金融云的租户ID
        self.tenant_id = tenant_id

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.biz_id is not None:
            result['biz_id'] = self.biz_id
        if self.chain_id is not None:
            result['chain_id'] = self.chain_id
        if self.env is not None:
            result['env'] = self.env
        if self.extend_info is not None:
            result['extend_info'] = self.extend_info
        if self.order_id is not None:
            result['order_id'] = self.order_id
        if self.pre_order_id is not None:
            result['pre_order_id'] = self.pre_order_id
        if self.sku_amount is not None:
            result['sku_amount'] = self.sku_amount
        if self.sku_id is not None:
            result['sku_id'] = self.sku_id
        if self.sku_value is not None:
            result['sku_value'] = self.sku_value
        if self.status is not None:
            result['status'] = self.status
        if self.tenant_id is not None:
            result['tenant_id'] = self.tenant_id
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('biz_id') is not None:
            self.biz_id = m.get('biz_id')
        if m.get('chain_id') is not None:
            self.chain_id = m.get('chain_id')
        if m.get('env') is not None:
            self.env = m.get('env')
        if m.get('extend_info') is not None:
            self.extend_info = m.get('extend_info')
        if m.get('order_id') is not None:
            self.order_id = m.get('order_id')
        if m.get('pre_order_id') is not None:
            self.pre_order_id = m.get('pre_order_id')
        if m.get('sku_amount') is not None:
            self.sku_amount = m.get('sku_amount')
        if m.get('sku_id') is not None:
            self.sku_id = m.get('sku_id')
        if m.get('sku_value') is not None:
            self.sku_value = m.get('sku_value')
        if m.get('status') is not None:
            self.status = m.get('status')
        if m.get('tenant_id') is not None:
            self.tenant_id = m.get('tenant_id')
        return self


class CreateAntcloudGatewayxFileUploadRequest(TeaModel):
    def __init__(
        self,
        auth_token: str = None,
        api_code: str = None,
        file_label: str = None,
        file_metadata: str = None,
        file_name: str = None,
        mime_type: str = None,
        api_cluster: str = None,
    ):
        # OAuth模式下的授权token
        self.auth_token = auth_token
        # 上传文件作用的openapi method
        self.api_code = api_code
        # 文件标签，多个标签;分割
        self.file_label = file_label
        # 自定义的文件元数据
        self.file_metadata = file_metadata
        # 文件名，不传则随机生成文件名
        self.file_name = file_name
        # 文件的多媒体类型
        self.mime_type = mime_type
        # 产品方的api归属集群，即productInstanceId
        self.api_cluster = api_cluster

    def validate(self):
        self.validate_required(self.api_code, 'api_code')
        if self.file_label is not None:
            self.validate_max_length(self.file_label, 'file_label', 100)
        if self.file_metadata is not None:
            self.validate_max_length(self.file_metadata, 'file_metadata', 1000)
        if self.file_name is not None:
            self.validate_max_length(self.file_name, 'file_name', 100)

    def to_map(self):
        result = dict()
        if self.auth_token is not None:
            result['auth_token'] = self.auth_token
        if self.api_code is not None:
            result['api_code'] = self.api_code
        if self.file_label is not None:
            result['file_label'] = self.file_label
        if self.file_metadata is not None:
            result['file_metadata'] = self.file_metadata
        if self.file_name is not None:
            result['file_name'] = self.file_name
        if self.mime_type is not None:
            result['mime_type'] = self.mime_type
        if self.api_cluster is not None:
            result['api_cluster'] = self.api_cluster
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('auth_token') is not None:
            self.auth_token = m.get('auth_token')
        if m.get('api_code') is not None:
            self.api_code = m.get('api_code')
        if m.get('file_label') is not None:
            self.file_label = m.get('file_label')
        if m.get('file_metadata') is not None:
            self.file_metadata = m.get('file_metadata')
        if m.get('file_name') is not None:
            self.file_name = m.get('file_name')
        if m.get('mime_type') is not None:
            self.mime_type = m.get('mime_type')
        if m.get('api_cluster') is not None:
            self.api_cluster = m.get('api_cluster')
        return self


class CreateAntcloudGatewayxFileUploadResponse(TeaModel):
    def __init__(
        self,
        req_msg_id: str = None,
        result_code: str = None,
        result_msg: str = None,
        expired_time: str = None,
        file_id: str = None,
        upload_headers: List[XNameValuePair] = None,
        upload_url: str = None,
    ):
        # 请求唯一ID，用于链路跟踪和问题排查
        self.req_msg_id = req_msg_id
        # 结果码，一般OK表示调用成功
        self.result_code = result_code
        # 异常信息的文本描述
        self.result_msg = result_msg
        # 上传有效期
        self.expired_time = expired_time
        # 32位文件唯一id
        self.file_id = file_id
        # 放入http请求头里
        self.upload_headers = upload_headers
        # 文件上传地址
        self.upload_url = upload_url

    def validate(self):
        if self.expired_time is not None:
            self.validate_pattern(self.expired_time, 'expired_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}([Z]|([\\.]\\d{1,9})?[\\+]\\d{2}[\\:]?\\d{2})')
        if self.upload_headers:
            for k in self.upload_headers:
                if k:
                    k.validate()

    def to_map(self):
        result = dict()
        if self.req_msg_id is not None:
            result['req_msg_id'] = self.req_msg_id
        if self.result_code is not None:
            result['result_code'] = self.result_code
        if self.result_msg is not None:
            result['result_msg'] = self.result_msg
        if self.expired_time is not None:
            result['expired_time'] = self.expired_time
        if self.file_id is not None:
            result['file_id'] = self.file_id
        result['upload_headers'] = []
        if self.upload_headers is not None:
            for k in self.upload_headers:
                result['upload_headers'].append(k.to_map() if k else None)
        if self.upload_url is not None:
            result['upload_url'] = self.upload_url
        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('req_msg_id') is not None:
            self.req_msg_id = m.get('req_msg_id')
        if m.get('result_code') is not None:
            self.result_code = m.get('result_code')
        if m.get('result_msg') is not None:
            self.result_msg = m.get('result_msg')
        if m.get('expired_time') is not None:
            self.expired_time = m.get('expired_time')
        if m.get('file_id') is not None:
            self.file_id = m.get('file_id')
        self.upload_headers = []
        if m.get('upload_headers') is not None:
            for k in m.get('upload_headers'):
                temp_model = XNameValuePair()
                self.upload_headers.append(temp_model.from_map(k))
        if m.get('upload_url') is not None:
            self.upload_url = m.get('upload_url')
        return self


