# 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 CancelApprovalInstanceReq(object):
    approval_code: str = attr.ib(default="", metadata={"req_type": "json"})  # 审批定义Code
    instance_code: str = attr.ib(default="", metadata={"req_type": "json"})  # 审批实例Code
    user_id: str = attr.ib(default="", metadata={"req_type": "json"})  # 操作用户
    comment: str = attr.ib(default="", metadata={"req_type": "json"})  # 撤回的实例的时候可以添加评论
    open_id: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 某个应用下用户的唯一标识，根据userID、openID、TenantId获得Lark用户。
    notify_starter: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 如果为true，撤回实例的时候会收到一条消息提醒。


@attr.s
class CancelApprovalInstanceResp(object):
    pass


def _gen_cancel_approval_instance_req(request, options) -> RawRequestReq:
    return RawRequestReq(
        dataclass=CancelApprovalInstanceResp,
        scope="Approval",
        api="CancelApprovalInstance",
        method="POST",
        url="https://www.feishu.cn/approval/openapi/v2/instance/cancel",
        body=request,
        method_option=_new_method_option(options),
        need_tenant_access_token=True,
    )
