# 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 CheckDriveMemberPermissionReq(object):
    token: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 文件的 token，获取方式见 [对接前说明](https://open.feishu.cn/document/ukTMukTMukTM/uczNzUjL3czM14yN3MTN)的第 4 项
    type: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 文档类型  "doc"  or  "sheet" or "file"
    perm: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 权限，"view" or "edit" or "share"


@attr.s
class CheckDriveMemberPermissionResp(object):
    is_permitted: bool = attr.ib(
        factory=lambda: bool(), metadata={"req_type": "json"}
    )  # 是否具有指定权限


def _gen_check_drive_member_permission_req(request, options) -> RawRequestReq:
    return RawRequestReq(
        dataclass=CheckDriveMemberPermissionResp,
        scope="Drive",
        api="CheckDriveMemberPermission",
        method="POST",
        url="https://open.feishu.cn/open-apis/drive/permission/member/permitted",
        body=request,
        method_option=_new_method_option(options),
        need_tenant_access_token=True,
        need_user_access_token=True,
    )
