All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pdd.pop.sdk.http.api.ark.request.PddFlightRefundableRequest Maven / Gradle / Ivy

There is a newer version: 1.10.85
Show newest version
package com.pdd.pop.sdk.http.api.ark.request;

import com.pdd.pop.sdk.common.util.JsonUtil;
import com.pdd.pop.ext.fasterxml.jackson.annotation.JsonProperty;
import com.pdd.pop.sdk.http.api.ark.response.PddFlightRefundableResponse;
import com.pdd.pop.sdk.http.HttpMethod;
import com.pdd.pop.sdk.http.PopBaseHttpRequest;

import java.util.List;
import java.util.Map;

public class PddFlightRefundableRequest extends PopBaseHttpRequest {

    /**
     * 日志追踪id (用于日志关联)
     */
    @JsonProperty("trace_id")
    private String traceId;

    /**
     * 唯一关联当前请求日志追踪id
     */
    @JsonProperty("sub_trace_id")
    private String subTraceId;

    /**
     * 外部主订单号
     */
    @JsonProperty("out_order_no")
    private String outOrderNo;

    /**
     * 平台机票订单号
     */
    @JsonProperty("parent_travel_sn")
    private String parentTravelSn;

    /**
     * 退票类型
     */
    @JsonProperty("refund_type")
    private Integer refundType;

    /**
     * 退票理由,申请类型是退票必传, 申请类型是差价不传
     */
    @JsonProperty("refund_reason")
    private String refundReason;

    /**
     * 非自愿退票凭证路径
     */
    @JsonProperty("attachment_path")
    private String attachmentPath;

    /**
     * 退票乘客信息列表
     */
    @JsonProperty("passenger_info_list")
    private List passengerInfoList;

    @Override
    public String getVersion() {
        return "V1";
    }

    @Override
    public String getDataType() {
        return "JSON";
    }

    @Override
    public Integer getPlatform() {
        return 1;
    }

    @Override
    public String getType() {
        return "pdd.flight.refundable";
    }

    @Override
    public HttpMethod getHttpMethod() {
        return HttpMethod.POST;
    }

    @Override
    public Class getResponseClass() {
        return PddFlightRefundableResponse.class;
    }

    @Override
    protected void setUserParams(Map params) {
        setUserParam(params, "trace_id", traceId);
        setUserParam(params, "sub_trace_id", subTraceId);
        setUserParam(params, "out_order_no", outOrderNo);
        setUserParam(params, "parent_travel_sn", parentTravelSn);
        setUserParam(params, "refund_type", refundType);
        setUserParam(params, "refund_reason", refundReason);
        setUserParam(params, "attachment_path", attachmentPath);
        setUserParam(params, "passenger_info_list", passengerInfoList);
    }

    public void setTraceId(String traceId) {
        this.traceId = traceId;
    }

    public void setSubTraceId(String subTraceId) {
        this.subTraceId = subTraceId;
    }

    public void setOutOrderNo(String outOrderNo) {
        this.outOrderNo = outOrderNo;
    }

    public void setParentTravelSn(String parentTravelSn) {
        this.parentTravelSn = parentTravelSn;
    }

    public void setRefundType(Integer refundType) {
        this.refundType = refundType;
    }

    public void setRefundReason(String refundReason) {
        this.refundReason = refundReason;
    }

    public void setAttachmentPath(String attachmentPath) {
        this.attachmentPath = attachmentPath;
    }

    public void setPassengerInfoList(List passengerInfoList) {
        this.passengerInfoList = passengerInfoList;
    }

    public static class PassengerInfoListItem {

        /**
         * 乘客类型
         */
        @JsonProperty("passenger_type")
        private String passengerType;

        /**
         * 姓名
         */
        @JsonProperty("name")
        private String name;

        /**
         * 证件类型,枚举是CardTypeEnum
         */
        @JsonProperty("identity_type")
        private String identityType;

        /**
         * 证件号
         */
        @JsonProperty("identity_no")
        private String identityNo;

        /**
         * 平台机票子订单号
         */
        @JsonProperty("travel_sn")
        private String travelSn;

        /**
         * 票号
         */
        @JsonProperty("ticket_no")
        private String ticketNo;

        public void setPassengerType(String passengerType) {
            this.passengerType = passengerType;
        }

        public void setName(String name) {
            this.name = name;
        }

        public void setIdentityType(String identityType) {
            this.identityType = identityType;
        }

        public void setIdentityNo(String identityNo) {
            this.identityNo = identityNo;
        }

        public void setTravelSn(String travelSn) {
            this.travelSn = travelSn;
        }

        public void setTicketNo(String ticketNo) {
            this.ticketNo = ticketNo;
        }

        @Override
        public String toString() {
            return JsonUtil.transferToJson(this);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy