from clarabot_nano_common.common.protocol.request import NanoBaseRequest


class NanoSearchRequest(NanoBaseRequest):
    TYPE_KEY = "SEARCH"

    QUERY = "query"  # query expression from the user
    LANGUAGE = "lang"  # preferred language for results


class AdminGetInfoRequest(NanoBaseRequest):
    TYPE_KEY = "A-INFO"


class AdminGetRemoteConfigRequest(NanoBaseRequest):
    TYPE_KEY = "A-REM-CFG"


class AdminGetListingRequest(NanoBaseRequest):
    TYPE_KEY = "A-LISTING"

    PATH = "path"  # str


class AdminChangePasswordRequest(NanoBaseRequest):
    TYPE_KEY = "A-CH-PWD"

    NEW_PASSWORD = "new_password"  # str


class AdminCreateDriveRequest(NanoBaseRequest):
    TYPE_KEY = "A-D-CREATE"

    PATH = "path"  # str


class AdminDeleteDriveRequest(NanoBaseRequest):
    TYPE_KEY = "A-D-DELETE"

    PATH = "path"  # str


class AdminAttachDriveRequest(NanoBaseRequest):
    TYPE_KEY = "A-D-ATTACH"

    PATH = "path"  # str
    TARGET_ROOM_ID = "target_room_id"  # str
    ROOM_BLOCKS = "room_blocks"  # [str];  the verified block id-hashes in config-storage format


class AdminDetachDriveRequest(NanoBaseRequest):
    TYPE_KEY = "A-D-DETACH"

    PATH = "path"  # str
    TARGET_ROOM_ID = "target_room_id"  # str


class AdminDriveAddBackupRoomRequest(NanoBaseRequest):
    TYPE_KEY = "A-D-ADD-BUP"

    PATH = "path"  # str
    TARGET_ROOM_ID = "target_room_id"  # str


class AdminDriveDeleteBackupRoomRequest(NanoBaseRequest):
    TYPE_KEY = "A-D-DEL-BUP"

    PATH = "path"  # str
    TARGET_ROOM_ID = "target_room_id"  # str


class AdminEditNameRequest(NanoBaseRequest):
    TYPE_KEY = "A-EDIT-N"

    NAME = "name"  # str


class AdminEditDenyAnonymousRequest(NanoBaseRequest):
    TYPE_KEY = "A-EDIT-DENY-ANON"

    VALUE = "value"  # bool


class AdminEditBackupIntervalRequest(NanoBaseRequest):
    TYPE_KEY = "A-EDIT-BUP-INT"

    INTERVAL = "interval"  # int


class AdminReplaceSecretsRequest(NanoBaseRequest):
    TYPE_KEY = "A-REPL-SECRETS"


class AdminEditRequireExplicitPeerTrustRequest(NanoBaseRequest):
    TYPE_KEY = "A-EDIT-REQ-EXPLICIT-PEER-TRUST"

    VALUE = "value"  # bool
