# Code generated by lark suite oapi sdk gen

from typing import List, Dict, Any
from ....utils.dt import to_json_decorator
from ....event.model.event import *
import attr


@to_json_decorator
@attr.s
class CustomAttrOption:
    id = attr.ib(type=str, default=None, metadata={"json": "id"})
    value = attr.ib(type=str, default=None, metadata={"json": "value"})
    name = attr.ib(type=str, default=None, metadata={"json": "name"})


@to_json_decorator
@attr.s
class CustomAttrOptions:
    default_option_id = attr.ib(
        type=str, default=None, metadata={"json": "default_option_id"}
    )
    option_type = attr.ib(type=str, default=None, metadata={"json": "option_type"})
    options = attr.ib(
        type=List[CustomAttrOption], default=None, metadata={"json": "options"}
    )


@to_json_decorator
@attr.s
class CustomAttrGenericUser:
    id = attr.ib(type=str, default=None, metadata={"json": "id"})
    type = attr.ib(type=int, default=None, metadata={"json": "type"})


@to_json_decorator
@attr.s
class UserCustomAttrValue:
    text = attr.ib(type=str, default=None, metadata={"json": "text"})
    url = attr.ib(type=str, default=None, metadata={"json": "url"})
    pc_url = attr.ib(type=str, default=None, metadata={"json": "pc_url"})
    option_id = attr.ib(type=str, default=None, metadata={"json": "option_id"})
    option_value = attr.ib(type=str, default=None, metadata={"json": "option_value"})
    name = attr.ib(type=str, default=None, metadata={"json": "name"})
    picture_url = attr.ib(type=str, default=None, metadata={"json": "picture_url"})
    generic_user = attr.ib(
        type=CustomAttrGenericUser, default=None, metadata={"json": "generic_user"}
    )


@to_json_decorator
@attr.s
class UserCustomAttr:
    type = attr.ib(type=str, default=None, metadata={"json": "type"})
    id = attr.ib(type=str, default=None, metadata={"json": "id"})
    value = attr.ib(type=UserCustomAttrValue, default=None, metadata={"json": "value"})


@to_json_decorator
@attr.s
class UserStatus:
    is_frozen = attr.ib(type=bool, default=None, metadata={"json": "is_frozen"})
    is_resigned = attr.ib(type=bool, default=None, metadata={"json": "is_resigned"})
    is_activated = attr.ib(type=bool, default=None, metadata={"json": "is_activated"})


@to_json_decorator
@attr.s
class UserPosition:
    position_code = attr.ib(type=str, default=None, metadata={"json": "position_code"})
    position_name = attr.ib(type=str, default=None, metadata={"json": "position_name"})
    department_id = attr.ib(type=str, default=None, metadata={"json": "department_id"})
    leader_user_id = attr.ib(
        type=str, default=None, metadata={"json": "leader_user_id"}
    )
    leader_position_code = attr.ib(
        type=str, default=None, metadata={"json": "leader_position_code"}
    )
    is_major = attr.ib(type=bool, default=None, metadata={"json": "is_major"})


@to_json_decorator
@attr.s
class UserOrder:
    department_id = attr.ib(type=str, default=None, metadata={"json": "department_id"})
    user_order = attr.ib(type=int, default=None, metadata={"json": "user_order"})
    department_order = attr.ib(
        type=int, default=None, metadata={"json": "department_order"}
    )


@to_json_decorator
@attr.s
class UserGroup:
    user_group_id = attr.ib(type=str, default=None, metadata={"json": "user_group_id"})
    name = attr.ib(type=str, default=None, metadata={"json": "name"})
    type = attr.ib(type=int, default=None, metadata={"json": "type"})
    member_count = attr.ib(type=int, default=None, metadata={"json": "member_count"})
    status = attr.ib(type=int, default=None, metadata={"json": "status"})


