# Generated by the protocol buffer compiler.  DO NOT EDIT!
# sources: shared/sp_shared.proto
# plugin: python-betterproto
# This file has been @generated
import builtins
from dataclasses import dataclass
from typing import Optional

import betterproto


class KvAction(betterproto.Enum):
    """
    KVAction is a shared type that is used for protos.KVCommand and
    protos.KVStep. Note that only a subset of actions are used for
    protos.KVCommand (CREATE, UPDATE, DELETE, DELETE_ALL) while protos.KVStep
    uses most of them. protolint:disable:next ENUM_FIELD_NAMES_PREFIX
    """

    KV_ACTION_UNSET = 0
    KV_ACTION_GET = 1
    KV_ACTION_CREATE = 2
    KV_ACTION_UPDATE = 3
    KV_ACTION_EXISTS = 4
    KV_ACTION_DELETE = 5
    KV_ACTION_DELETE_ALL = 6


@dataclass(eq=False, repr=False)
class WasmModule(betterproto.Message):
    """
    Main type representing a wasm module entry. Used by server for
    external.*Wasm() methods; also used to ensure we only send the wasm module
    once per request instead of duplicated in every pipeline where it is used.
    This prevents over-sized payloads on SDK startup.
    """

    id: str = betterproto.string_field(1)
    """
    ID is uuid(sha256(_wasm_bytes)) and is used for referencing the Wasm module
    """

    bytes: builtins.bytes = betterproto.bytes_field(2)
    """Contents of the Wasm module"""

    function: str = betterproto.string_field(3)
    """Entry point function name"""

    name: str = betterproto.string_field(4)
    """Friendly name for the Wasm module"""

    filename: str = betterproto.string_field(5)
    """Filename of the Wasm module (used only for bundled wasm)"""

    bundled: bool = betterproto.bool_field(6)
    """
    Indicates whether this wasm entry is for bundled wasm or for wasm added via
    CreateWasm(); ignored in CreateWasm() and UpdateWasm().
    """

    description: Optional[str] = betterproto.string_field(
        101, optional=True, group="_description"
    )
    """Informative, debug fields"""

    version: Optional[str] = betterproto.string_field(
        102, optional=True, group="_version"
    )
    url: Optional[str] = betterproto.string_field(103, optional=True, group="_url")
    created_at_unix_ts_ns_utc: Optional[int] = betterproto.int64_field(
        1000, optional=True, group="X_created_at_unix_ts_ns_utc"
    )
    """Set by server"""

    updated_at_unix_ts_ns_utc: Optional[int] = betterproto.int64_field(
        1001, optional=True, group="X_updated_at_unix_ts_ns_utc"
    )
    """Set by server"""
