# 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 UpdateBitableRecordReqFieldsValue(object):
    pass


@attr.s
class UpdateBitableRecordReqFields(object):
    key: str = attr.ib(default="", metadata={"req_type": "json"})  # 字段名, 示例值："多行文本"
    value: typing.Any = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 内容, 示例值：文本


@attr.s
class UpdateBitableRecordReqUserIDType(object):
    pass


@attr.s
class UpdateBitableRecordReq(object):
    user_id_type: UpdateBitableRecordReqUserIDType = attr.ib(
        default=None, metadata={"req_type": "query"}
    )  # 用户 ID 类型, 示例值："open_id", 可选值有: `open_id`：用户的 open id, `union_id`：用户的 union id, `user_id`：用户的 user id, 默认值: `open_id`, 当值为 `user_id`, 字段权限要求: 获取用户 userid
    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"
    record_id: str = attr.ib(
        default="", metadata={"req_type": "path"}
    )  # 单条记录的 id, 示例值："recqwIwhc6"
    fields: UpdateBitableRecordReqFields = attr.ib(
        factory=lambda: UpdateBitableRecordReqFields(), metadata={"req_type": "json"}
    )  # 记录字段


@attr.s
class UpdateBitableRecordRespRecordFieldsValue(object):
    pass


@attr.s
class UpdateBitableRecordRespRecordFields(object):
    key: str = attr.ib(default="", metadata={"req_type": "json"})  # 字段名
    value: typing.Any = attr.ib(default=None, metadata={"req_type": "json"})  # 内容


@attr.s
class UpdateBitableRecordRespRecord(object):
    record_id: str = attr.ib(default="", metadata={"req_type": "json"})  # 记录 id
    fields: UpdateBitableRecordRespRecordFields = attr.ib(
        factory=lambda: UpdateBitableRecordRespRecordFields(),
        metadata={"req_type": "json"},
    )  # 记录字段


@attr.s
class UpdateBitableRecordResp(object):
    record: UpdateBitableRecordRespRecord = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # {,    "fields": {,        "人力评估": 2,,        "任务执行人": [,            {,                "id": "ou_debc524b2d8cb187704df652b43d29de",            },        ],,        "任务描述": "多渠道收集用户反馈",,        "对应 OKR": [,            "recqwIwhc6",,            "recOuEJMvN",        ],,        "截止日期": 1609516800000,,        "是否完成": true,,        "状态": "已结束",,        "相关部门": [,            "销售",,            "客服",        ],    },}


def _gen_update_bitable_record_req(request, options) -> RawRequestReq:
    return RawRequestReq(
        dataclass=UpdateBitableRecordResp,
        scope="Bitable",
        api="UpdateBitableRecord",
        method="PUT",
        url="https://open.feishu.cn/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id",
        body=request,
        method_option=_new_method_option(options),
        need_tenant_access_token=True,
        need_user_access_token=True,
    )
