package com.gh.gamecenter.entity

import com.gh.gamecenter.common.entity.LinkEntity
import com.gh.gamecenter.feature.entity.SettingsEntity
import com.gh.gamecenter.feature.entity.SimulatorEntity
import com.google.gson.annotations.SerializedName

class NewApiSettingsEntity(
    @SerializedName("night_mode")
    var nightMode: NightMode? = null,
    var simulator: SimulatorEntity? = null,
    var startup: StartupAdEntity? = null,//启动文案广告
    @SerializedName("user_interested_game")
    var userInterestedGame: Boolean = false, //偏好设置状态开关
    @SerializedName("installed_compliance_switch")
    var installedComplianceSwitch: Boolean? = false, //安装合规开关
    @SerializedName("listen_switch")
    var isPackageObserveEnable: Boolean = false, // 安装包监听开关
    @SerializedName("listen_str")
    var packageObserveActions: PackageObserveActions? = null, // 安装包监听的三个 action
    var install: Install, // 安装相关的
    @SerializedName("game_shield_contents")
    var gameShieldContents: List<String>? = listOf(),//游戏屏蔽内容
    var search: SettingsEntity.Search? = null,// 游戏搜索配置
    @SerializedName("jiguang_switch")
    private val _jiguangSwitch: Boolean? = null
) {

    val jiguangSwitch: Boolean
        get() = _jiguangSwitch ?: false

    /**
     *
     *   "icon": false, // 是否显示切换，true显示
     *   "setting": false, // 设置页面是否显示，true显示
     *   "install": false, // 安装时的默认值，true开启
     */
    class NightMode(
        val icon: Boolean,
        val setting: Boolean,
        val install: Boolean
    )

    class Install(
        @SerializedName("guides")
        val guides: List<Guide>? = null,
        @SerializedName("question_tip")
        var questionTip: QuestionTip? = null // 厂商安装问题提示
    )

    /**
     * 当为鸿蒙纯净模式相关时
     *             {
     *                 "type': "harmony_os_pure_mode",  // 华为鸿蒙系统纯净模式相关 harmony_os_pure_mode/harmony_os_pure_enhanced_mode
     *                 "link": {
     *                     "type": "qa_content",
     *                     "link": "61026d03802abe4d7260fdc3",
     *                     "text": "点击查看教程" // 链接文案，有设置时替换该字段，无设置时读取对应通用链接原本的文案
     *                 },
     *                 "title": "",
     *                 "content": "",
     *                 "link_text_prefix": "关闭场景模式：", // 链接引导文案
     *                 "button_text_close": "",  // 关闭按钮
     *                 "button_text_setting_jump": "",  // 前往设置按钮
     *                 "dialog_frequency": "once"  // once/every_time
     *             }
     */
    class Guide(
        val type: String,
        val link: LinkEntity,
        val title: String = "",
        val content: String = "",
        @SerializedName("link_text_prefix")
        val linkTextPrefix: String = "",
        @SerializedName("link_text")
        val linkText: String = "",
        @SerializedName("button_text_close")
        val buttonTextClose: String = "",
        @SerializedName("button_text_setting_jump")
        val buttonTextSettingJump: String = "",
        @SerializedName("dialog_frequency")
        val dialogFrequency: String = "",
    )

    class PackageObserveActions(
        @SerializedName("ADD")
        val add: String,
        @SerializedName("REM")
        val rem: String,
        @SerializedName("REP")
        val rep: String
    )

    class QuestionTip(
        @SerializedName("link")
        val linkEntity: LinkEntity? = null,
    )
}