# 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 FinishUploadDriveFileReq(object):
    upload_id: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 分片上传事务ID, 示例值："123456"
    block_num: int = attr.ib(default=0, metadata={"req_type": "json"})  # 分片数量, 示例值：1


@attr.s
class FinishUploadDriveFileResp(object):
    file_token: str = attr.ib(default="", metadata={"req_type": "json"})  # 新创建的文件token


def _gen_finish_upload_drive_file_req(request, options) -> RawRequestReq:
    return RawRequestReq(
        dataclass=FinishUploadDriveFileResp,
        scope="Drive",
        api="FinishUploadDriveFile",
        method="POST",
        url="https://open.feishu.cn/open-apis/drive/v1/files/upload_finish",
        body=request,
        method_option=_new_method_option(options),
        need_tenant_access_token=True,
        need_user_access_token=True,
    )
