# 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 UpdateSheetFilterViewReq(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"
    filter_view_name: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 筛选视图名字, 示例值："筛选视图 1"
    range_: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 筛选视图的筛选范围, 示例值："0b**12!C1:H14"


@attr.s
class UpdateSheetFilterViewRespFilterView(object):
    filter_view_id: str = attr.ib(default="", metadata={"req_type": "json"})  # 筛选视图 id
    filter_view_name: str = attr.ib(default="", metadata={"req_type": "json"})  # 筛选视图名字
    range_: str = attr.ib(default="", metadata={"req_type": "json"})  # 筛选视图的筛选范围


@attr.s
class UpdateSheetFilterViewResp(object):
    filter_view: UpdateSheetFilterViewRespFilterView = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 更新后的筛选视图的 id 、name、range


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