@to_json_decorator
@attr.s
class NotificationOption:
    channels = attr.ib(type=List[str], default=None, metadata={"json": "channels"})
    language = attr.ib(type=str, default=None, metadata={"json": "language"})


@to_json_decorator
@attr.s
class I18nContent:
    locale = attr.ib(type=str, default=None, metadata={"json": "locale"})
    value = attr.ib(type=str, default=None, metadata={"json": "value"})


@to_json_decorator
@attr.s
class EmployeeTypeEnum:
    __int_to_string_fields__ = attr.ib(type=List[str], default=["enum_value"])
    enum_id = attr.ib(type=str, default=None, metadata={"json": "enum_id"})
    enum_value = attr.ib(type=int, default=None, metadata={"json": "enum_value"})
    content = attr.ib(type=str, default=None, metadata={"json": "content"})
    enum_type = attr.ib(type=int, default=None, metadata={"json": "enum_type"})
    enum_status = attr.ib(type=int, default=None, metadata={"json": "enum_status"})
    i18n_content = attr.ib(
        type=List[I18nContent], default=None, metadata={"json": "i18n_content"}
    )


@to_json_decorator
@attr.s
class CustomAttr:
    id = attr.ib(type=str, default=None, metadata={"json": "id"})
    type = attr.ib(type=str, default=None, metadata={"json": "type"})
    options = attr.ib(
        type=CustomAttrOptions, default=None, metadata={"json": "options"}
    )
    i18n_name = attr.ib(
        type=List[I18nContent], default=None, metadata={"json": "i18n_name"}
    )


@to_json_decorator
@attr.s
class DepartmentStatus:
    is_deleted = attr.ib(type=bool, default=None, metadata={"json": "is_deleted"})


@to_json_decorator
@attr.s
class OldDepartmentObject:
    status = attr.ib(type=DepartmentStatus, default=None, metadata={"json": "status"})
    open_department_id = attr.ib(
        type=str, default=None, metadata={"json": "open_department_id"}
    )


@to_json_decorator
@attr.s
class DepartmentEvent:
    name = attr.ib(type=str, default=None, metadata={"json": "name"})
    parent_department_id = attr.ib(
        type=str, default=None, metadata={"json": "parent_department_id"}
    )
    department_id = attr.ib(type=str, default=None, metadata={"json": "department_id"})
    open_department_id = attr.ib(
        type=str, default=None, metadata={"json": "open_department_id"}
    )
    leader_user_id = attr.ib(
        type=str, default=None, metadata={"json": "leader_user_id"}
    )
    chat_id = attr.ib(type=str, default=None, metadata={"json": "chat_id"})
    order = attr.ib(type=int, default=None, metadata={"json": "order"})

    status = attr.ib(type=DepartmentStatus, default=None, metadata={"json": "status"})


@to_json_decorator
@attr.s
class DepartmentI18nName:
    zh_cn = attr.ib(type=str, default=None, metadata={"json": "zh_cn"})
    ja_jp = attr.ib(type=str, default=None, metadata={"json": "ja_jp"})
    en_us = attr.ib(type=str, default=None, metadata={"json": "en_us"})


@to_json_decorator
@attr.s
class Department:
    __int_to_string_fields__ = attr.ib(type=List[str], default=["order"])
    name = attr.ib(type=str, default=None, metadata={"json": "name"})
    i18n_name = attr.ib(
        type=DepartmentI18nName, default=None, metadata={"json": "i18n_name"}
    )
    parent_department_id = attr.ib(
        type=str, default=None, metadata={"json": "parent_department_id"}
    )
    department_id = attr.ib(type=str, default=None, metadata={"json": "department_id"})
    open_department_id = attr.ib(
        type=str, default=None, metadata={"json": "open_department_id"}
    )
    leader_user_id = attr.ib(
        type=str, default=None, metadata={"json": "leader_user_id"}
    )
    chat_id = attr.ib(type=str, default=None, metadata={"json": "chat_id"})
    order = attr.ib(type=int, default=None, metadata={"json": "order"})
    unit_ids = attr.ib(type=List[str], default=None, metadata={"json": "unit_ids"})
    member_count = attr.ib(type=int, default=None, metadata={"json": "member_count"})
    status = attr.ib(type=DepartmentStatus, default=None, metadata={"json": "status"})
    create_group_chat = attr.ib(
        type=bool, default=None, metadata={"json": "create_group_chat"}
    )


