# 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 DownloadEHRAttachmentsReq(object):
    token: str = attr.ib(
        default="", metadata={"req_type": "path"}
    )  # 文件 token, 示例值："09bf7b924f9a4a69875788891b5970d8"


@attr.s
class DownloadEHRAttachmentsRespFile(object):
    pass


@attr.s
class DownloadEHRAttachmentsResp(object):
    file: typing.Union[str, bytes, io.BytesIO] = attr.ib(
        default=None, metadata={"req_type": "json"}
    )


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


def _gen_download_ehr_attachments_req(request, options) -> RawRequestReq:
    return RawRequestReq(
        dataclass=DownloadEHRAttachmentsResp,
        scope="EHR",
        api="DownloadEHRAttachments",
        method="GET",
        url="https://open.feishu.cn/open-apis/ehr/v1/attachments/:token",
        body=request,
        method_option=_new_method_option(options),
        need_tenant_access_token=True,
    )
