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

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

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.PddFlightOrderPrePayCheckResponse;
import com.pdd.pop.sdk.http.HttpMethod;
import com.pdd.pop.sdk.http.PopBaseHttpRequest;

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

public class PddFlightOrderPrePayCheckRequest extends PopBaseHttpRequest {

    /**
     * 用于搜索到下单的请求日志关联
     */
    @JsonProperty("trace_id")
    private String traceId;

    /**
     * 用于一次请求的日志关联
     */
    @JsonProperty("sub_trace_id")
    private String subTraceId;

    /**
     * 供应商自己生成的订单号
     */
    @JsonProperty("out_order_no")
    private String outOrderNo;

    /**
     * 乘客信息列表
     */
    @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.order.pre.pay.check";
    }

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

    @Override
    public Class getResponseClass() {
        return PddFlightOrderPrePayCheckResponse.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, "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 setPassengerInfoList(List passengerInfoList) {
        this.passengerInfoList = passengerInfoList;
    }

    public static class PassengerInfoListItem {

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

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

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

        /**
         * 证件类型
         */
        @JsonProperty("identity_type")
        private String identityType;

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

        /**
         * 对应的pnr
         */
        @JsonProperty("pnr")
        private String pnr;

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

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

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

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

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

        public void setPnr(String pnr) {
            this.pnr = pnr;
        }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy