# Code generated by Lark OpenAPI.

from typing import Callable, Type

from lark_oapi.event.processor import IEventProcessor
from .model.p2_drive_file_bitable_field_changed_v1 import P2DriveFileBitableFieldChangedV1
from .model.p2_drive_file_deleted_v1 import P2DriveFileDeletedV1
from .model.p2_drive_file_edit_v1 import P2DriveFileEditV1
from .model.p2_drive_file_permission_member_added_v1 import P2DriveFilePermissionMemberAddedV1
from .model.p2_drive_file_permission_member_removed_v1 import P2DriveFilePermissionMemberRemovedV1
from .model.p2_drive_file_read_v1 import P2DriveFileReadV1
from .model.p2_drive_file_title_updated_v1 import P2DriveFileTitleUpdatedV1
from .model.p2_drive_file_trashed_v1 import P2DriveFileTrashedV1


class P2DriveFileBitableFieldChangedV1Processor(IEventProcessor[P2DriveFileBitableFieldChangedV1]):
    def __init__(self, f: Callable[[P2DriveFileBitableFieldChangedV1], None]):
        self.f = f

    def type(self) -> Type[P2DriveFileBitableFieldChangedV1]:
        return P2DriveFileBitableFieldChangedV1

    def do(self, data: P2DriveFileBitableFieldChangedV1) -> None:
        self.f(data)


class P2DriveFileDeletedV1Processor(IEventProcessor[P2DriveFileDeletedV1]):
    def __init__(self, f: Callable[[P2DriveFileDeletedV1], None]):
        self.f = f

    def type(self) -> Type[P2DriveFileDeletedV1]:
        return P2DriveFileDeletedV1

    def do(self, data: P2DriveFileDeletedV1) -> None:
        self.f(data)


class P2DriveFileEditV1Processor(IEventProcessor[P2DriveFileEditV1]):
    def __init__(self, f: Callable[[P2DriveFileEditV1], None]):
        self.f = f

    def type(self) -> Type[P2DriveFileEditV1]:
        return P2DriveFileEditV1

    def do(self, data: P2DriveFileEditV1) -> None:
        self.f(data)


class P2DriveFilePermissionMemberAddedV1Processor(IEventProcessor[P2DriveFilePermissionMemberAddedV1]):
    def __init__(self, f: Callable[[P2DriveFilePermissionMemberAddedV1], None]):
        self.f = f

    def type(self) -> Type[P2DriveFilePermissionMemberAddedV1]:
        return P2DriveFilePermissionMemberAddedV1

    def do(self, data: P2DriveFilePermissionMemberAddedV1) -> None:
        self.f(data)


class P2DriveFilePermissionMemberRemovedV1Processor(IEventProcessor[P2DriveFilePermissionMemberRemovedV1]):
    def __init__(self, f: Callable[[P2DriveFilePermissionMemberRemovedV1], None]):
        self.f = f

    def type(self) -> Type[P2DriveFilePermissionMemberRemovedV1]:
        return P2DriveFilePermissionMemberRemovedV1

    def do(self, data: P2DriveFilePermissionMemberRemovedV1) -> None:
        self.f(data)


class P2DriveFileReadV1Processor(IEventProcessor[P2DriveFileReadV1]):
    def __init__(self, f: Callable[[P2DriveFileReadV1], None]):
        self.f = f

    def type(self) -> Type[P2DriveFileReadV1]:
        return P2DriveFileReadV1

    def do(self, data: P2DriveFileReadV1) -> None:
        self.f(data)


class P2DriveFileTitleUpdatedV1Processor(IEventProcessor[P2DriveFileTitleUpdatedV1]):
    def __init__(self, f: Callable[[P2DriveFileTitleUpdatedV1], None]):
        self.f = f

    def type(self) -> Type[P2DriveFileTitleUpdatedV1]:
        return P2DriveFileTitleUpdatedV1

    def do(self, data: P2DriveFileTitleUpdatedV1) -> None:
        self.f(data)


class P2DriveFileTrashedV1Processor(IEventProcessor[P2DriveFileTrashedV1]):
    def __init__(self, f: Callable[[P2DriveFileTrashedV1], None]):
        self.f = f

    def type(self) -> Type[P2DriveFileTrashedV1]:
        return P2DriveFileTrashedV1

    def do(self, data: P2DriveFileTrashedV1) -> None:
        self.f(data)
