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


@attr.s
class GetMailGroupPermissionMemberReqUserIDType(object):
    pass


@attr.s
class GetMailGroupPermissionMemberReq(object):
    user_id_type: GetMailGroupPermissionMemberReqUserIDType = 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
    department_id_type: GetMailGroupPermissionMemberReqDepartmentIDType = attr.ib(
        default=None, metadata={"req_type": "query"}
    )  # 此次调用中使用的部门ID的类型, 示例值："open_department_id", 可选值有: `department_id`：以自定义department_id来标识部门, `open_department_id`：以open_department_id来标识部门
    mailgroup_id: str = attr.ib(
        default="", metadata={"req_type": "path"}
    )  # 邮件组ID或者邮件组地址, 示例值："xxxxxxxxxxxxxxx 或 test_mail_group@xxx.xx"
    permission_member_id: str = attr.ib(
        default="", metadata={"req_type": "path"}
    )  # 权限组内成员唯一标识, 示例值："xxxxxxxxxxxxxxx"


@attr.s
class GetMailGroupPermissionMemberRespType(object):
    pass


@attr.s
class GetMailGroupPermissionMemberResp(object):
    permission_member_id: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 权限组内成员唯一标识
    user_id: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 租户内用户的唯一标识（当成员类型是USER时有值）
    department_id: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 租户内部门的唯一标识（当成员类型是DEPARTMENT时有值）
    type: GetMailGroupPermissionMemberRespType = attr.ib(
        factory=lambda: GetMailGroupPermissionMemberRespType(),
        metadata={"req_type": "json"},
    )  # 成员类型, 可选值有: `USER`：内部用户, `DEPARTMENT`：部门


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