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

com.pdd.pop.sdk.http.api.ark.request.PddFlightOrderCreateRequest 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.PddFlightOrderCreateResponse;
import com.pdd.pop.sdk.http.HttpMethod;
import com.pdd.pop.sdk.http.PopBaseHttpRequest;

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

public class PddFlightOrderCreateRequest extends PopBaseHttpRequest {

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

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

    /**
     * 行程类型
     */
    @JsonProperty("trip_type")
    private String tripType;

    /**
     * 航班信息列表
     */
    @JsonProperty("flight_info_list")
    private List flightInfoList;

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

    /**
     * 价格列表
     */
    @JsonProperty("price_info_list")
    private List priceInfoList;

    /**
     * 产品类型
     */
    @JsonProperty("product_type")
    private Integer productType;

    /**
     * 同舱同产品类型价格的唯一标识
     */
    @JsonProperty("product_id")
    private String productId;

    @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.create";
    }

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

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

    @Override
    protected void setUserParams(Map params) {
        setUserParam(params, "trace_id", traceId);
        setUserParam(params, "sub_trace_id", subTraceId);
        setUserParam(params, "trip_type", tripType);
        setUserParam(params, "flight_info_list", flightInfoList);
        setUserParam(params, "passenger_info_list", passengerInfoList);
        setUserParam(params, "price_info_list", priceInfoList);
        setUserParam(params, "product_type", productType);
        setUserParam(params, "product_id", productId);
    }

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

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

    public void setTripType(String tripType) {
        this.tripType = tripType;
    }

    public void setFlightInfoList(List flightInfoList) {
        this.flightInfoList = flightInfoList;
    }

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

    public void setPriceInfoList(List priceInfoList) {
        this.priceInfoList = priceInfoList;
    }

    public void setProductType(Integer productType) {
        this.productType = productType;
    }

    public void setProductId(String productId) {
        this.productId = productId;
    }

    public static class FlightInfoListItem {

        /**
         * 航班号
         */
        @JsonProperty("flight_no")
        private String flightNo;

        /**
         * 出票航司二字码
         */
        @JsonProperty("carrier_code")
        private String carrierCode;

        /**
         * 是否共享航班
         */
        @JsonProperty("shared")
        private Boolean shared;

        /**
         * 起飞时间(yyyy-MM-dd HH:mm)
         */
        @JsonProperty("departure_date_time")
        private String departureDateTime;

        /**
         * 起飞机场三字码
         */
        @JsonProperty("departure_airport_code")
        private String departureAirportCode;

        /**
         * 起飞航站楼
         */
        @JsonProperty("departure_terminal")
        private String departureTerminal;

        /**
         * 到达时间(yyyy-MM-dd HH:mm)
         */
        @JsonProperty("arrival_date_time")
        private String arrivalDateTime;

        /**
         * 到达机场三字码
         */
        @JsonProperty("arrival_airport_code")
        private String arrivalAirportCode;

        /**
         * 到达航站楼
         */
        @JsonProperty("arrival_terminal")
        private String arrivalTerminal;

        /**
         * 航程编号
         */
        @JsonProperty("segment_no")
        private Integer segmentNo;

        /**
         * 航段编号
         */
        @JsonProperty("sequence_no")
        private Integer sequenceNo;

        /**
         * 舱位信息列表
         */
        @JsonProperty("cabin_info_list")
        private List cabinInfoList;

        public void setFlightNo(String flightNo) {
            this.flightNo = flightNo;
        }

        public void setCarrierCode(String carrierCode) {
            this.carrierCode = carrierCode;
        }

        public void setShared(Boolean shared) {
            this.shared = shared;
        }

        public void setDepartureDateTime(String departureDateTime) {
            this.departureDateTime = departureDateTime;
        }

        public void setDepartureAirportCode(String departureAirportCode) {
            this.departureAirportCode = departureAirportCode;
        }

        public void setDepartureTerminal(String departureTerminal) {
            this.departureTerminal = departureTerminal;
        }

        public void setArrivalDateTime(String arrivalDateTime) {
            this.arrivalDateTime = arrivalDateTime;
        }

        public void setArrivalAirportCode(String arrivalAirportCode) {
            this.arrivalAirportCode = arrivalAirportCode;
        }

        public void setArrivalTerminal(String arrivalTerminal) {
            this.arrivalTerminal = arrivalTerminal;
        }

        public void setSegmentNo(Integer segmentNo) {
            this.segmentNo = segmentNo;
        }

        public void setSequenceNo(Integer sequenceNo) {
            this.sequenceNo = sequenceNo;
        }

        public void setCabinInfoList(List cabinInfoList) {
            this.cabinInfoList = cabinInfoList;
        }

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

    public static class FlightInfoListItemCabinInfoListItem {

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

        /**
         * 舱位,不同的航司舱位定义不同
         */
        @JsonProperty("sub_class")
        private String subClass;

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

        public void setSubClass(String subClass) {
            this.subClass = subClass;
        }

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

    public static class PassengerInfoListItem {

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

        /**
         *  姓名(当变更申请时, 变更类型为改名, 填写需要变更的姓名)
         */
        @JsonProperty("name")
        private String name;

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

        /**
         * 证件号码(当变更申请时, 变更类型为改证件号, 填写需要变更的证件号)
         */
        @JsonProperty("identity_no")
        private String identityNo;

        /**
         * 性别
         */
        @JsonProperty("gender")
        private String gender;

        /**
         * 出生年月(yyyy-MM-dd)
         */
        @JsonProperty("birthday")
        private String birthday;

        /**
         * 证件有效期(yyyy-MM-dd),非身份证必填,身份证非必填
         */
        @JsonProperty("effective_date")
        private String effectiveDate;

        /**
         * 乘客手机号(航司要求填才填)
         */
        @JsonProperty("phone_num")
        private String phoneNum;

        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 setGender(String gender) {
            this.gender = gender;
        }

        public void setBirthday(String birthday) {
            this.birthday = birthday;
        }

        public void setEffectiveDate(String effectiveDate) {
            this.effectiveDate = effectiveDate;
        }

        public void setPhoneNum(String phoneNum) {
            this.phoneNum = phoneNum;
        }

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

    public static class PriceInfoListItem {

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

        /**
         * 公布价
         */
        @JsonProperty("base_price")
        private Long basePrice;

        /**
         * 结算价
         */
        @JsonProperty("settle_price")
        private Long settlePrice;

        /**
         * 机建费
         */
        @JsonProperty("airport_tax")
        private Long airportTax;

        /**
         * 燃油费
         */
        @JsonProperty("fuel_tax")
        private Long fuelTax;

        /**
         * 返点,单位为%,保留两位小数,eg:1.23
         */
        @JsonProperty("commission_point")
        private Double commissionPoint;

        /**
         * 定额,精确到分
         */
        @JsonProperty("commission_money")
        private Long commissionMoney;

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

        public void setBasePrice(Long basePrice) {
            this.basePrice = basePrice;
        }

        public void setSettlePrice(Long settlePrice) {
            this.settlePrice = settlePrice;
        }

        public void setAirportTax(Long airportTax) {
            this.airportTax = airportTax;
        }

        public void setFuelTax(Long fuelTax) {
            this.fuelTax = fuelTax;
        }

        public void setCommissionPoint(Double commissionPoint) {
            this.commissionPoint = commissionPoint;
        }

        public void setCommissionMoney(Long commissionMoney) {
            this.commissionMoney = commissionMoney;
        }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy