# Generated by the protocol buffer compiler.  DO NOT EDIT!
# sources: protobunny/results.proto
# plugin: python-betterproto
# This file has been @generated

from dataclasses import dataclass
from typing import Optional

import betterproto
import betterproto.lib.google.protobuf as betterproto_lib_google_protobuf

from protobunny import models as models

from .. import commons as _commons__


class ReturnCode(betterproto.Enum):
    MSG_FAILURE = 0
    FAILURE = 1
    IN_PROGRESS = 2
    SUCCESS = 3
    PENDING = 4


@dataclass(eq=False, repr=False)
class Result(models.ProtoBunnyMessage):
    source_message: "betterproto_lib_google_protobuf.Any" = betterproto.message_field(1)
    """
    * The source message. It is transparently deserialized by the `source` property
    ex.
    >>> msg = ml.mypackage.MyMessage(content="test")
    >>> result = msg.make_result()
    >>> assert msg == result.source
    """

    return_code: "ReturnCode" = betterproto.enum_field(2)
    error: Optional[str] = betterproto.string_field(3, optional=True)
    return_value: Optional["_commons__.JsonContent | dict"] = betterproto.message_field(
        4, optional=True
    )
