package com.yutou.biliapi.bean.live;

import com.alibaba.fastjson2.annotation.JSONField;
import com.yutou.common.okhttp.BaseBean;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigInteger;
import java.util.List;

@EqualsAndHashCode(callSuper = true)
@Data
public class LiveRoomPlayInfo extends BaseBean {
    @JSONField(name = "room_id")
    private String roomId;

    @JSONField(name = "short_id")
    private int shortId;

    @JSONField(name = "uid")
    private String uid;

    @JSONField(name = "is_hidden")
    private boolean isHidden;

    @JSONField(name = "is_locked")
    private boolean isLocked;

    @JSONField(name = "is_portrait")
    private boolean isPortrait;

    @JSONField(name = "live_status")
    private int liveStatus;

    @JSONField(name = "hidden_till")
    private int hiddenTill;

    @JSONField(name = "lock_till")
    private int lockTill;

    @JSONField(name = "encrypted")
    private boolean encrypted;

    @JSONField(name = "pwd_verified")
    private boolean pwdVerified;

    @JSONField(name = "live_time")
    private int liveTime;

    @JSONField(name = "room_shield")
    private int roomShield;

    @JSONField(name = "all_special_types")
    private List<Integer> allSpecialTypes;

    @JSONField(name = "playurl_info")
    private PlayurlInfo playurlInfo;

    @JSONField(name = "official_type")
    private int officialType;

    @JSONField(name = "official_room_id")
    private int officialRoomId;

    @JSONField(name = "risk_with_delay")
    private int riskWithDelay;

    @Data
    public static class PlayurlInfo {
        @JSONField(name = "conf_json")
        private String confJson;

        @JSONField(name = "playurl")
        private Playurl playurl;

        @JSONField(name = "dolby_qn")
        private Integer dolbyQn;
    }

    @Data
    public static class Playurl {
        @JSONField(name = "cid")
        private int cid;

        @JSONField(name = "g_qn_desc")
        private List<QnDesc> gQnDesc;

        @JSONField(name = "stream")
        private List<Stream> stream;

        @JSONField(name = "p2p_data")
        private P2pData p2pData;
    }

    @Data
    public static class QnDesc {
        @JSONField(name = "qn")
        private int qn;

        @JSONField(name = "desc")
        private String desc;

        @JSONField(name = "hdr_desc")
        private String hdrDesc;

        @JSONField(name = "attr_desc")
        private Object attrDesc;
    }

    @Data
    public static class Stream {
        @JSONField(name = "protocol_name")
        private String protocolName;

        @JSONField(name = "format")
        private List<Format> format;

        @JSONField(name = "p2p_type")
        private int p2pType;

        @JSONField(name = "free_type")
        private int freeType;

        @JSONField(name = "mid")
        private int mid;

        @JSONField(name = "sid")
        private String sid;

        @JSONField(name = "chash")
        private int chash;

        @JSONField(name = "bmt")
        private int bmt;

        @JSONField(name = "sche")
        private String sche;

        @JSONField(name = "score")
        private int score;

        @JSONField(name = "pp")
        private String pp;

        @JSONField(name = "source")
        private String source;

        @JSONField(name = "trace")
        private int trace;

        @JSONField(name = "site")
        private String site;
        @JSONField(name = "zoneid_l")
        private int zoneidL;

        @JSONField(name = "sid_l")
        private String sidL;

        @JSONField(name = "order")
        private int order;
    }

    @Data
    public static class Format {
        @JSONField(name = "format_name")
        private String formatName;

        @JSONField(name = "codec")
        private List<Codec> codec;

        @JSONField(name = "hdr_qn")
        private Integer hdrQn;

        @JSONField(name = "dolby_type")
        private int dolbyType;

        @JSONField(name = "attr_name")
        private String attrName;
    }

    @Data
    public static class Codec {
        @JSONField(name = "codec_name")
        private String codecName;

        @JSONField(name = "current_qn")
        private int currentQn;

        @JSONField(name = "accept_qn")
        private List<Integer> acceptQn;

        @JSONField(name = "base_url")
        private String baseUrl;

        @JSONField(name = "url_info")
        private List<UrlInfo> urlInfo;

        @JSONField(name = "hdr_desc")
        private String hdrDesc;

        @JSONField(name = "attr_desc")
        private Object attrDesc;
    }

    @Data
    public static class UrlInfo {
        @JSONField(name = "host")
        private String host;

        @JSONField(name = "extra")
        private String extra;

        @JSONField(name = "stream_ttl")
        private int streamTtl;
    }

    @Data
    public static class P2pData {
        @JSONField(name = "p2p")
        private boolean p2p;

        @JSONField(name = "p2p_type")
        private int p2pType;

        @JSONField(name = "m_p2p")
        private boolean mP2p;

        @JSONField(name = "m_servers")
        private List<String> mServers;
    }

}