@to_json_decorator
@attr.s
class AvatarInfo:
    avatar_72 = attr.ib(type=str, default=None, metadata={"json": "avatar_72"})
    avatar_240 = attr.ib(type=str, default=None, metadata={"json": "avatar_240"})
    avatar_640 = attr.ib(type=str, default=None, metadata={"json": "avatar_640"})
    avatar_origin = attr.ib(type=str, default=None, metadata={"json": "avatar_origin"})


@to_json_decorator
@attr.s
class User:
    union_id = attr.ib(type=str, default=None, metadata={"json": "union_id"})
    user_id = attr.ib(type=str, default=None, metadata={"json": "user_id"})
    open_id = attr.ib(type=str, default=None, metadata={"json": "open_id"})
    name = attr.ib(type=str, default=None, metadata={"json": "name"})
    en_name = attr.ib(type=str, default=None, metadata={"json": "en_name"})
    email = attr.ib(type=str, default=None, metadata={"json": "email"})
    mobile = attr.ib(type=str, default=None, metadata={"json": "mobile"})
    mobile_visible = attr.ib(
        type=bool, default=None, metadata={"json": "mobile_visible"}
    )
    gender = attr.ib(type=int, default=None, metadata={"json": "gender"})
    avatar_key = attr.ib(type=str, default=None, metadata={"json": "avatar_key"})
    avatar = attr.ib(type=AvatarInfo, default=None, metadata={"json": "avatar"})
    status = attr.ib(type=UserStatus, default=None, metadata={"json": "status"})
    department_ids = attr.ib(
        type=List[str], default=None, metadata={"json": "department_ids"}
    )
    leader_user_id = attr.ib(
        type=str, default=None, metadata={"json": "leader_user_id"}
    )
    city = attr.ib(type=str, default=None, metadata={"json": "city"})
    country = attr.ib(type=str, default=None, metadata={"json": "country"})
    work_station = attr.ib(type=str, default=None, metadata={"json": "work_station"})
    join_time = attr.ib(type=int, default=None, metadata={"json": "join_time"})
    is_tenant_manager = attr.ib(
        type=bool, default=None, metadata={"json": "is_tenant_manager"}
    )
    employee_no = attr.ib(type=str, default=None, metadata={"json": "employee_no"})
    employee_type = attr.ib(type=int, default=None, metadata={"json": "employee_type"})

    orders = attr.ib(type=List[UserOrder], default=None, metadata={"json": "orders"})
    custom_attrs = attr.ib(
        type=List[UserCustomAttr], default=None, metadata={"json": "custom_attrs"}
    )
    enterprise_email = attr.ib(
        type=str, default=None, metadata={"json": "enterprise_email"}
    )

    job_title = attr.ib(type=str, default=None, metadata={"json": "job_title"})
    need_send_notification = attr.ib(
        type=bool, default=None, metadata={"json": "need_send_notification"}
    )
    notification_option = attr.ib(
        type=NotificationOption, default=None, metadata={"json": "notification_option"}
    )
    is_frozen = attr.ib(type=bool, default=None, metadata={"json": "is_frozen"})


@to_json_decorator
@attr.s
class Scope:
    departments = attr.ib(
        type=List[Department], default=None, metadata={"json": "departments"}
    )
    users = attr.ib(type=List[User], default=None, metadata={"json": "users"})
    user_groups = attr.ib(
        type=List[UserGroup], default=None, metadata={"json": "user_groups"}
    )


