# 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 CreateDriveDocReq(object):
    folder_token: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 文件夹 token，获取方式见[准备接入文档 API](https://open.feishu.cn/document/ukTMukTMukTM/ugzNzUjL4czM14CO3MTN/guide/getting-start)；空表示根目录
    content: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 传入符合[文档数据结构](https://open.feishu.cn/document/ukTMukTMukTM/uAzM5YjLwMTO24CMzkjN)的字符串，若为空表示创建空文档


@attr.s
class CreateDriveDocResp(object):
    obj_token: str = attr.ib(default="", metadata={"req_type": "json"})  # 新建文档的token
    url: str = attr.ib(default="", metadata={"req_type": "json"})  # 新建文档的访问链接


def _gen_create_drive_doc_req(request, options) -> RawRequestReq:
    return RawRequestReq(
        dataclass=CreateDriveDocResp,
        scope="Drive",
        api="CreateDriveDoc",
        method="POST",
        url="https://open.feishu.cn/open-apis/doc/v2/create",
        body=request,
        method_option=_new_method_option(options),
        need_tenant_access_token=True,
        need_user_access_token=True,
    )
