# Generated by the protocol buffer compiler.  DO NOT EDIT!
# sources: org/apache/texera/amber/core/executor.proto, org/apache/texera/amber/core/virtualidentity.proto, org/apache/texera/amber/core/workflow.proto, org/apache/texera/amber/core/workflowruntimestate.proto
# plugin: python-betterproto
# This file has been @generated

from dataclasses import dataclass
from datetime import datetime
from typing import (
    List,
)

import betterproto


class OutputPortOutputMode(betterproto.Enum):
    SET_SNAPSHOT = 0
    """outputs complete result set snapshot for each update"""

    SET_DELTA = 1
    """outputs incremental result set delta for each update"""

    SINGLE_SNAPSHOT = 2
    """
    outputs a single snapshot for the entire execution,
     used explicitly to support visualization operators that may exceed the memory limit
     TODO: remove this mode after we have a better solution for output size limit
    """


class FatalErrorType(betterproto.Enum):
    COMPILATION_ERROR = 0
    EXECUTION_FAILURE = 1


@dataclass(eq=False, repr=False)
class WorkflowIdentity(betterproto.Message):
    id: int = betterproto.int64_field(1)


@dataclass(eq=False, repr=False)
class ExecutionIdentity(betterproto.Message):
    id: int = betterproto.int64_field(1)


@dataclass(eq=False, repr=False)
class ActorVirtualIdentity(betterproto.Message):
    name: str = betterproto.string_field(1)


@dataclass(eq=False, repr=False)
class ChannelIdentity(betterproto.Message):
    from_worker_id: "ActorVirtualIdentity" = betterproto.message_field(1)
    to_worker_id: "ActorVirtualIdentity" = betterproto.message_field(2)
    is_control: bool = betterproto.bool_field(3)


@dataclass(eq=False, repr=False)
class OperatorIdentity(betterproto.Message):
    id: str = betterproto.string_field(1)


@dataclass(eq=False, repr=False)
class PhysicalOpIdentity(betterproto.Message):
    logical_op_id: "OperatorIdentity" = betterproto.message_field(1)
    layer_name: str = betterproto.string_field(2)


@dataclass(eq=False, repr=False)
class EmbeddedControlMessageIdentity(betterproto.Message):
    id: str = betterproto.string_field(1)


@dataclass(eq=False, repr=False)
class PortIdentity(betterproto.Message):
    id: int = betterproto.int32_field(1)
    internal: bool = betterproto.bool_field(2)


@dataclass(eq=False, repr=False)
class GlobalPortIdentity(betterproto.Message):
    op_id: "PhysicalOpIdentity" = betterproto.message_field(1)
    port_id: "PortIdentity" = betterproto.message_field(2)
    input: bool = betterproto.bool_field(3)


@dataclass(eq=False, repr=False)
class InputPort(betterproto.Message):
    id: "PortIdentity" = betterproto.message_field(1)
    display_name: str = betterproto.string_field(2)
    disallow_multi_links: bool = betterproto.bool_field(3)
    dependencies: List["PortIdentity"] = betterproto.message_field(4)


@dataclass(eq=False, repr=False)
class OutputPort(betterproto.Message):
    id: "PortIdentity" = betterproto.message_field(1)
    display_name: str = betterproto.string_field(2)
    blocking: bool = betterproto.bool_field(3)
    mode: "OutputPortOutputMode" = betterproto.enum_field(4)


@dataclass(eq=False, repr=False)
class PhysicalLink(betterproto.Message):
    from_op_id: "PhysicalOpIdentity" = betterproto.message_field(1)
    from_port_id: "PortIdentity" = betterproto.message_field(2)
    to_op_id: "PhysicalOpIdentity" = betterproto.message_field(3)
    to_port_id: "PortIdentity" = betterproto.message_field(4)


@dataclass(eq=False, repr=False)
class OpExecWithCode(betterproto.Message):
    code: str = betterproto.string_field(1)
    language: str = betterproto.string_field(2)


@dataclass(eq=False, repr=False)
class OpExecWithClassName(betterproto.Message):
    class_name: str = betterproto.string_field(1)
    desc_string: str = betterproto.string_field(2)


@dataclass(eq=False, repr=False)
class OpExecSource(betterproto.Message):
    storage_key: str = betterproto.string_field(1)
    workflow_identity: "WorkflowIdentity" = betterproto.message_field(2)


@dataclass(eq=False, repr=False)
class OpExecInitInfo(betterproto.Message):
    op_exec_with_class_name: "OpExecWithClassName" = betterproto.message_field(
        1, group="sealed_value"
    )
    op_exec_with_code: "OpExecWithCode" = betterproto.message_field(
        2, group="sealed_value"
    )
    op_exec_source: "OpExecSource" = betterproto.message_field(3, group="sealed_value")


@dataclass(eq=False, repr=False)
class WorkflowFatalError(betterproto.Message):
    type: "FatalErrorType" = betterproto.enum_field(1)
    timestamp: datetime = betterproto.message_field(2)
    message: str = betterproto.string_field(3)
    details: str = betterproto.string_field(4)
    operator_id: str = betterproto.string_field(5)
    worker_id: str = betterproto.string_field(6)
