package com.platform.plugs.live.responseEntity;

import com.aliyuncs.live.model.v20161101.DescribeCastersResponse;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author TONG
 * @Date 2019/3/4 11:04
 **/
@Data
@NoArgsConstructor
public class Caster {
    /** 导播台Id*/
    private String casterId;
    /** 导播台名称*/
    private String casterName;
    /** 创建时间*/
    private String createTime;
    /** 导播台启动时间，当导播台处于导播中时输出*/
    private String startTime;
    /** 导播台规格类型 。0：播单型 1：通用型*/
    private Integer normType;
    /** 付费方式。PrePaid：预付费 PostPaid：后付费 目前只支持PostPaid*/
    private String chargeType;
    /** 导播台购买时间*/
    private String purchaseTime;
    /** 导播台过期时间*/
    private String expireTime;
    /** 导播台分辨率配置，付费类型为预付费时必输。lp_ld-流畅 lp_sd-标清 lp_hd-高清 lp_ud-超清 lp_ld_v-竖屏流畅 lp_sd_v-竖屏标清 lp_hd_v-竖屏高清 lp_ud_v-竖屏超清*/
    private String casterTemplate;
    /** 状态。 0：空闲 1：导播中*/
    private Integer status;
    /** 是否启用Channel。 0：不启用， 1：启用。*/
    private Integer channelEnable;

    public static Caster parse(DescribeCastersResponse.Caster data) {
        Caster caster = new Caster();
        caster.setCasterId(data.getCasterId());
        caster.setCasterName(data.getCasterName());
        caster.setCreateTime(data.getCreateTime());
        caster.setStartTime(data.getStartTime());
        caster.setNormType(data.getNormType());
        caster.setChargeType(data.getChargeType());
        caster.setPurchaseTime(data.getPurchaseTime());
        caster.setExpireTime(data.getExpireTime());
        caster.setCasterTemplate(data.getCasterTemplate());
        caster.setStatus(data.getStatus());
        caster.setChannelEnable(data.getChannelEnable());
        return caster;
    }
}
