// This file is @generated by prost-build.
/// Parameter definition
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Param {
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub description: ::prost::alloc::string::String,
    #[prost(enumeration = "param::DataType", tag = "3")]
    pub data_type: i32,
    /// Default value using Any to support multiple types
    #[prost(message, optional, tag = "4")]
    pub default_value: ::core::option::Option<::prost_types::Any>,
    #[prost(bool, tag = "5")]
    pub required: bool,
    #[prost(string, optional, tag = "6")]
    pub class_name: ::core::option::Option<::prost::alloc::string::String>,
    /// Nested parameters for complex types
    #[prost(map = "string, message", tag = "7")]
    pub nested_fields: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        Param,
    >,
}
/// Nested message and enum types in `Param`.
pub mod param {
    /// Data type enumeration
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum DataType {
        Unspecified = 0,
        String = 1,
        Integer = 2,
        Float = 3,
        Boolean = 4,
        Array = 5,
        Object = 6,
        Datetime = 7,
        Duration = 8,
    }
    impl DataType {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::Unspecified => "DATA_TYPE_UNSPECIFIED",
                Self::String => "DATA_TYPE_STRING",
                Self::Integer => "DATA_TYPE_INTEGER",
                Self::Float => "DATA_TYPE_FLOAT",
                Self::Boolean => "DATA_TYPE_BOOLEAN",
                Self::Array => "DATA_TYPE_ARRAY",
                Self::Object => "DATA_TYPE_OBJECT",
                Self::Datetime => "DATA_TYPE_DATETIME",
                Self::Duration => "DATA_TYPE_DURATION",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "DATA_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
                "DATA_TYPE_STRING" => Some(Self::String),
                "DATA_TYPE_INTEGER" => Some(Self::Integer),
                "DATA_TYPE_FLOAT" => Some(Self::Float),
                "DATA_TYPE_BOOLEAN" => Some(Self::Boolean),
                "DATA_TYPE_ARRAY" => Some(Self::Array),
                "DATA_TYPE_OBJECT" => Some(Self::Object),
                "DATA_TYPE_DATETIME" => Some(Self::Datetime),
                "DATA_TYPE_DURATION" => Some(Self::Duration),
                _ => None,
            }
        }
    }
}
/// Schedule configuration
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Schedule {
    #[prost(oneof = "schedule::ScheduleConfig", tags = "1, 2")]
    pub schedule_config: ::core::option::Option<schedule::ScheduleConfig>,
}
/// Nested message and enum types in `Schedule`.
pub mod schedule {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum ScheduleConfig {
        #[prost(string, tag = "1")]
        CronExpression(::prost::alloc::string::String),
        #[prost(message, tag = "2")]
        Interval(::prost_types::Duration),
    }
}
/// Main workflow configuration
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkflowConfig {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub name: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub slug: ::prost::alloc::string::String,
    #[prost(string, optional, tag = "4")]
    pub description: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(map = "string, message", tag = "5")]
    pub input_parameters: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        Param,
    >,
    #[prost(message, repeated, tag = "6")]
    pub output_parameters: ::prost::alloc::vec::Vec<Param>,
    #[prost(message, optional, tag = "7")]
    pub schedule: ::core::option::Option<Schedule>,
    #[prost(string, tag = "8")]
    pub version: ::prost::alloc::string::String,
    #[prost(map = "string, string", tag = "9")]
    pub metadata: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    #[prost(bool, tag = "10")]
    pub async_fn: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListWorkflowsRequest {
    #[prost(string, tag = "1")]
    pub deployment_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListWorkflowsResponse {
    #[prost(message, repeated, tag = "1")]
    pub workflows: ::prost::alloc::vec::Vec<WorkflowConfig>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct InboundClientMessage {}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct OutboundClientMessage {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AgentifyMeError {
    #[prost(string, tag = "1")]
    pub message: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub error_code: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub category: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub severity: ::prost::alloc::string::String,
    #[prost(string, tag = "5")]
    pub traceback: ::prost::alloc::string::String,
    #[prost(string, tag = "6")]
    pub error_type: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkflowExecutionResult {
    #[prost(string, tag = "4")]
    pub run_id: ::prost::alloc::string::String,
    #[prost(oneof = "workflow_execution_result::Result", tags = "1, 2, 3")]
    pub result: ::core::option::Option<workflow_execution_result::Result>,
}
/// Nested message and enum types in `WorkflowExecutionResult`.
pub mod workflow_execution_result {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Result {
        #[prost(message, tag = "1")]
        Data(::prost_types::Value),
        #[prost(message, tag = "2")]
        Error(super::AgentifyMeError),
        #[prost(enumeration = "super::WorkflowExecutionStatus", tag = "3")]
        Status(i32),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkflowExecutionError {
    #[prost(string, tag = "1")]
    pub message: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub error_code: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub category: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub severity: ::prost::alloc::string::String,
    #[prost(string, tag = "5")]
    pub traceback: ::prost::alloc::string::String,
    #[prost(string, tag = "6")]
    pub error_type: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MessageAck {
    #[prost(string, tag = "1")]
    pub msg_id: ::prost::alloc::string::String,
    #[prost(bool, tag = "2")]
    pub success: bool,
    #[prost(string, tag = "3")]
    pub error: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LivenessCheckRequest {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct LivenessCheckResponse {
    #[prost(bool, tag = "1")]
    pub success: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReadinessCheckRequest {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ReadinessCheckResponse {
    #[prost(bool, tag = "1")]
    pub success: bool,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct PaginationMeta {
    #[prost(bool, tag = "1")]
    pub has_next: bool,
    #[prost(bool, tag = "2")]
    pub has_prev: bool,
    #[prost(int64, tag = "3")]
    pub count: i64,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum WorkflowExecutionStatus {
    Unspecified = 0,
    Waiting = 1,
    Running = 2,
    Succeeded = 3,
    Failed = 4,
    Retrying = 5,
    Cancelled = 6,
    TimedOut = 7,
    Paused = 8,
}
impl WorkflowExecutionStatus {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "WORKFLOW_EXECUTION_STATUS_UNSPECIFIED",
            Self::Waiting => "WORKFLOW_EXECUTION_STATUS_WAITING",
            Self::Running => "WORKFLOW_EXECUTION_STATUS_RUNNING",
            Self::Succeeded => "WORKFLOW_EXECUTION_STATUS_SUCCEEDED",
            Self::Failed => "WORKFLOW_EXECUTION_STATUS_FAILED",
            Self::Retrying => "WORKFLOW_EXECUTION_STATUS_RETRYING",
            Self::Cancelled => "WORKFLOW_EXECUTION_STATUS_CANCELLED",
            Self::TimedOut => "WORKFLOW_EXECUTION_STATUS_TIMED_OUT",
            Self::Paused => "WORKFLOW_EXECUTION_STATUS_PAUSED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "WORKFLOW_EXECUTION_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
            "WORKFLOW_EXECUTION_STATUS_WAITING" => Some(Self::Waiting),
            "WORKFLOW_EXECUTION_STATUS_RUNNING" => Some(Self::Running),
            "WORKFLOW_EXECUTION_STATUS_SUCCEEDED" => Some(Self::Succeeded),
            "WORKFLOW_EXECUTION_STATUS_FAILED" => Some(Self::Failed),
            "WORKFLOW_EXECUTION_STATUS_RETRYING" => Some(Self::Retrying),
            "WORKFLOW_EXECUTION_STATUS_CANCELLED" => Some(Self::Cancelled),
            "WORKFLOW_EXECUTION_STATUS_TIMED_OUT" => Some(Self::TimedOut),
            "WORKFLOW_EXECUTION_STATUS_PAUSED" => Some(Self::Paused),
            _ => None,
        }
    }
}
/// Client invocation messages
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InvokeFunctionRequest {
    #[prost(string, tag = "1")]
    pub service_name: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub handler_name: ::prost::alloc::string::String,
    #[prost(bytes = "vec", tag = "3")]
    pub input_data: ::prost::alloc::vec::Vec<u8>,
    #[prost(map = "string, string", tag = "4")]
    pub metadata: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    /// If true, return invocation_id immediately
    #[prost(bool, tag = "5")]
    pub r#async: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InvokeFunctionResponse {
    #[prost(string, tag = "1")]
    pub invocation_id: ::prost::alloc::string::String,
    #[prost(bytes = "vec", tag = "2")]
    pub output_data: ::prost::alloc::vec::Vec<u8>,
    #[prost(bool, tag = "3")]
    pub completed: bool,
    #[prost(string, tag = "4")]
    pub error: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InvokeWorkflowRequest {
    #[prost(string, tag = "1")]
    pub workflow_name: ::prost::alloc::string::String,
    #[prost(bytes = "vec", tag = "2")]
    pub input_data: ::prost::alloc::vec::Vec<u8>,
    #[prost(map = "string, string", tag = "3")]
    pub metadata: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    #[prost(bool, tag = "4")]
    pub r#async: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InvokeWorkflowResponse {
    #[prost(string, tag = "1")]
    pub invocation_id: ::prost::alloc::string::String,
    #[prost(bytes = "vec", tag = "2")]
    pub output_data: ::prost::alloc::vec::Vec<u8>,
    #[prost(bool, tag = "3")]
    pub completed: bool,
    #[prost(string, tag = "4")]
    pub error: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InvokeObjectRequest {
    #[prost(string, tag = "1")]
    pub object_type: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub key: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub handler_name: ::prost::alloc::string::String,
    #[prost(bytes = "vec", tag = "4")]
    pub input_data: ::prost::alloc::vec::Vec<u8>,
    #[prost(map = "string, string", tag = "5")]
    pub metadata: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    #[prost(bool, tag = "6")]
    pub r#async: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InvokeObjectResponse {
    #[prost(string, tag = "1")]
    pub invocation_id: ::prost::alloc::string::String,
    #[prost(bytes = "vec", tag = "2")]
    pub output_data: ::prost::alloc::vec::Vec<u8>,
    #[prost(bool, tag = "3")]
    pub completed: bool,
    #[prost(string, tag = "4")]
    pub error: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetInvocationStatusRequest {
    #[prost(string, tag = "1")]
    pub invocation_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetInvocationStatusResponse {
    #[prost(string, tag = "1")]
    pub invocation_id: ::prost::alloc::string::String,
    #[prost(enumeration = "InvocationStatus", tag = "2")]
    pub status: i32,
    #[prost(bytes = "vec", tag = "3")]
    pub output_data: ::prost::alloc::vec::Vec<u8>,
    #[prost(string, tag = "4")]
    pub error: ::prost::alloc::string::String,
    #[prost(int64, tag = "5")]
    pub created_at: i64,
    #[prost(int64, tag = "6")]
    pub completed_at: i64,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum InvocationStatus {
    Unspecified = 0,
    Pending = 1,
    Running = 2,
    Completed = 3,
    Failed = 4,
    Suspended = 5,
}
impl InvocationStatus {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "INVOCATION_STATUS_UNSPECIFIED",
            Self::Pending => "INVOCATION_STATUS_PENDING",
            Self::Running => "INVOCATION_STATUS_RUNNING",
            Self::Completed => "INVOCATION_STATUS_COMPLETED",
            Self::Failed => "INVOCATION_STATUS_FAILED",
            Self::Suspended => "INVOCATION_STATUS_SUSPENDED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "INVOCATION_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
            "INVOCATION_STATUS_PENDING" => Some(Self::Pending),
            "INVOCATION_STATUS_RUNNING" => Some(Self::Running),
            "INVOCATION_STATUS_COMPLETED" => Some(Self::Completed),
            "INVOCATION_STATUS_FAILED" => Some(Self::Failed),
            "INVOCATION_STATUS_SUSPENDED" => Some(Self::Suspended),
            _ => None,
        }
    }
}
/// Generated client implementations.
pub mod gateway_service_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// GatewayService defines the external-facing API for client requests
    #[derive(Debug, Clone)]
    pub struct GatewayServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl GatewayServiceClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> GatewayServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::Body>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> GatewayServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::Body>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::Body>,
            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            GatewayServiceClient::new(InterceptedService::new(inner, interceptor))
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// Client invocation endpoints
        pub async fn invoke_function(
            &mut self,
            request: impl tonic::IntoRequest<super::InvokeFunctionRequest>,
        ) -> std::result::Result<
            tonic::Response<super::InvokeFunctionResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/api.v1.GatewayService/InvokeFunction",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("api.v1.GatewayService", "InvokeFunction"));
            self.inner.unary(req, path, codec).await
        }
        pub async fn invoke_workflow(
            &mut self,
            request: impl tonic::IntoRequest<super::InvokeWorkflowRequest>,
        ) -> std::result::Result<
            tonic::Response<super::InvokeWorkflowResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/api.v1.GatewayService/InvokeWorkflow",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("api.v1.GatewayService", "InvokeWorkflow"));
            self.inner.unary(req, path, codec).await
        }
        pub async fn invoke_object(
            &mut self,
            request: impl tonic::IntoRequest<super::InvokeObjectRequest>,
        ) -> std::result::Result<
            tonic::Response<super::InvokeObjectResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/api.v1.GatewayService/InvokeObject",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("api.v1.GatewayService", "InvokeObject"));
            self.inner.unary(req, path, codec).await
        }
        pub async fn get_invocation_status(
            &mut self,
            request: impl tonic::IntoRequest<super::GetInvocationStatusRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GetInvocationStatusResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/api.v1.GatewayService/GetInvocationStatus",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("api.v1.GatewayService", "GetInvocationStatus"));
            self.inner.unary(req, path, codec).await
        }
    }
}
/// Generated server implementations.
pub mod gateway_service_server {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    /// Generated trait containing gRPC methods that should be implemented for use with GatewayServiceServer.
    #[async_trait]
    pub trait GatewayService: std::marker::Send + std::marker::Sync + 'static {
        /// Client invocation endpoints
        async fn invoke_function(
            &self,
            request: tonic::Request<super::InvokeFunctionRequest>,
        ) -> std::result::Result<
            tonic::Response<super::InvokeFunctionResponse>,
            tonic::Status,
        >;
        async fn invoke_workflow(
            &self,
            request: tonic::Request<super::InvokeWorkflowRequest>,
        ) -> std::result::Result<
            tonic::Response<super::InvokeWorkflowResponse>,
            tonic::Status,
        >;
        async fn invoke_object(
            &self,
            request: tonic::Request<super::InvokeObjectRequest>,
        ) -> std::result::Result<
            tonic::Response<super::InvokeObjectResponse>,
            tonic::Status,
        >;
        async fn get_invocation_status(
            &self,
            request: tonic::Request<super::GetInvocationStatusRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GetInvocationStatusResponse>,
            tonic::Status,
        >;
    }
    /// GatewayService defines the external-facing API for client requests
    #[derive(Debug)]
    pub struct GatewayServiceServer<T> {
        inner: Arc<T>,
        accept_compression_encodings: EnabledCompressionEncodings,
        send_compression_encodings: EnabledCompressionEncodings,
        max_decoding_message_size: Option<usize>,
        max_encoding_message_size: Option<usize>,
    }
    impl<T> GatewayServiceServer<T> {
        pub fn new(inner: T) -> Self {
            Self::from_arc(Arc::new(inner))
        }
        pub fn from_arc(inner: Arc<T>) -> Self {
            Self {
                inner,
                accept_compression_encodings: Default::default(),
                send_compression_encodings: Default::default(),
                max_decoding_message_size: None,
                max_encoding_message_size: None,
            }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> InterceptedService<Self, F>
        where
            F: tonic::service::Interceptor,
        {
            InterceptedService::new(Self::new(inner), interceptor)
        }
        /// Enable decompressing requests with the given encoding.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.accept_compression_encodings.enable(encoding);
            self
        }
        /// Compress responses with the given encoding, if the client supports it.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.send_compression_encodings.enable(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.max_decoding_message_size = Some(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.max_encoding_message_size = Some(limit);
            self
        }
    }
    impl<T, B> tonic::codegen::Service<http::Request<B>> for GatewayServiceServer<T>
    where
        T: GatewayService,
        B: Body + std::marker::Send + 'static,
        B::Error: Into<StdError> + std::marker::Send + 'static,
    {
        type Response = http::Response<tonic::body::Body>;
        type Error = std::convert::Infallible;
        type Future = BoxFuture<Self::Response, Self::Error>;
        fn poll_ready(
            &mut self,
            _cx: &mut Context<'_>,
        ) -> Poll<std::result::Result<(), Self::Error>> {
            Poll::Ready(Ok(()))
        }
        fn call(&mut self, req: http::Request<B>) -> Self::Future {
            match req.uri().path() {
                "/api.v1.GatewayService/InvokeFunction" => {
                    #[allow(non_camel_case_types)]
                    struct InvokeFunctionSvc<T: GatewayService>(pub Arc<T>);
                    impl<
                        T: GatewayService,
                    > tonic::server::UnaryService<super::InvokeFunctionRequest>
                    for InvokeFunctionSvc<T> {
                        type Response = super::InvokeFunctionResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::InvokeFunctionRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as GatewayService>::invoke_function(&inner, request)
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = InvokeFunctionSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/api.v1.GatewayService/InvokeWorkflow" => {
                    #[allow(non_camel_case_types)]
                    struct InvokeWorkflowSvc<T: GatewayService>(pub Arc<T>);
                    impl<
                        T: GatewayService,
                    > tonic::server::UnaryService<super::InvokeWorkflowRequest>
                    for InvokeWorkflowSvc<T> {
                        type Response = super::InvokeWorkflowResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::InvokeWorkflowRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as GatewayService>::invoke_workflow(&inner, request)
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = InvokeWorkflowSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/api.v1.GatewayService/InvokeObject" => {
                    #[allow(non_camel_case_types)]
                    struct InvokeObjectSvc<T: GatewayService>(pub Arc<T>);
                    impl<
                        T: GatewayService,
                    > tonic::server::UnaryService<super::InvokeObjectRequest>
                    for InvokeObjectSvc<T> {
                        type Response = super::InvokeObjectResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::InvokeObjectRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as GatewayService>::invoke_object(&inner, request).await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = InvokeObjectSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/api.v1.GatewayService/GetInvocationStatus" => {
                    #[allow(non_camel_case_types)]
                    struct GetInvocationStatusSvc<T: GatewayService>(pub Arc<T>);
                    impl<
                        T: GatewayService,
                    > tonic::server::UnaryService<super::GetInvocationStatusRequest>
                    for GetInvocationStatusSvc<T> {
                        type Response = super::GetInvocationStatusResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::GetInvocationStatusRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as GatewayService>::get_invocation_status(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = GetInvocationStatusSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                _ => {
                    Box::pin(async move {
                        let mut response = http::Response::new(
                            tonic::body::Body::default(),
                        );
                        let headers = response.headers_mut();
                        headers
                            .insert(
                                tonic::Status::GRPC_STATUS,
                                (tonic::Code::Unimplemented as i32).into(),
                            );
                        headers
                            .insert(
                                http::header::CONTENT_TYPE,
                                tonic::metadata::GRPC_CONTENT_TYPE,
                            );
                        Ok(response)
                    })
                }
            }
        }
    }
    impl<T> Clone for GatewayServiceServer<T> {
        fn clone(&self) -> Self {
            let inner = self.inner.clone();
            Self {
                inner,
                accept_compression_encodings: self.accept_compression_encodings,
                send_compression_encodings: self.send_compression_encodings,
                max_decoding_message_size: self.max_decoding_message_size,
                max_encoding_message_size: self.max_encoding_message_size,
            }
        }
    }
    /// Generated gRPC service name
    pub const SERVICE_NAME: &str = "api.v1.GatewayService";
    impl<T> tonic::server::NamedService for GatewayServiceServer<T> {
        const NAME: &'static str = SERVICE_NAME;
    }
}
/// Messages sent from Runtime to User Service
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RuntimeMessage {
    #[prost(string, tag = "1")]
    pub invocation_id: ::prost::alloc::string::String,
    #[prost(oneof = "runtime_message::MessageType", tags = "2, 3, 4, 5, 6, 7")]
    pub message_type: ::core::option::Option<runtime_message::MessageType>,
}
/// Nested message and enum types in `RuntimeMessage`.
pub mod runtime_message {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum MessageType {
        #[prost(message, tag = "2")]
        ServiceRegistrationResponse(super::ServiceRegistrationResponse),
        #[prost(message, tag = "3")]
        ServiceUnregistrationResponse(super::ServiceUnregistrationResponse),
        #[prost(message, tag = "4")]
        Start(super::InvocationStart),
        #[prost(message, tag = "5")]
        JournalEntry(super::JournalEntry),
        #[prost(message, tag = "6")]
        Complete(super::InvocationComplete),
        #[prost(message, tag = "7")]
        SuspensionComplete(super::SuspensionComplete),
    }
}
/// Messages sent from User Service to Runtime
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ServiceMessage {
    #[prost(string, tag = "1")]
    pub invocation_id: ::prost::alloc::string::String,
    #[prost(oneof = "service_message::MessageType", tags = "2, 3, 4, 5, 6, 7, 8, 9")]
    pub message_type: ::core::option::Option<service_message::MessageType>,
}
/// Nested message and enum types in `ServiceMessage`.
pub mod service_message {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum MessageType {
        #[prost(message, tag = "2")]
        ServiceRegistration(super::ServiceRegistration),
        #[prost(message, tag = "3")]
        ServiceUnregistration(super::ServiceUnregistration),
        #[prost(message, tag = "4")]
        Response(super::InvocationResponse),
        #[prost(message, tag = "5")]
        StateOp(super::StateOperation),
        #[prost(message, tag = "6")]
        ServiceCall(super::ServiceCall),
        #[prost(message, tag = "7")]
        AwaitPromise(super::AwaitPromise),
        #[prost(message, tag = "8")]
        SleepRequest(super::SleepRequest),
        #[prost(message, tag = "9")]
        Error(super::InvocationError),
    }
}
/// Invocation lifecycle messages
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InvocationStart {
    #[prost(string, tag = "1")]
    pub service_name: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub handler_name: ::prost::alloc::string::String,
    #[prost(bytes = "vec", tag = "3")]
    pub input_data: ::prost::alloc::vec::Vec<u8>,
    #[prost(string, tag = "4")]
    pub protocol_version: ::prost::alloc::string::String,
    #[prost(map = "string, string", tag = "5")]
    pub metadata: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    /// For virtual objects
    #[prost(string, tag = "6")]
    pub object_key: ::prost::alloc::string::String,
    #[prost(bool, tag = "7")]
    pub is_replay: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InvocationResponse {
    #[prost(bytes = "vec", tag = "1")]
    pub output_data: ::prost::alloc::vec::Vec<u8>,
    #[prost(bool, tag = "2")]
    pub completed: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InvocationComplete {
    #[prost(bool, tag = "1")]
    pub success: bool,
    #[prost(string, tag = "2")]
    pub error_message: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InvocationError {
    #[prost(string, tag = "1")]
    pub error_code: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub error_message: ::prost::alloc::string::String,
    #[prost(bool, tag = "3")]
    pub retryable: bool,
}
/// Journal entry types matching internal journal structure
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct JournalEntry {
    #[prost(oneof = "journal_entry::EntryType", tags = "1, 2, 3, 4, 5, 6")]
    pub entry_type: ::core::option::Option<journal_entry::EntryType>,
}
/// Nested message and enum types in `JournalEntry`.
pub mod journal_entry {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum EntryType {
        #[prost(message, tag = "1")]
        StateUpdate(super::StateUpdateEntry),
        #[prost(message, tag = "2")]
        StateDelete(super::StateDeleteEntry),
        #[prost(message, tag = "3")]
        AwaitCall(super::AwaitEntry),
        #[prost(message, tag = "4")]
        ResolveAwait(super::ResolveAwaitEntry),
        #[prost(message, tag = "5")]
        Output(super::OutputEntry),
        #[prost(message, tag = "6")]
        Input(super::InputEntry),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StateUpdateEntry {
    #[prost(string, tag = "1")]
    pub invocation_id: ::prost::alloc::string::String,
    #[prost(bytes = "vec", tag = "2")]
    pub key: ::prost::alloc::vec::Vec<u8>,
    #[prost(bytes = "vec", tag = "3")]
    pub value: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StateDeleteEntry {
    #[prost(string, tag = "1")]
    pub invocation_id: ::prost::alloc::string::String,
    #[prost(bytes = "vec", tag = "2")]
    pub key: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AwaitEntry {
    #[prost(string, tag = "1")]
    pub invocation_id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub promise_id: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub target_service: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub target_handler: ::prost::alloc::string::String,
    #[prost(bytes = "vec", tag = "5")]
    pub input_data: ::prost::alloc::vec::Vec<u8>,
    /// For virtual object calls
    #[prost(string, tag = "6")]
    pub object_key: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResolveAwaitEntry {
    #[prost(string, tag = "1")]
    pub invocation_id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub promise_id: ::prost::alloc::string::String,
    #[prost(bytes = "vec", tag = "3")]
    pub result_data: ::prost::alloc::vec::Vec<u8>,
    #[prost(string, tag = "4")]
    pub error: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OutputEntry {
    #[prost(string, tag = "1")]
    pub invocation_id: ::prost::alloc::string::String,
    #[prost(bytes = "vec", tag = "2")]
    pub output_data: ::prost::alloc::vec::Vec<u8>,
    #[prost(string, tag = "3")]
    pub error: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InputEntry {
    #[prost(string, tag = "1")]
    pub invocation_id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub service_name: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub object_key: ::prost::alloc::string::String,
    #[prost(bytes = "vec", tag = "4")]
    pub input_data: ::prost::alloc::vec::Vec<u8>,
}
/// State operations from user service
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StateOperation {
    #[prost(oneof = "state_operation::OperationType", tags = "1, 2, 3")]
    pub operation_type: ::core::option::Option<state_operation::OperationType>,
}
/// Nested message and enum types in `StateOperation`.
pub mod state_operation {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum OperationType {
        #[prost(message, tag = "1")]
        Get(super::GetStateRequest),
        #[prost(message, tag = "2")]
        Set(super::SetStateRequest),
        #[prost(message, tag = "3")]
        Delete(super::DeleteStateRequest),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetStateRequest {
    #[prost(bytes = "vec", tag = "1")]
    pub key: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SetStateRequest {
    #[prost(bytes = "vec", tag = "1")]
    pub key: ::prost::alloc::vec::Vec<u8>,
    #[prost(bytes = "vec", tag = "2")]
    pub value: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteStateRequest {
    #[prost(bytes = "vec", tag = "1")]
    pub key: ::prost::alloc::vec::Vec<u8>,
}
/// Service calls and promises
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ServiceCall {
    #[prost(string, tag = "1")]
    pub service_name: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub handler_name: ::prost::alloc::string::String,
    #[prost(bytes = "vec", tag = "3")]
    pub input_data: ::prost::alloc::vec::Vec<u8>,
    /// For virtual objects
    #[prost(string, tag = "4")]
    pub object_key: ::prost::alloc::string::String,
    /// Generated by user service
    #[prost(string, tag = "5")]
    pub promise_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AwaitPromise {
    #[prost(string, tag = "1")]
    pub promise_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SleepRequest {
    #[prost(int64, tag = "1")]
    pub duration_ms: i64,
    /// For tracking sleep completion
    #[prost(string, tag = "2")]
    pub promise_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SuspensionComplete {
    #[prost(string, tag = "1")]
    pub promise_id: ::prost::alloc::string::String,
    #[prost(bytes = "vec", tag = "2")]
    pub result_data: ::prost::alloc::vec::Vec<u8>,
    #[prost(string, tag = "3")]
    pub error: ::prost::alloc::string::String,
}
/// Service registration and discovery
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ServiceRegistration {
    #[prost(string, tag = "1")]
    pub service_name: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub version: ::prost::alloc::string::String,
    #[prost(string, repeated, tag = "3")]
    pub handlers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(string, tag = "4")]
    pub endpoint: ::prost::alloc::string::String,
    #[prost(string, tag = "5")]
    pub protocol_version: ::prost::alloc::string::String,
    #[prost(string, repeated, tag = "6")]
    pub supported_protocol_versions: ::prost::alloc::vec::Vec<
        ::prost::alloc::string::String,
    >,
    #[prost(enumeration = "ServiceType", tag = "7")]
    pub service_type: i32,
    #[prost(map = "string, string", tag = "8")]
    pub metadata: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ServiceRegistrationResponse {
    #[prost(bool, tag = "1")]
    pub success: bool,
    #[prost(string, tag = "2")]
    pub message: ::prost::alloc::string::String,
    /// Unique ID assigned by runtime
    #[prost(string, tag = "3")]
    pub service_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ServiceUnregistration {
    #[prost(string, tag = "1")]
    pub service_id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub service_name: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub version: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ServiceUnregistrationResponse {
    #[prost(bool, tag = "1")]
    pub success: bool,
    #[prost(string, tag = "2")]
    pub message: ::prost::alloc::string::String,
}
/// Health checking
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HealthCheckRequest {
    #[prost(string, tag = "1")]
    pub service_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HealthCheckResponse {
    #[prost(enumeration = "HealthStatus", tag = "1")]
    pub status: i32,
    #[prost(string, tag = "2")]
    pub message: ::prost::alloc::string::String,
    #[prost(map = "string, string", tag = "3")]
    pub details: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
}
/// Service discovery
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListServicesRequest {
    /// Optional filter
    #[prost(string, tag = "1")]
    pub service_name_filter: ::prost::alloc::string::String,
    /// Optional filter
    #[prost(enumeration = "ServiceType", tag = "2")]
    pub service_type_filter: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListServicesResponse {
    #[prost(message, repeated, tag = "1")]
    pub services: ::prost::alloc::vec::Vec<ServiceInfo>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetServiceInfoRequest {
    #[prost(string, tag = "1")]
    pub service_name: ::prost::alloc::string::String,
    /// Optional - get latest if not specified
    #[prost(string, tag = "2")]
    pub version: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetServiceInfoResponse {
    #[prost(message, optional, tag = "1")]
    pub service: ::core::option::Option<ServiceInfo>,
    #[prost(bool, tag = "2")]
    pub found: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ServiceInfo {
    #[prost(string, tag = "1")]
    pub service_id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub service_name: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub version: ::prost::alloc::string::String,
    #[prost(string, repeated, tag = "4")]
    pub handlers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(string, tag = "5")]
    pub endpoint: ::prost::alloc::string::String,
    #[prost(string, tag = "6")]
    pub protocol_version: ::prost::alloc::string::String,
    #[prost(enumeration = "ServiceType", tag = "7")]
    pub service_type: i32,
    #[prost(enumeration = "HealthStatus", tag = "8")]
    pub health_status: i32,
    /// Unix timestamp
    #[prost(int64, tag = "9")]
    pub registered_at: i64,
    #[prost(map = "string, string", tag = "10")]
    pub metadata: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
}
/// Enums
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ServiceType {
    Unspecified = 0,
    Function = 1,
    VirtualObject = 2,
    Workflow = 3,
}
impl ServiceType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "SERVICE_TYPE_UNSPECIFIED",
            Self::Function => "SERVICE_TYPE_FUNCTION",
            Self::VirtualObject => "SERVICE_TYPE_VIRTUAL_OBJECT",
            Self::Workflow => "SERVICE_TYPE_WORKFLOW",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "SERVICE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "SERVICE_TYPE_FUNCTION" => Some(Self::Function),
            "SERVICE_TYPE_VIRTUAL_OBJECT" => Some(Self::VirtualObject),
            "SERVICE_TYPE_WORKFLOW" => Some(Self::Workflow),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum HealthStatus {
    Unspecified = 0,
    Serving = 1,
    NotServing = 2,
    ServiceUnknown = 3,
}
impl HealthStatus {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "HEALTH_STATUS_UNSPECIFIED",
            Self::Serving => "HEALTH_STATUS_SERVING",
            Self::NotServing => "HEALTH_STATUS_NOT_SERVING",
            Self::ServiceUnknown => "HEALTH_STATUS_SERVICE_UNKNOWN",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "HEALTH_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
            "HEALTH_STATUS_SERVING" => Some(Self::Serving),
            "HEALTH_STATUS_NOT_SERVING" => Some(Self::NotServing),
            "HEALTH_STATUS_SERVICE_UNKNOWN" => Some(Self::ServiceUnknown),
            _ => None,
        }
    }
}
/// Generated client implementations.
pub mod worker_coordinator_service_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// WorkerCoordinatorService defines application logic, coordinates work execution
    #[derive(Debug, Clone)]
    pub struct WorkerCoordinatorServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl WorkerCoordinatorServiceClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> WorkerCoordinatorServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::Body>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> WorkerCoordinatorServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::Body>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::Body>,
            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            WorkerCoordinatorServiceClient::new(
                InterceptedService::new(inner, interceptor),
            )
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// Main stream - bidirectional communication for service lifecycle and function execution
        /// First message from worker should be ServiceRegistration to establish the connection
        pub async fn worker_stream(
            &mut self,
            request: impl tonic::IntoStreamingRequest<Message = super::ServiceMessage>,
        ) -> std::result::Result<
            tonic::Response<tonic::codec::Streaming<super::RuntimeMessage>>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/api.v1.WorkerCoordinatorService/WorkerStream",
            );
            let mut req = request.into_streaming_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("api.v1.WorkerCoordinatorService", "WorkerStream"),
                );
            self.inner.streaming(req, path, codec).await
        }
        pub async fn health_check(
            &mut self,
            request: impl tonic::IntoRequest<super::HealthCheckRequest>,
        ) -> std::result::Result<
            tonic::Response<super::HealthCheckResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/api.v1.WorkerCoordinatorService/HealthCheck",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("api.v1.WorkerCoordinatorService", "HealthCheck"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Service discovery
        pub async fn list_services(
            &mut self,
            request: impl tonic::IntoRequest<super::ListServicesRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListServicesResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/api.v1.WorkerCoordinatorService/ListServices",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("api.v1.WorkerCoordinatorService", "ListServices"),
                );
            self.inner.unary(req, path, codec).await
        }
        pub async fn get_service_info(
            &mut self,
            request: impl tonic::IntoRequest<super::GetServiceInfoRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GetServiceInfoResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/api.v1.WorkerCoordinatorService/GetServiceInfo",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("api.v1.WorkerCoordinatorService", "GetServiceInfo"),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
/// Generated server implementations.
pub mod worker_coordinator_service_server {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    /// Generated trait containing gRPC methods that should be implemented for use with WorkerCoordinatorServiceServer.
    #[async_trait]
    pub trait WorkerCoordinatorService: std::marker::Send + std::marker::Sync + 'static {
        /// Server streaming response type for the WorkerStream method.
        type WorkerStreamStream: tonic::codegen::tokio_stream::Stream<
                Item = std::result::Result<super::RuntimeMessage, tonic::Status>,
            >
            + std::marker::Send
            + 'static;
        /// Main stream - bidirectional communication for service lifecycle and function execution
        /// First message from worker should be ServiceRegistration to establish the connection
        async fn worker_stream(
            &self,
            request: tonic::Request<tonic::Streaming<super::ServiceMessage>>,
        ) -> std::result::Result<
            tonic::Response<Self::WorkerStreamStream>,
            tonic::Status,
        >;
        async fn health_check(
            &self,
            request: tonic::Request<super::HealthCheckRequest>,
        ) -> std::result::Result<
            tonic::Response<super::HealthCheckResponse>,
            tonic::Status,
        >;
        /// Service discovery
        async fn list_services(
            &self,
            request: tonic::Request<super::ListServicesRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListServicesResponse>,
            tonic::Status,
        >;
        async fn get_service_info(
            &self,
            request: tonic::Request<super::GetServiceInfoRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GetServiceInfoResponse>,
            tonic::Status,
        >;
    }
    /// WorkerCoordinatorService defines application logic, coordinates work execution
    #[derive(Debug)]
    pub struct WorkerCoordinatorServiceServer<T> {
        inner: Arc<T>,
        accept_compression_encodings: EnabledCompressionEncodings,
        send_compression_encodings: EnabledCompressionEncodings,
        max_decoding_message_size: Option<usize>,
        max_encoding_message_size: Option<usize>,
    }
    impl<T> WorkerCoordinatorServiceServer<T> {
        pub fn new(inner: T) -> Self {
            Self::from_arc(Arc::new(inner))
        }
        pub fn from_arc(inner: Arc<T>) -> Self {
            Self {
                inner,
                accept_compression_encodings: Default::default(),
                send_compression_encodings: Default::default(),
                max_decoding_message_size: None,
                max_encoding_message_size: None,
            }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> InterceptedService<Self, F>
        where
            F: tonic::service::Interceptor,
        {
            InterceptedService::new(Self::new(inner), interceptor)
        }
        /// Enable decompressing requests with the given encoding.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.accept_compression_encodings.enable(encoding);
            self
        }
        /// Compress responses with the given encoding, if the client supports it.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.send_compression_encodings.enable(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.max_decoding_message_size = Some(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.max_encoding_message_size = Some(limit);
            self
        }
    }
    impl<T, B> tonic::codegen::Service<http::Request<B>>
    for WorkerCoordinatorServiceServer<T>
    where
        T: WorkerCoordinatorService,
        B: Body + std::marker::Send + 'static,
        B::Error: Into<StdError> + std::marker::Send + 'static,
    {
        type Response = http::Response<tonic::body::Body>;
        type Error = std::convert::Infallible;
        type Future = BoxFuture<Self::Response, Self::Error>;
        fn poll_ready(
            &mut self,
            _cx: &mut Context<'_>,
        ) -> Poll<std::result::Result<(), Self::Error>> {
            Poll::Ready(Ok(()))
        }
        fn call(&mut self, req: http::Request<B>) -> Self::Future {
            match req.uri().path() {
                "/api.v1.WorkerCoordinatorService/WorkerStream" => {
                    #[allow(non_camel_case_types)]
                    struct WorkerStreamSvc<T: WorkerCoordinatorService>(pub Arc<T>);
                    impl<
                        T: WorkerCoordinatorService,
                    > tonic::server::StreamingService<super::ServiceMessage>
                    for WorkerStreamSvc<T> {
                        type Response = super::RuntimeMessage;
                        type ResponseStream = T::WorkerStreamStream;
                        type Future = BoxFuture<
                            tonic::Response<Self::ResponseStream>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<
                                tonic::Streaming<super::ServiceMessage>,
                            >,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as WorkerCoordinatorService>::worker_stream(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = WorkerStreamSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.streaming(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/api.v1.WorkerCoordinatorService/HealthCheck" => {
                    #[allow(non_camel_case_types)]
                    struct HealthCheckSvc<T: WorkerCoordinatorService>(pub Arc<T>);
                    impl<
                        T: WorkerCoordinatorService,
                    > tonic::server::UnaryService<super::HealthCheckRequest>
                    for HealthCheckSvc<T> {
                        type Response = super::HealthCheckResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::HealthCheckRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as WorkerCoordinatorService>::health_check(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = HealthCheckSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/api.v1.WorkerCoordinatorService/ListServices" => {
                    #[allow(non_camel_case_types)]
                    struct ListServicesSvc<T: WorkerCoordinatorService>(pub Arc<T>);
                    impl<
                        T: WorkerCoordinatorService,
                    > tonic::server::UnaryService<super::ListServicesRequest>
                    for ListServicesSvc<T> {
                        type Response = super::ListServicesResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::ListServicesRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as WorkerCoordinatorService>::list_services(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = ListServicesSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/api.v1.WorkerCoordinatorService/GetServiceInfo" => {
                    #[allow(non_camel_case_types)]
                    struct GetServiceInfoSvc<T: WorkerCoordinatorService>(pub Arc<T>);
                    impl<
                        T: WorkerCoordinatorService,
                    > tonic::server::UnaryService<super::GetServiceInfoRequest>
                    for GetServiceInfoSvc<T> {
                        type Response = super::GetServiceInfoResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::GetServiceInfoRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as WorkerCoordinatorService>::get_service_info(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = GetServiceInfoSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                _ => {
                    Box::pin(async move {
                        let mut response = http::Response::new(
                            tonic::body::Body::default(),
                        );
                        let headers = response.headers_mut();
                        headers
                            .insert(
                                tonic::Status::GRPC_STATUS,
                                (tonic::Code::Unimplemented as i32).into(),
                            );
                        headers
                            .insert(
                                http::header::CONTENT_TYPE,
                                tonic::metadata::GRPC_CONTENT_TYPE,
                            );
                        Ok(response)
                    })
                }
            }
        }
    }
    impl<T> Clone for WorkerCoordinatorServiceServer<T> {
        fn clone(&self) -> Self {
            let inner = self.inner.clone();
            Self {
                inner,
                accept_compression_encodings: self.accept_compression_encodings,
                send_compression_encodings: self.send_compression_encodings,
                max_decoding_message_size: self.max_decoding_message_size,
                max_encoding_message_size: self.max_encoding_message_size,
            }
        }
    }
    /// Generated gRPC service name
    pub const SERVICE_NAME: &str = "api.v1.WorkerCoordinatorService";
    impl<T> tonic::server::NamedService for WorkerCoordinatorServiceServer<T> {
        const NAME: &'static str = SERVICE_NAME;
    }
}