@to_json_decorator
@attr.s
class UserEvent:
    open_id = attr.ib(type=str, default=None, metadata={"json": "open_id"})
    user_id = attr.ib(type=str, default=None, metadata={"json": "user_id"})
    name = attr.ib(type=str, default=None, metadata={"json": "name"})
    en_name = attr.ib(type=str, default=None, metadata={"json": "en_name"})
    email = attr.ib(type=str, default=None, metadata={"json": "email"})
    mobile = attr.ib(type=str, default=None, metadata={"json": "mobile"})

    gender = attr.ib(type=int, default=None, metadata={"json": "gender"})
    avatar = attr.ib(type=AvatarInfo, default=None, metadata={"json": "avatar"})
    status = attr.ib(type=UserStatus, default=None, metadata={"json": "status"})
    department_ids = attr.ib(
        type=List[str], default=None, metadata={"json": "department_ids"}
    )
    leader_user_id = attr.ib(
        type=str, default=None, metadata={"json": "leader_user_id"}
    )
    city = attr.ib(type=str, default=None, metadata={"json": "city"})
    country = attr.ib(type=str, default=None, metadata={"json": "country"})
    work_station = attr.ib(type=str, default=None, metadata={"json": "work_station"})
    join_time = attr.ib(type=int, default=None, metadata={"json": "join_time"})

    employee_no = attr.ib(type=str, default=None, metadata={"json": "employee_no"})
    employee_type = attr.ib(type=int, default=None, metadata={"json": "employee_type"})

    orders = attr.ib(type=List[UserOrder], default=None, metadata={"json": "orders"})

    custom_attrs = attr.ib(
        type=List[UserCustomAttr], default=None, metadata={"json": "custom_attrs"}
    )


@to_json_decorator
@attr.s
class CustomAttrEvent:
    contact_field_key = attr.ib(
        type=str, default=None, metadata={"json": "contact_field_key"}
    )
    field_value_types = attr.ib(
        type=str, default=None, metadata={"json": "field_value_types"}
    )
    i18n_field_names = attr.ib(
        type=str, default=None, metadata={"json": "i18n_field_names"}
    )
    allow_open_query = attr.ib(
        type=str, default=None, metadata={"json": "allow_open_query"}
    )


@to_json_decorator
@attr.s
class DepartmentUnit:
    unit_id = attr.ib(type=str, default=None, metadata={"json": "unit_id"})
    unit_type = attr.ib(type=str, default=None, metadata={"json": "unit_type"})
    unit_name = attr.ib(type=str, default=None, metadata={"json": "unit_name"})


@to_json_decorator
@attr.s
class GroupEvent:
    user_group_id = attr.ib(type=str, default=None, metadata={"json": "user_group_id"})
    name = attr.ib(type=str, default=None, metadata={"json": "name"})


@to_json_decorator
@attr.s
class DepartmentCount:
    department_id = attr.ib(type=str, default=None, metadata={"json": "department_id"})
    direct_department_count = attr.ib(
        type=int, default=None, metadata={"json": "direct_department_count"}
    )
    direct_user_count = attr.ib(
        type=int, default=None, metadata={"json": "direct_user_count"}
    )
    department_count = attr.ib(
        type=int, default=None, metadata={"json": "department_count"}
    )
    user_count = attr.ib(type=int, default=None, metadata={"json": "user_count"})


@to_json_decorator
@attr.s
class DepartmentParent:
    department_id = attr.ib(type=str, default=None, metadata={"json": "department_id"})
    parent_ids = attr.ib(type=List[str], default=None, metadata={"json": "parent_ids"})


@to_json_decorator
@attr.s
class OldUserObject:
    department_ids = attr.ib(
        type=List[str], default=None, metadata={"json": "department_ids"}
    )
    open_id = attr.ib(type=str, default=None, metadata={"json": "open_id"})


