# 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 CreateBitableViewReq(object):
    app_token: str = attr.ib(
        default="", metadata={"req_type": "path"}
    )  # bitable app token, 示例值："appbcbWCzen6D8dezhoCH2RpMAh"
    table_id: str = attr.ib(
        default="", metadata={"req_type": "path"}
    )  # table id, 示例值："tblsRc9GRRXKqhvW"
    view_id: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 视图Id, 示例值："vewTpR1urY"
    view_name: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 视图名字, 示例值："甘特视图1"
    view_type: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 视图类型, 示例值："gantt"


@attr.s
class CreateBitableViewRespApptableview(object):
    view_id: str = attr.ib(default="", metadata={"req_type": "json"})  # 视图Id
    view_name: str = attr.ib(default="", metadata={"req_type": "json"})  # 视图名字
    view_type: str = attr.ib(default="", metadata={"req_type": "json"})  # 视图类型


@attr.s
class CreateBitableViewResp(object):
    view: CreateBitableViewRespApptableview = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 视图


def _gen_create_bitable_view_req(request, options) -> RawRequestReq:
    return RawRequestReq(
        dataclass=CreateBitableViewResp,
        scope="Bitable",
        api="CreateBitableView",
        method="POST",
        url="https://open.feishu.cn/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views",
        body=request,
        method_option=_new_method_option(options),
        need_tenant_access_token=True,
        need_user_access_token=True,
    )
