# 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 GetMailGroupReq(object):
    mailgroup_id: str = attr.ib(
        default="", metadata={"req_type": "path"}
    )  # 邮件组ID或者邮件组地址, 示例值："xxxxxxxxxxxxxxx 或 test_mail_group@xxx.xx"


@attr.s
class GetMailGroupResp(object):
    mailgroup_id: str = attr.ib(default="", metadata={"req_type": "json"})  # 邮件组ID
    email: str = attr.ib(default="", metadata={"req_type": "json"})  # 邮件组地址
    name: str = attr.ib(default="", metadata={"req_type": "json"})  # 邮件组名称
    description: str = attr.ib(default="", metadata={"req_type": "json"})  # 邮件组描述
    direct_members_count: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 邮件组成员数量
    include_external_member: bool = attr.ib(
        factory=lambda: bool(), metadata={"req_type": "json"}
    )  # 是否包含外部成员
    include_all_company_member: bool = attr.ib(
        factory=lambda: bool(), metadata={"req_type": "json"}
    )  # 是否是全员邮件组
    who_can_send_mail: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 谁可发送邮件到此邮件组, 可选值有: `ANYONE`：任何人, `ALL_INTERNAL_USERS`：仅组织内部成员, `ALL_GROUP_MEMBERS`：仅邮件组成员, `CUSTOM_MEMBERS`：自定义成员


def _gen_get_mailgroup_req(request, options) -> RawRequestReq:
    return RawRequestReq(
        dataclass=GetMailGroupResp,
        scope="Mail",
        api="GetMailGroup",
        method="GET",
        url="https://open.feishu.cn/open-apis/mail/v1/mailgroups/:mailgroup_id",
        body=request,
        method_option=_new_method_option(options),
        need_tenant_access_token=True,
    )
