# 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 CreateSheetFilterViewConditionReq(object):
    spreadsheet_token: str = attr.ib(
        default="", metadata={"req_type": "path"}
    )  # 表格 token, 示例值："shtcnmBA*****yGehy8"
    sheet_id: str = attr.ib(
        default="", metadata={"req_type": "path"}
    )  # 子表 id, 示例值："0b**12"
    filter_view_id: str = attr.ib(
        default="", metadata={"req_type": "path"}
    )  # 筛选视图 id, 示例值："pH9hbVcCXA"
    condition_id: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 设置筛选条件的列，使用字母号, 示例值："E"
    filter_type: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 筛选类型, 示例值："number"
    compare_type: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 比较类型, 示例值："less"
    expected: typing.List[str] = attr.ib(
        factory=lambda: [], metadata={"req_type": "json"}
    )  # 筛选参数, 示例值：6


@attr.s
class CreateSheetFilterViewConditionRespCondition(object):
    condition_id: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 设置筛选条件的列，使用字母号
    filter_type: str = attr.ib(default="", metadata={"req_type": "json"})  # 筛选类型
    compare_type: str = attr.ib(default="", metadata={"req_type": "json"})  # 比较类型
    expected: typing.List[str] = attr.ib(
        factory=lambda: [], metadata={"req_type": "json"}
    )  # 筛选参数


@attr.s
class CreateSheetFilterViewConditionResp(object):
    condition: CreateSheetFilterViewConditionRespCondition = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 创建的筛选条件


def _gen_create_sheet_filter_view_condition_req(request, options) -> RawRequestReq:
    return RawRequestReq(
        dataclass=CreateSheetFilterViewConditionResp,
        scope="Drive",
        api="CreateSheetFilterViewCondition",
        method="POST",
        url="https://open.feishu.cn/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions",
        body=request,
        method_option=_new_method_option(options),
        need_tenant_access_token=True,
        need_user_access_token=True,
    )
