# 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 DownloadAttendanceFileReq(object):
    file_id: str = attr.ib(
        default="", metadata={"req_type": "path"}
    )  # 文件 ID，示例值："xxxxxb306842b1c189bc5212eefxxxxx"


@attr.s
class DownloadAttendanceFileRespFile(object):
    pass


@attr.s
class DownloadAttendanceFileResp(object):
    file: typing.Union[str, bytes, io.BytesIO] = attr.ib(
        default=None, metadata={"resp_type": "header"}
    )
    filename: str = attr.ib(default="", metadata={"resp_type": "header"})  # 文件名


@attr.s
class DownloadAttendanceFileResp(object):
    is_file: bool = attr.ib(factory=lambda: bool(), metadata={"resp_type": "header"})
    code: int = attr.ib(default=0, metadata={"resp_type": "header"})
    msg: str = attr.ib(default="", metadata={"resp_type": "header"})
    data: DownloadAttendanceFileResp = attr.ib(
        default=None, metadata={"resp_type": "header"}
    )


def _gen_download_attendance_file_req(request, options) -> RawRequestReq:
    return RawRequestReq(
        dataclass=DownloadAttendanceFileResp,
        scope="Attendance",
        api="DownloadAttendanceFile",
        method="GET",
        url="https://open.feishu.cn/open-apis/attendance/v1/files/:file_id/download",
        body=request,
        method_option=_new_method_option(options),
        need_tenant_access_token=True,
    )
