"""
@generated by mypy-protobuf.  Do not edit manually!
isort:skip_file
"""
import builtins
import flyteidl.core.execution_pb2
import google.protobuf.descriptor
import google.protobuf.internal.enum_type_wrapper
import google.protobuf.message
import typing
import typing_extensions

DESCRIPTOR: google.protobuf.descriptor.FileDescriptor = ...

class ContainerError(google.protobuf.message.Message):
    """Error message to propagate detailed errors from container executions to the execution
    engine.
    """
    DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
    class Kind(_Kind, metaclass=_KindEnumTypeWrapper):
        """Defines a generic error type that dictates the behavior of the retry strategy."""
        pass
    class _Kind:
        V = typing.NewType('V', builtins.int)
    class _KindEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_Kind.V], builtins.type):
        DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor = ...
        NON_RECOVERABLE = ContainerError.Kind.V(0)
        RECOVERABLE = ContainerError.Kind.V(1)

    NON_RECOVERABLE = ContainerError.Kind.V(0)
    RECOVERABLE = ContainerError.Kind.V(1)

    CODE_FIELD_NUMBER: builtins.int
    MESSAGE_FIELD_NUMBER: builtins.int
    KIND_FIELD_NUMBER: builtins.int
    ORIGIN_FIELD_NUMBER: builtins.int
    code: typing.Text = ...
    """A simplified code for errors, so that we can provide a glossary of all possible errors."""

    message: typing.Text = ...
    """A detailed error message."""

    kind: global___ContainerError.Kind.V = ...
    """An abstract error kind for this error. Defaults to Non_Recoverable if not specified."""

    origin: flyteidl.core.execution_pb2.ExecutionError.ErrorKind.V = ...
    """Defines the origin of the error (system, user, unknown)."""

    def __init__(self,
        *,
        code : typing.Text = ...,
        message : typing.Text = ...,
        kind : global___ContainerError.Kind.V = ...,
        origin : flyteidl.core.execution_pb2.ExecutionError.ErrorKind.V = ...,
        ) -> None: ...
    def ClearField(self, field_name: typing_extensions.Literal[u"code",b"code",u"kind",b"kind",u"message",b"message",u"origin",b"origin"]) -> None: ...
global___ContainerError = ContainerError

class ErrorDocument(google.protobuf.message.Message):
    """Defines the errors.pb file format the container can produce to communicate
    failure reasons to the execution engine.
    """
    DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
    ERROR_FIELD_NUMBER: builtins.int
    @property
    def error(self) -> global___ContainerError:
        """The error raised during execution."""
        pass
    def __init__(self,
        *,
        error : typing.Optional[global___ContainerError] = ...,
        ) -> None: ...
    def HasField(self, field_name: typing_extensions.Literal[u"error",b"error"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing_extensions.Literal[u"error",b"error"]) -> None: ...
global___ErrorDocument = ErrorDocument
