# 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 CreateHelpdeskAgentSkillReqRule(object):
    id: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # rule id, 看[获取客服技能rules](https://open.feishu.cn/document/ukTMukTMukTM/ucDOyYjL3gjM24yN4IjN/list-agent-skill-rules) 用于获取rules options, 示例值："test-skill-id"
    selected_operator: int = attr.ib(
        default=0, metadata={"req_type": "json"}
    )  # 运算符compare, 看[客服技能运算符options](https://open.feishu.cn/document/ukTMukTMukTM/ucDOyYjL3gjM24yN4IjN/operator-options), 示例值：3
    operand: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # rule操作数value, 示例值："    {,                    "selected": ["6883005079188668418"],,                    "options": [,                        {,                            "id": "6883005079188668418",,                            "name": {,                                "en_us": "小程序及应用",,                                "ja_jp": "小程序及应用",,                                "zh_cn": "小程序及应用",                            },                        },,                        {,                            "children": [,                                {,                                    "id": "6883005086914625538",,                                    "name": {,                                        "en_us": "消息提醒",,                                        "ja_jp": "消息提醒",,                                        "zh_cn": "消息提醒",                                    },                                },,                                {,                                    "id": "6883005092723802114",,                                    "name": {,                                        "en_us": "其他",,                                        "ja_jp": "其他",,                                        "zh_cn": "其他",                                    },                                },                            ],,                            "id": "6883005085605986306",,                            "name": {,                                "en_us": "聊天和群组",,                                "ja_jp": "聊天和群组",,                                "zh_cn": "聊天和群组",                            },                        },,                    ],,                }"
    category: int = attr.ib(
        default=0, metadata={"req_type": "json"}
    )  # rule type，1-知识库，2-工单信息，3-用户飞书信息, 示例值：1


@attr.s
class CreateHelpdeskAgentSkillReq(object):
    name: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 技能名, 示例值："test-skill"
    rules: typing.List[CreateHelpdeskAgentSkillReqRule] = attr.ib(
        factory=lambda: [], metadata={"req_type": "json"}
    )  # 技能rules
    agent_ids: typing.List[str] = attr.ib(
        factory=lambda: [], metadata={"req_type": "json"}
    )  # 客服 ids


@attr.s
class CreateHelpdeskAgentSkillResp(object):
    agent_skill_id: str = attr.ib(default="", metadata={"req_type": "json"})  # 客服技能id


def _gen_create_helpdesk_agent_skill_req(request, options) -> RawRequestReq:
    return RawRequestReq(
        dataclass=CreateHelpdeskAgentSkillResp,
        scope="Helpdesk",
        api="CreateHelpdeskAgentSkill",
        method="POST",
        url="https://open.feishu.cn/open-apis/helpdesk/v1/agent_skills",
        body=request,
        method_option=_new_method_option(options),
        need_user_access_token=True,
        need_helpdesk_auth=True,
    )
