// This file is @generated by prost-build.
/// A general purpose failure message.
/// See: <https://github.com/nexus-rpc/api/blob/main/SPEC.md#failure>
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Failure {
    #[prost(string, tag = "1")]
    pub message: ::prost::alloc::string::String,
    #[prost(map = "string, string", tag = "2")]
    pub metadata: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    /// UTF-8 encoded JSON serializable details.
    #[prost(bytes = "vec", tag = "3")]
    pub details: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HandlerError {
    /// See <https://github.com/nexus-rpc/api/blob/main/SPEC.md#predefined-handler-errors.>
    #[prost(string, tag = "1")]
    pub error_type: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "2")]
    pub failure: ::core::option::Option<Failure>,
    /// Retry behavior, defaults to the retry behavior of the error type as defined in the spec.
    #[prost(
        enumeration = "super::super::enums::v1::NexusHandlerErrorRetryBehavior",
        tag = "3"
    )]
    pub retry_behavior: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UnsuccessfulOperationError {
    /// See <https://github.com/nexus-rpc/api/blob/main/SPEC.md#operationinfo.>
    #[prost(string, tag = "1")]
    pub operation_state: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "2")]
    pub failure: ::core::option::Option<Failure>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Link {
    /// See <https://github.com/nexus-rpc/api/blob/main/SPEC.md#links.>
    #[prost(string, tag = "1")]
    pub url: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub r#type: ::prost::alloc::string::String,
}
/// A request to start an operation.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartOperationRequest {
    /// Name of service to start the operation in.
    #[prost(string, tag = "1")]
    pub service: ::prost::alloc::string::String,
    /// Type of operation to start.
    #[prost(string, tag = "2")]
    pub operation: ::prost::alloc::string::String,
    /// A request ID that can be used as an idempotentency key.
    #[prost(string, tag = "3")]
    pub request_id: ::prost::alloc::string::String,
    /// Callback URL to call upon completion if the started operation is async.
    #[prost(string, tag = "4")]
    pub callback: ::prost::alloc::string::String,
    /// Full request body from the incoming HTTP request.
    #[prost(message, optional, tag = "5")]
    pub payload: ::core::option::Option<super::super::common::v1::Payload>,
    /// Header that is expected to be attached to the callback request when the operation completes.
    #[prost(map = "string, string", tag = "6")]
    pub callback_header: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    /// Links contain caller information and can be attached to the operations started by the handler.
    #[prost(message, repeated, tag = "7")]
    pub links: ::prost::alloc::vec::Vec<Link>,
}
/// A request to cancel an operation.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CancelOperationRequest {
    /// Service name.
    #[prost(string, tag = "1")]
    pub service: ::prost::alloc::string::String,
    /// Type of operation to cancel.
    #[prost(string, tag = "2")]
    pub operation: ::prost::alloc::string::String,
    /// Operation ID as originally generated by a Handler.
    ///
    /// Deprecated. Renamed to operation_token.
    #[deprecated]
    #[prost(string, tag = "3")]
    pub operation_id: ::prost::alloc::string::String,
    /// Operation token as originally generated by a Handler.
    #[prost(string, tag = "4")]
    pub operation_token: ::prost::alloc::string::String,
}
/// A Nexus request.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Request {
    /// Headers extracted from the original request in the Temporal frontend.
    /// When using Nexus over HTTP, this includes the request's HTTP headers ignoring multiple values.
    #[prost(map = "string, string", tag = "1")]
    pub header: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    /// The timestamp when the request was scheduled in the frontend.
    /// (-- api-linter: core::0142::time-field-names=disabled
    ///      aip.dev/not-precedent: Not following linter rules. --)
    #[prost(message, optional, tag = "2")]
    pub scheduled_time: ::core::option::Option<::prost_types::Timestamp>,
    /// The endpoint this request was addressed to before forwarding to the worker.
    /// Supported from server version 1.30.0.
    #[prost(string, tag = "10")]
    pub endpoint: ::prost::alloc::string::String,
    #[prost(oneof = "request::Variant", tags = "3, 4")]
    pub variant: ::core::option::Option<request::Variant>,
}
/// Nested message and enum types in `Request`.
pub mod request {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Variant {
        #[prost(message, tag = "3")]
        StartOperation(super::StartOperationRequest),
        #[prost(message, tag = "4")]
        CancelOperation(super::CancelOperationRequest),
    }
}
/// Response variant for StartOperationRequest.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartOperationResponse {
    #[prost(oneof = "start_operation_response::Variant", tags = "1, 2, 3")]
    pub variant: ::core::option::Option<start_operation_response::Variant>,
}
/// Nested message and enum types in `StartOperationResponse`.
pub mod start_operation_response {
    /// An operation completed successfully.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct Sync {
        #[prost(message, optional, tag = "1")]
        pub payload: ::core::option::Option<super::super::super::common::v1::Payload>,
        #[prost(message, repeated, tag = "2")]
        pub links: ::prost::alloc::vec::Vec<super::Link>,
    }
    /// The operation will complete asynchronously.
    /// The returned ID can be used to reference this operation.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct Async {
        /// Deprecated. Renamed to operation_token.
        #[deprecated]
        #[prost(string, tag = "1")]
        pub operation_id: ::prost::alloc::string::String,
        #[prost(message, repeated, tag = "2")]
        pub links: ::prost::alloc::vec::Vec<super::Link>,
        #[prost(string, tag = "3")]
        pub operation_token: ::prost::alloc::string::String,
    }
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Variant {
        #[prost(message, tag = "1")]
        SyncSuccess(Sync),
        #[prost(message, tag = "2")]
        AsyncSuccess(Async),
        /// The operation completed unsuccessfully (failed or canceled).
        #[prost(message, tag = "3")]
        OperationError(super::UnsuccessfulOperationError),
    }
}
/// Response variant for CancelOperationRequest.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct CancelOperationResponse {}
/// A response indicating that the handler has successfully processed a request.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Response {
    /// Variant must correlate to the corresponding Request's variant.
    #[prost(oneof = "response::Variant", tags = "1, 2")]
    pub variant: ::core::option::Option<response::Variant>,
}
/// Nested message and enum types in `Response`.
pub mod response {
    /// Variant must correlate to the corresponding Request's variant.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Variant {
        #[prost(message, tag = "1")]
        StartOperation(super::StartOperationResponse),
        #[prost(message, tag = "2")]
        CancelOperation(super::CancelOperationResponse),
    }
}
/// A cluster-global binding from an endpoint ID to a target for dispatching incoming Nexus requests.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Endpoint {
    /// Data version for this endpoint, incremented for every update issued via the UpdateNexusEndpoint API.
    #[prost(int64, tag = "1")]
    pub version: i64,
    /// Unique server-generated endpoint ID.
    #[prost(string, tag = "2")]
    pub id: ::prost::alloc::string::String,
    /// Spec for the endpoint.
    #[prost(message, optional, tag = "3")]
    pub spec: ::core::option::Option<EndpointSpec>,
    /// The date and time when the endpoint was created.
    /// (-- api-linter: core::0142::time-field-names=disabled
    ///      aip.dev/not-precedent: Not following linter rules. --)
    #[prost(message, optional, tag = "4")]
    pub created_time: ::core::option::Option<::prost_types::Timestamp>,
    /// The date and time when the endpoint was last modified.
    /// Will not be set if the endpoint has never been modified.
    /// (-- api-linter: core::0142::time-field-names=disabled
    ///      aip.dev/not-precedent: Not following linter rules. --)
    #[prost(message, optional, tag = "5")]
    pub last_modified_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Server exposed URL prefix for invocation of operations on this endpoint.
    /// This doesn't include the protocol, hostname or port as the server does not know how it should be accessed
    /// publicly. The URL is stable in the face of endpoint renames.
    #[prost(string, tag = "6")]
    pub url_prefix: ::prost::alloc::string::String,
}
/// Contains mutable fields for an Endpoint.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EndpointSpec {
    /// Endpoint name, unique for this cluster. Must match `[a-zA-Z_][a-zA-Z0-9_]*`.
    /// Renaming an endpoint breaks all workflow callers that reference this endpoint, causing operations to fail.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Markdown description serialized as a single JSON string.
    /// If the Payload is encrypted, the UI and CLI may decrypt with the configured codec server endpoint.
    /// By default, the server enforces a limit of 20,000 bytes for this entire payload.
    #[prost(message, optional, tag = "2")]
    pub description: ::core::option::Option<super::super::common::v1::Payload>,
    /// Target to route requests to.
    #[prost(message, optional, tag = "3")]
    pub target: ::core::option::Option<EndpointTarget>,
}
/// Target to route requests to.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EndpointTarget {
    #[prost(oneof = "endpoint_target::Variant", tags = "1, 2")]
    pub variant: ::core::option::Option<endpoint_target::Variant>,
}
/// Nested message and enum types in `EndpointTarget`.
pub mod endpoint_target {
    /// Target a worker polling on a Nexus task queue in a specific namespace.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct Worker {
        /// Namespace to route requests to.
        #[prost(string, tag = "1")]
        pub namespace: ::prost::alloc::string::String,
        /// Nexus task queue to route requests to.
        #[prost(string, tag = "2")]
        pub task_queue: ::prost::alloc::string::String,
    }
    /// Target an external server by URL.
    /// At a later point, this will support providing credentials, in the meantime, an http.RoundTripper can be injected
    /// into the server to modify the request.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct External {
        /// URL to call.
        #[prost(string, tag = "1")]
        pub url: ::prost::alloc::string::String,
    }
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Variant {
        #[prost(message, tag = "1")]
        Worker(Worker),
        #[prost(message, tag = "2")]
        External(External),
    }
}
