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


@attr.s
class CreateChatReqLeaveMessageVisibility(object):
    pass


@attr.s
class CreateChatReqJoinMessageVisibility(object):
    pass


@attr.s
class CreateChatReqChatType(object):
    pass


@attr.s
class CreateChatReqI18nNames(object):
    zh_cn: str = attr.ib(default="", metadata={"req_type": "json"})  # 中文名, 示例值："群聊"
    en_us: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 英文名, 示例值："group chat"
    ja_jp: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 日文名, 示例值："グループチャット"


@attr.s
class CreateChatReq(object):
    avatar: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 群头像对应的 Image Key，可通过[上传图片](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/image/create)获取（注意：上传图片的 [image_type] 需要指定为 [avatar]）, 示例值："default-avatar_44ae0ca3-e140-494b-956f-78091e348435"
    name: str = attr.ib(default="", metadata={"req_type": "json"})  # 群名称, 示例值："测试群名称"
    description: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 群描述, 示例值："测试群描述"
    i18n_names: CreateChatReqI18nNames = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 群国际化名称
    chat_mode: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 群模式(group), 示例值："group"
    chat_type: CreateChatReqChatType = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 群类型(private/public), 示例值："private"
    join_message_visibility: CreateChatReqJoinMessageVisibility = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 入群消息可见性(only_owner/all_members/not_anyone), 示例值："all_members"
    leave_message_visibility: CreateChatReqLeaveMessageVisibility = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 出群消息可见性(only_owner/all_members/not_anyone), 示例值："all_members"
    membership_approval: CreateChatReqMembershipApproval = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 加群审批(no_approval_required/approval_required), 示例值："no_approval_required"


@attr.s
class CreateChatRespModerationPermission(object):
    pass


@attr.s
class CreateChatRespMembershipApproval(object):
    pass


@attr.s
class CreateChatRespLeaveMessageVisibility(object):
    pass


@attr.s
class CreateChatRespJoinMessageVisibility(object):
    pass


@attr.s
class CreateChatRespChatType(object):
    pass


@attr.s
class CreateChatRespEditPermission(object):
    pass


@attr.s
class CreateChatRespAtAllPermission(object):
    pass


@attr.s
class CreateChatRespShareCardPermission(object):
    pass


@attr.s
class CreateChatRespAddMemberPermission(object):
    pass


@attr.s
class CreateChatRespI18nNames(object):
    zh_cn: str = attr.ib(default="", metadata={"req_type": "json"})  # 中文名
    en_us: str = attr.ib(default="", metadata={"req_type": "json"})  # 英文名
    ja_jp: str = attr.ib(default="", metadata={"req_type": "json"})  # 日文名


@attr.s
class CreateChatResp(object):
    chat_id: str = attr.ib(default="", metadata={"req_type": "json"})  # 群 ID
    avatar: str = attr.ib(default="", metadata={"req_type": "json"})  # 群头像 URL
    name: str = attr.ib(default="", metadata={"req_type": "json"})  # 群名称
    description: str = attr.ib(default="", metadata={"req_type": "json"})  # 群描述
    i18n_names: CreateChatRespI18nNames = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 群国际化名称
    add_member_permission: CreateChatRespAddMemberPermission = attr.ib(
        factory=lambda: CreateChatRespAddMemberPermission(),
        metadata={"req_type": "json"},
    )  # 加 user/bot 入群权限(all_members/only_owner)
    share_card_permission: CreateChatRespShareCardPermission = attr.ib(
        factory=lambda: CreateChatRespShareCardPermission(),
        metadata={"req_type": "json"},
    )  # 群分享权限(allowed/not_allowed)
    at_all_permission: CreateChatRespAtAllPermission = attr.ib(
        factory=lambda: CreateChatRespAtAllPermission(), metadata={"req_type": "json"}
    )  # at 所有人权限(all_members/only_owner)
    edit_permission: CreateChatRespEditPermission = attr.ib(
        factory=lambda: CreateChatRespEditPermission(), metadata={"req_type": "json"}
    )  # 群编辑权限(all_members/only_owner)
    chat_mode: str = attr.ib(default="", metadata={"req_type": "json"})  # 群模式(group)
    chat_type: CreateChatRespChatType = attr.ib(
        factory=lambda: CreateChatRespChatType(), metadata={"req_type": "json"}
    )  # 群类型(private/public)
    chat_tag: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 优先级最高的一个群 tag（inner/tenant/department/edu/meeting/customer_service）
    join_message_visibility: CreateChatRespJoinMessageVisibility = attr.ib(
        factory=lambda: CreateChatRespJoinMessageVisibility(),
        metadata={"req_type": "json"},
    )  # 入群消息可见性(only_owner/all_members/not_anyone)
    leave_message_visibility: CreateChatRespLeaveMessageVisibility = attr.ib(
        factory=lambda: CreateChatRespLeaveMessageVisibility(),
        metadata={"req_type": "json"},
    )  # 出群消息可见性(only_owner/all_members/not_anyone)
    membership_approval: CreateChatRespMembershipApproval = attr.ib(
        factory=lambda: CreateChatRespMembershipApproval(),
        metadata={"req_type": "json"},
    )  # 加群审批(no_approval_required/approval_required)
    moderation_permission: CreateChatRespModerationPermission = attr.ib(
        factory=lambda: CreateChatRespModerationPermission(),
        metadata={"req_type": "json"},
    )  # 发言权限(all_members/only_owner/moderator_list)


def _gen_create_chat_req(request, options) -> RawRequestReq:
    return RawRequestReq(
        dataclass=CreateChatResp,
        scope="Chat",
        api="CreateChat",
        method="POST",
        url="https://open.feishu.cn/open-apis/im/v1/chats",
        body=request,
        method_option=_new_method_option(options),
        need_tenant_access_token=True,
    )