@to_json_decorator
@attr.s
class Group:
    id = attr.ib(type=str, default=None, metadata={"json": "id"})
    name = attr.ib(type=str, default=None, metadata={"json": "name"})
    description = attr.ib(type=str, default=None, metadata={"json": "description"})
    member_user_count = attr.ib(
        type=int, default=None, metadata={"json": "member_user_count"}
    )
    member_department_count = attr.ib(
        type=int, default=None, metadata={"json": "member_department_count"}
    )


@to_json_decorator
@attr.s
class Memberlist:
    member_id = attr.ib(type=str, default=None, metadata={"json": "member_id"})
    member_type = attr.ib(type=str, default=None, metadata={"json": "member_type"})


@attr.s
class CustomAttrListResult:
    items = attr.ib(type=List[CustomAttr], default=None, metadata={"json": "items"})
    page_token = attr.ib(type=str, default=None, metadata={"json": "page_token"})
    has_more = attr.ib(type=bool, default=None, metadata={"json": "has_more"})


@attr.s
class DepartmentGetResult:
    department = attr.ib(type=Department, default=None, metadata={"json": "department"})


@attr.s
class DepartmentListResult:
    has_more = attr.ib(type=bool, default=None, metadata={"json": "has_more"})
    page_token = attr.ib(type=str, default=None, metadata={"json": "page_token"})
    items = attr.ib(type=List[Department], default=None, metadata={"json": "items"})


@attr.s
class DepartmentPatchResult:
    department = attr.ib(type=Department, default=None, metadata={"json": "department"})


@attr.s
class DepartmentCreateResult:
    department = attr.ib(type=Department, default=None, metadata={"json": "department"})


@attr.s
class DepartmentUpdateResult:
    department = attr.ib(type=Department, default=None, metadata={"json": "department"})


@attr.s
class DepartmentParentResult:
    has_more = attr.ib(type=bool, default=None, metadata={"json": "has_more"})
    page_token = attr.ib(type=str, default=None, metadata={"json": "page_token"})
    items = attr.ib(type=List[Department], default=None, metadata={"json": "items"})


@to_json_decorator
@attr.s
class DepartmentSearchReqBody:
    query = attr.ib(type=str, default=None, metadata={"json": "query"})


@attr.s
class DepartmentSearchResult:
    items = attr.ib(type=List[Department], default=None, metadata={"json": "items"})
    page_token = attr.ib(type=str, default=None, metadata={"json": "page_token"})
    has_more = attr.ib(type=bool, default=None, metadata={"json": "has_more"})


@attr.s
class EmployeeTypeEnumListResult:
    items = attr.ib(
        type=List[EmployeeTypeEnum], default=None, metadata={"json": "items"}
    )
    has_more = attr.ib(type=bool, default=None, metadata={"json": "has_more"})
    page_token = attr.ib(type=str, default=None, metadata={"json": "page_token"})


@attr.s
class EmployeeTypeEnumCreateResult:
    employee_type_enum = attr.ib(
        type=EmployeeTypeEnum, default=None, metadata={"json": "employee_type_enum"}
    )


@attr.s
class EmployeeTypeEnumUpdateResult:
    employee_type_enum = attr.ib(
        type=EmployeeTypeEnum, default=None, metadata={"json": "employee_type_enum"}
    )


@to_json_decorator
@attr.s
class GroupCreateReqBody:
    group_id = attr.ib(type=str, default=None, metadata={"json": "group_id"})
    name = attr.ib(type=str, default=None, metadata={"json": "name"})
    description = attr.ib(type=str, default=None, metadata={"json": "description"})
    type = attr.ib(type=int, default=None, metadata={"json": "type"})


@attr.s
class GroupCreateResult:
    group_id = attr.ib(type=str, default=None, metadata={"json": "group_id"})


@attr.s
class GroupSimplelistResult:
    grouplist = attr.ib(type=List[Group], default=None, metadata={"json": "grouplist"})
    page_token = attr.ib(type=str, default=None, metadata={"json": "page_token"})
    has_more = attr.ib(type=bool, default=None, metadata={"json": "has_more"})


