# 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 GetDriveImportTaskReq(object):
    ticket: str = attr.ib(
        default="", metadata={"req_type": "path"}
    )  # 导入任务ID, 示例值："6990281865xxxxxxxx7843"


@attr.s
class GetDriveImportTaskRespResult(object):
    ticket: str = attr.ib(default="", metadata={"req_type": "json"})  # 任务ID
    type: str = attr.ib(default="", metadata={"req_type": "json"})  # 导入目标云文档格式
    job_status: int = attr.ib(default=0, metadata={"req_type": "json"})  # 任务状态
    job_error_msg: str = attr.ib(default="", metadata={"req_type": "json"})  # 任务失败原因
    token: str = attr.ib(default="", metadata={"req_type": "json"})  # 导入云文档Token
    url: str = attr.ib(default="", metadata={"req_type": "json"})  # 导入云文档URL
    extra: typing.List[str] = attr.ib(
        factory=lambda: [], metadata={"req_type": "json"}
    )  # 任务成功后的提示信息


@attr.s
class GetDriveImportTaskResp(object):
    result: GetDriveImportTaskRespResult = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 导入结果


def _gen_get_drive_import_task_req(request, options) -> RawRequestReq:
    return RawRequestReq(
        dataclass=GetDriveImportTaskResp,
        scope="Drive",
        api="GetDriveImportTask",
        method="GET",
        url="https://open.feishu.cn/open-apis/drive/v1/import_tasks/:ticket",
        body=request,
        method_option=_new_method_option(options),
        need_tenant_access_token=True,
        need_user_access_token=True,
    )
