# 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 GetSheetProtectedDimensionReq(object):
    protect_ids: typing.List[str] = attr.ib(
        factory=lambda: [], metadata={"req_type": "query"}
    )  # 保护范围ID，可以通过[获取表格元数据](https://open.feishu.cn/document/ukTMukTMukTM/uETMzUjLxEzM14SMxMTN)接口获取，多个ID用逗号分隔，如xxxID1,xxxID2
    member_type: str = attr.ib(
        default="", metadata={"req_type": "query"}
    )  # 返回的用户类型，可选userId,openId,unionId,默认使用userId
    spreadsheet_token: str = attr.ib(
        default="", metadata={"req_type": "path"}
    )  # spreadsheet 的 token，获取方式见[在线表格开发指南](https://open.feishu.cn/document/ukTMukTMukTM/uATMzUjLwEzM14CMxMTN/overview)


@attr.s
class GetSheetProtectedDimensionRespProtectedRangeEditorsUser(object):
    member_type: str = attr.ib(default="", metadata={"req_type": "json"})  # 用户类型
    member_id: str = attr.ib(default="", metadata={"req_type": "json"})  # 用户ID


@attr.s
class GetSheetProtectedDimensionRespProtectedRangeEditors(object):
    users: typing.List[
        GetSheetProtectedDimensionRespProtectedRangeEditorsUser
    ] = attr.ib(
        factory=lambda: [], metadata={"req_type": "json"}
    )  # 用户信息列表


@attr.s
class GetSheetProtectedDimensionRespProtectedRangeDimension(object):
    sheet_id: str = attr.ib(default="", metadata={"req_type": "json"})  # sheet 的 id
    start_index: int = attr.ib(
        default=0, metadata={"req_type": "json"}
    )  # 保护行列起始下标，下标从1开始
    end_index: int = attr.ib(
        default=0, metadata={"req_type": "json"}
    )  # 保护行列终止下标，下标从1开始
    major_dimension: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 保护范围的维度，COLUMNS为保护列，ROWS为保护行


@attr.s
class GetSheetProtectedDimensionRespProtectedRange(object):
    protect_id: str = attr.ib(default="", metadata={"req_type": "json"})  # 保护范围ID
    dimension: GetSheetProtectedDimensionRespProtectedRangeDimension = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 保护范围，如果为空，则为保护子表
    sheet_id: str = attr.ib(default="", metadata={"req_type": "json"})  # sheet的id
    lock_info: str = attr.ib(default="", metadata={"req_type": "json"})  # 保护说明
    editors: GetSheetProtectedDimensionRespProtectedRangeEditors = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 用户信息


@attr.s
class GetSheetProtectedDimensionResp(object):
    protected_range: GetSheetProtectedDimensionRespProtectedRange = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 保护范围


def _gen_get_sheet_protected_dimension_req(request, options) -> RawRequestReq:
    return RawRequestReq(
        dataclass=GetSheetProtectedDimensionResp,
        scope="Drive",
        api="GetSheetProtectedDimension",
        method="GET",
        url="https://open.feishu.cn/open-apis/sheets/v2/spreadsheets/:spreadsheetToken/protected_range_batch_get",
        body=request,
        method_option=_new_method_option(options),
        need_tenant_access_token=True,
        need_user_access_token=True,
    )