@attr.s
class GroupGetResult:
    group = attr.ib(type=Group, default=None, metadata={"json": "group"})


@to_json_decorator
@attr.s
class GroupPatchReqBody:
    name = attr.ib(type=str, default=None, metadata={"json": "name"})
    description = attr.ib(type=str, default=None, metadata={"json": "description"})


@attr.s
class GroupMemberSimplelistResult:
    memberlist = attr.ib(
        type=List[Memberlist], default=None, metadata={"json": "memberlist"}
    )
    page_token = attr.ib(type=str, default=None, metadata={"json": "page_token"})
    has_more = attr.ib(type=bool, default=None, metadata={"json": "has_more"})


@to_json_decorator
@attr.s
class GroupMemberAddReqBody:
    member_type = attr.ib(type=str, default=None, metadata={"json": "member_type"})
    member_id_type = attr.ib(
        type=str, default=None, metadata={"json": "member_id_type"}
    )
    member_id = attr.ib(type=str, default=None, metadata={"json": "member_id"})


@to_json_decorator
@attr.s
class GroupMemberRemoveReqBody:
    member_type = attr.ib(type=str, default=None, metadata={"json": "member_type"})
    member_id = attr.ib(type=str, default=None, metadata={"json": "member_id"})
    member_id_type = attr.ib(
        type=str, default=None, metadata={"json": "member_id_type"}
    )


@to_json_decorator
@attr.s
class UserDeleteReqBody:
    department_chat_acceptor_user_id = attr.ib(
        type=str, default=None, metadata={"json": "department_chat_acceptor_user_id"}
    )
    external_chat_acceptor_user_id = attr.ib(
        type=str, default=None, metadata={"json": "external_chat_acceptor_user_id"}
    )
    docs_acceptor_user_id = attr.ib(
        type=str, default=None, metadata={"json": "docs_acceptor_user_id"}
    )
    calendar_acceptor_user_id = attr.ib(
        type=str, default=None, metadata={"json": "calendar_acceptor_user_id"}
    )
    application_acceptor_user_id = attr.ib(
        type=str, default=None, metadata={"json": "application_acceptor_user_id"}
    )
    helpdesk_acceptor_user_id = attr.ib(
        type=str, default=None, metadata={"json": "helpdesk_acceptor_user_id"}
    )


@attr.s
class UserUpdateResult:
    user = attr.ib(type=User, default=None, metadata={"json": "user"})


@attr.s
class UserCreateResult:
    user = attr.ib(type=User, default=None, metadata={"json": "user"})


@attr.s
class UserPatchResult:
    user = attr.ib(type=User, default=None, metadata={"json": "user"})


@attr.s
class UserGetResult:
    user = attr.ib(type=User, default=None, metadata={"json": "user"})


@attr.s
class UserListResult:
    has_more = attr.ib(type=bool, default=None, metadata={"json": "has_more"})
    page_token = attr.ib(type=str, default=None, metadata={"json": "page_token"})
    items = attr.ib(type=List[User], default=None, metadata={"json": "items"})


@attr.s
class DepartmentCreatedEventData:
    object = attr.ib(type=DepartmentEvent, default=None, metadata={"json": "object"})


@attr.s
class DepartmentCreatedEvent(BaseEventV2):
    event = attr.ib(type=DepartmentCreatedEventData, default=None)


@attr.s
class DepartmentDeletedEventData:
    object = attr.ib(type=DepartmentEvent, default=None, metadata={"json": "object"})
    old_object = attr.ib(
        type=OldDepartmentObject, default=None, metadata={"json": "old_object"}
    )


@attr.s
class DepartmentDeletedEvent(BaseEventV2):
    event = attr.ib(type=DepartmentDeletedEventData, default=None)


