package org.springblade.common.upyzt.model;

import org.springblade.common.upyzt.exception.UpyztException;
import org.springblade.common.upyzt.net.APIResource;
import org.springblade.common.upyzt.net.RequestOptions;
import org.springblade.common.upyzt.resp.TradeBillDownloadResp;
import lombok.experimental.Accessors;

import java.util.Map;

@Accessors(chain = true)
public class TradeBill extends APIResource {

    /**
     * 申请交易账单
     *
     * @param params 请求参数
     * @return 返回参数
     * @throws UpyztException 异常
     */
    public static TradeBillDownloadResp getDownloadUrl(Map<String, Object> params) throws UpyztException {
        return getDownloadUrl(params, null);
    }

    /**
     * 申请交易账单
     *
     * @param params  请求参数
     * @param options 参数选项
     * @return 返回参数
     * @throws UpyztException 异常
     */
    public static TradeBillDownloadResp getDownloadUrl(Map<String, Object> params, RequestOptions options) throws UpyztException {
        return APIResource.request(RequestMethod.GET, classURL(TradeBill.class), params, TradeBillDownloadResp.class, options);
    }

}
