package com.sikey.wa04.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Enum by video call channel
 */
@Getter
@AllArgsConstructor
public enum VideoCallChannel {

    /**
     * 默认
     */
    DEFAULT(0),

    /**
     * 菊风
     */
    JUFENG(1),

    /**
     * 声网
     */
    SHENGWANG(2);

    private final int channel;

    /**
     * 获取 Video call channel
     *
     * @param channel 渠道
     * @return {@link VideoCallChannel channel enum}
     */
    public static VideoCallChannel valueOf(int channel) {
        for (VideoCallChannel videoCallChannel : VideoCallChannel.values()) {
            if (videoCallChannel.getChannel() == channel) {
                return videoCallChannel;
            }
        }
        throw new IllegalStateException("Error video call channel " + channel);
    }

}