@attr.s
class DepartmentUpdatedEventData:
    object = attr.ib(type=DepartmentEvent, default=None, metadata={"json": "object"})
    old_object = attr.ib(
        type=DepartmentEvent, default=None, metadata={"json": "old_object"}
    )


@attr.s
class DepartmentUpdatedEvent(BaseEventV2):
    event = attr.ib(type=DepartmentUpdatedEventData, default=None)


@attr.s
class EmployeeTypeEnumActivedEventData:
    old_enum = attr.ib(
        type=EmployeeTypeEnum, default=None, metadata={"json": "old_enum"}
    )
    new_enum = attr.ib(
        type=EmployeeTypeEnum, default=None, metadata={"json": "new_enum"}
    )


@attr.s
class EmployeeTypeEnumActivedEvent(BaseEventV2):
    event = attr.ib(type=EmployeeTypeEnumActivedEventData, default=None)


@attr.s
class EmployeeTypeEnumCreatedEventData:
    new_enum = attr.ib(
        type=EmployeeTypeEnum, default=None, metadata={"json": "new_enum"}
    )


@attr.s
class EmployeeTypeEnumCreatedEvent(BaseEventV2):
    event = attr.ib(type=EmployeeTypeEnumCreatedEventData, default=None)


@attr.s
class EmployeeTypeEnumDeactivatedEventData:
    old_enum = attr.ib(
        type=EmployeeTypeEnum, default=None, metadata={"json": "old_enum"}
    )
    new_enum = attr.ib(
        type=EmployeeTypeEnum, default=None, metadata={"json": "new_enum"}
    )


@attr.s
class EmployeeTypeEnumDeactivatedEvent(BaseEventV2):
    event = attr.ib(type=EmployeeTypeEnumDeactivatedEventData, default=None)


@attr.s
class EmployeeTypeEnumDeletedEventData:
    old_enum = attr.ib(
        type=EmployeeTypeEnum, default=None, metadata={"json": "old_enum"}
    )


@attr.s
class EmployeeTypeEnumDeletedEvent(BaseEventV2):
    event = attr.ib(type=EmployeeTypeEnumDeletedEventData, default=None)


@attr.s
class EmployeeTypeEnumUpdatedEventData:
    old_enum = attr.ib(
        type=EmployeeTypeEnum, default=None, metadata={"json": "old_enum"}
    )
    new_enum = attr.ib(
        type=EmployeeTypeEnum, default=None, metadata={"json": "new_enum"}
    )


@attr.s
class EmployeeTypeEnumUpdatedEvent(BaseEventV2):
    event = attr.ib(type=EmployeeTypeEnumUpdatedEventData, default=None)


@attr.s
class ScopeUpdatedEventData:
    added = attr.ib(type=Scope, default=None, metadata={"json": "added"})
    removed = attr.ib(type=Scope, default=None, metadata={"json": "removed"})


@attr.s
class ScopeUpdatedEvent(BaseEventV2):
    event = attr.ib(type=ScopeUpdatedEventData, default=None)


@attr.s
class UserCreatedEventData:
    object = attr.ib(type=UserEvent, default=None, metadata={"json": "object"})


@attr.s
class UserCreatedEvent(BaseEventV2):
    event = attr.ib(type=UserCreatedEventData, default=None)


@attr.s
class UserDeletedEventData:
    object = attr.ib(type=UserEvent, default=None, metadata={"json": "object"})
    old_object = attr.ib(
        type=OldUserObject, default=None, metadata={"json": "old_object"}
    )


@attr.s
class UserDeletedEvent(BaseEventV2):
    event = attr.ib(type=UserDeletedEventData, default=None)


@attr.s
class UserUpdatedEventData:
    object = attr.ib(type=UserEvent, default=None, metadata={"json": "object"})
    old_object = attr.ib(type=UserEvent, default=None, metadata={"json": "old_object"})


@attr.s
class UserUpdatedEvent(BaseEventV2):
    event = attr.ib(type=UserUpdatedEventData, default=None)
