# Code generated by lark_sdk_gen. DO NOT EDIT.

from pylark.lark_request import RawRequestReq, _new_method_option
import attr
import typing
import io


@attr.s
class UpdateSheetDataValidationDropdownReqDataValidationOptions(object):
    multiple_values: bool = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 单选填false, 多选填true，不填默认为false
    highlight_valid_data: bool = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 是否设置颜色和胶囊样式, 不填默认为false
    colors: typing.List[str] = attr.ib(
        factory=lambda: [], metadata={"req_type": "json"}
    )  # 当highlightValidData为true时，color需填颜色,与conditionValues中的值一一对应。需是RGB16进制格式,如"#fffd00"


@attr.s
class UpdateSheetDataValidationDropdownReqDataValidation(object):
    condition_values: typing.List[str] = attr.ib(
        factory=lambda: [], metadata={"req_type": "json"}
    )  # 下拉列表选项值, 需为字符串,不能包含","，选项值最长100字符,选项个数最多500个
    options: UpdateSheetDataValidationDropdownReqDataValidationOptions = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 可选属性


@attr.s
class UpdateSheetDataValidationDropdownReq(object):
    spreadsheet_token: str = attr.ib(
        default="", metadata={"req_type": "path"}
    )  # spreadsheet 的 token，获取方式见[在线表格开发指南](https://open.feishu.cn/document/ukTMukTMukTM/uATMzUjLwEzM14CMxMTN/overview)
    sheet_id: str = attr.ib(default="", metadata={"req_type": "path"})  # 子sheet唯一识别参数
    data_validation_id: int = attr.ib(
        default=0, metadata={"req_type": "path"}
    )  # sheet中下拉列表的唯一标示id
    data_validation_type: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 下拉列表填"list"
    data_validation: UpdateSheetDataValidationDropdownReqDataValidation = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 下拉列表规则属性


@attr.s
class UpdateSheetDataValidationDropdownRespDataValidationOptionsColorValueMap(object):
    pass


@attr.s
class UpdateSheetDataValidationDropdownRespDataValidationOptions(object):
    multiple_values: bool = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 单选填false, 多选填true
    highlight_valid_data: bool = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 是否设置颜色和胶囊样式
    color_value_map: UpdateSheetDataValidationDropdownRespDataValidationOptionsColorValueMap = attr.ib(
        factory=lambda: UpdateSheetDataValidationDropdownRespDataValidationOptionsColorValueMap(),
        metadata={"req_type": "json"},
    )  # 当highlightValidData为true时，colorValueMap的key与conditionValues中的值一一对应，value为对应的颜色参数。


@attr.s
class UpdateSheetDataValidationDropdownRespDataValidation(object):
    data_validation_id: int = attr.ib(
        default=0, metadata={"req_type": "json"}
    )  # 唯一标示id
    data_validation_type: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 下拉列表为"list"
    condition_values: typing.List[str] = attr.ib(
        factory=lambda: [], metadata={"req_type": "json"}
    )  # 下拉列表选项值
    options: UpdateSheetDataValidationDropdownRespDataValidationOptions = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 可选属性


@attr.s
class UpdateSheetDataValidationDropdownResp(object):
    spreadsheet_token: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # spreadsheet的token
    sheet_id: str = attr.ib(default="", metadata={"req_type": "json"})  # 工作表 sheet 的 id
    data_validation: UpdateSheetDataValidationDropdownRespDataValidation = attr.ib(
        default=None, metadata={"req_type": "json"}
    )


def _gen_update_sheet_data_validation_dropdown_req(request, options) -> RawRequestReq:
    return RawRequestReq(
        dataclass=UpdateSheetDataValidationDropdownResp,
        scope="Drive",
        api="UpdateSheetDataValidationDropdown",
        method="PUT",
        url="https://open.feishu.cn/open-apis/sheets/v2/spreadsheets/:spreadsheetToken/dataValidation/:sheetId/:dataValidationId",
        body=request,
        method_option=_new_method_option(options),
        need_tenant_access_token=True,
        need_user_access_token=True,
    )
