// This file is @generated by prost-build.
/// A procedure execution node is either a section or a step.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProcedureExecutionNode {
    #[prost(oneof = "procedure_execution_node::Node", tags = "1, 2")]
    pub node: ::core::option::Option<procedure_execution_node::Node>,
}
/// Nested message and enum types in `ProcedureExecutionNode`.
pub mod procedure_execution_node {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Node {
        /// A section node is a visual grouping of other sections and steps.
        /// Execution sections are static and do not have execution state.
        #[prost(message, tag = "1")]
        Section(super::ProcedureExecutionSectionNode),
        /// Execution steps are the interactive steps in a procedure.
        #[prost(message, tag = "2")]
        Step(super::ProcedureExecutionStepNode),
    }
}
/// A section node is a visual grouping of other sections and steps.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProcedureExecutionSectionNode {
    /// Unique identifier of this execution node.
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    /// Unique identifier of the template node this execution node is based on.
    #[prost(string, tag = "2")]
    pub template_node_id: ::prost::alloc::string::String,
    /// Title of this section. Uses the template section's title and cannot be changed in execution.
    #[prost(string, tag = "3")]
    pub title: ::prost::alloc::string::String,
    /// Description of this section. Uses the template section's description and cannot be changed in execution.
    #[prost(string, optional, tag = "4")]
    pub description: ::core::option::Option<::prost::alloc::string::String>,
    /// If set, the commit ID of the procedure template this section is based on.
    /// Otherwise, the section is based on the template commit specified at the top level of the execution.
    #[prost(string, optional, tag = "5")]
    pub template_commit_id: ::core::option::Option<::prost::alloc::string::String>,
}
/// Execution steps are the interactive steps in a procedure.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProcedureExecutionStepNode {
    /// Unique identifier of this execution node.
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    /// Unique identifier of the template node this execution node is based on.
    #[prost(string, tag = "2")]
    pub template_node_id: ::prost::alloc::string::String,
    /// Execution steps become "outdated" once any upstream steps are re-run
    /// An outdated execution step should not be further modified.
    #[prost(bool, tag = "3")]
    pub is_outdated: bool,
    /// The current status of the step along with metadata about the status transitions.
    #[prost(message, optional, tag = "4")]
    pub state: ::core::option::Option<ExecutionStepState>,
    /// The current value for the content of the step.
    #[prost(message, optional, tag = "5")]
    pub value: ::core::option::Option<StepContentValue>,
    /// Whether the step has auto-proceed enabled.
    #[prost(message, optional, tag = "6")]
    pub auto_proceed_config: ::core::option::Option<super::super::v1::AutoProceedConfig>,
    /// Completion_condition_status is the status of the completion condition for the step
    /// The backend manages this property and will update it while it monitors the
    /// completion_condition if set.
    /// This property will be unset if no completion_condition is set on the step or
    /// if the execution step's contents has not been submitted yet.
    #[prost(message, optional, tag = "7")]
    pub success_condition_status: ::core::option::Option<SuccessConditionStatus>,
    /// Completion_action_statuses are the status of the completion actions for the step
    /// The backend manages this property and will update it after performing
    /// completion_actions.
    #[prost(message, repeated, tag = "8")]
    pub completion_action_statuses: ::prost::alloc::vec::Vec<CompletionActionStatus>,
    /// Outputs are the values of the fields within this step, set by the backend after the step has reached
    /// the SUCCEEDED state.
    /// The backend will know how to introspect the node and determine these values, for example looking for
    /// form fields with ids in a FormStep.
    /// These outputs can be consumed by other steps later in the procedure by referencing `{output_id}:{field_id}`
    #[prost(map = "string, message", tag = "10")]
    pub outputs: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        FieldOutput,
    >,
    /// If set, the commit ID of the procedure template this step is based on.
    /// Otherwise, the step is based on the template commit specified at the top level of the execution.
    #[prost(string, optional, tag = "11")]
    pub template_commit_id: ::core::option::Option<::prost::alloc::string::String>,
}
/// All execution steps start in the NOT_STARTED state.
/// In this state, the step's values can be modified by the user.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ExecutionStepNotStarted {}
/// An execution step is in the SKIPPED state if it was skipped by a user.
/// An execution step cannot be skipped if it is in a terminal state (SUCCEEDED or ERRORED).
/// This is a terminal state, the step's values cannot be modified by the user.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecutionStepSkipped {
    #[prost(message, optional, tag = "1")]
    pub skipped_at: ::core::option::Option<
        super::super::super::super::google::protobuf::Timestamp,
    >,
    #[prost(string, tag = "2")]
    pub skipped_by: ::prost::alloc::string::String,
    #[prost(string, optional, tag = "3")]
    pub skip_reason: ::core::option::Option<::prost::alloc::string::String>,
    /// Optional because a step can be skipped from the NOT_STARTED state before these are set
    #[prost(message, optional, tag = "4")]
    pub started_at: ::core::option::Option<
        super::super::super::super::google::protobuf::Timestamp,
    >,
    #[prost(string, optional, tag = "5")]
    pub started_by: ::core::option::Option<::prost::alloc::string::String>,
    /// Optional because a step can be skipped from the IN_PROGRESS state before these are set
    #[prost(message, optional, tag = "6")]
    pub submitted_at: ::core::option::Option<
        super::super::super::super::google::protobuf::Timestamp,
    >,
    #[prost(string, optional, tag = "7")]
    pub submitted_by: ::core::option::Option<::prost::alloc::string::String>,
}
/// An execution step is in the IN_PROGRESS state once it has been started from NOT_STARTED,
/// either manually or automatically.
/// In this state, the step's values can be modified by the user.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecutionStepInProgress {
    #[prost(message, optional, tag = "1")]
    pub started_at: ::core::option::Option<
        super::super::super::super::google::protobuf::Timestamp,
    >,
    #[prost(string, tag = "2")]
    pub started_by: ::prost::alloc::string::String,
}
/// An execution step is in the SUBMITTED state once it has been submitted from the IN_PROGRESS state,
/// either manually or automatically.
/// In this state, the step's values are considered submitted and cannot be modified by the user.
/// In this state, the backend will monitor the completion condition (if any) and execute the completion
/// actions (if any) once the condition is satisfied.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecutionStepSubmitted {
    #[prost(message, optional, tag = "1")]
    pub started_at: ::core::option::Option<
        super::super::super::super::google::protobuf::Timestamp,
    >,
    #[prost(string, tag = "2")]
    pub started_by: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "3")]
    pub submitted_at: ::core::option::Option<
        super::super::super::super::google::protobuf::Timestamp,
    >,
    #[prost(string, tag = "4")]
    pub submitted_by: ::prost::alloc::string::String,
}
/// An execution step reaches the SUCCEEDED state if all conditions were met and all actions successfully ran.
/// This is a terminal state, the step's values cannot be modified by the user.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecutionStepSucceeded {
    #[prost(message, optional, tag = "1")]
    pub started_at: ::core::option::Option<
        super::super::super::super::google::protobuf::Timestamp,
    >,
    #[prost(string, tag = "2")]
    pub started_by: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "3")]
    pub submitted_at: ::core::option::Option<
        super::super::super::super::google::protobuf::Timestamp,
    >,
    #[prost(string, tag = "4")]
    pub submitted_by: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "5")]
    pub succeeded_at: ::core::option::Option<
        super::super::super::super::google::protobuf::Timestamp,
    >,
    #[prost(string, tag = "6")]
    pub succeeded_by: ::prost::alloc::string::String,
}
/// An execution step reaches the ERRORED state if something went wrong while trying to complete the step.
/// This could be due to a badly configured procedure, an error/timeout in the completion condition,
/// or an error/timeout in one of the completion actions.
/// This is a terminal state, the step's values cannot be modified by the user.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecutionStepErrored {
    /// Optinal because a step can be skipped -> errored before being started
    #[prost(message, optional, tag = "1")]
    pub started_at: ::core::option::Option<
        super::super::super::super::google::protobuf::Timestamp,
    >,
    #[prost(string, optional, tag = "2")]
    pub started_by: ::core::option::Option<::prost::alloc::string::String>,
    /// Optional because a step can be errored before being submitted
    #[prost(message, optional, tag = "3")]
    pub submitted_at: ::core::option::Option<
        super::super::super::super::google::protobuf::Timestamp,
    >,
    #[prost(string, optional, tag = "4")]
    pub submitted_by: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(message, optional, tag = "5")]
    pub errored_at: ::core::option::Option<
        super::super::super::super::google::protobuf::Timestamp,
    >,
    #[prost(string, tag = "6")]
    pub errored_by: ::prost::alloc::string::String,
    #[prost(string, tag = "7")]
    pub error: ::prost::alloc::string::String,
    /// Optional because a step could be skipped but then error while running completion actions
    #[prost(message, optional, tag = "8")]
    pub skipped_at: ::core::option::Option<
        super::super::super::super::google::protobuf::Timestamp,
    >,
    #[prost(string, optional, tag = "9")]
    pub skipped_by: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "10")]
    pub skip_reason: ::core::option::Option<::prost::alloc::string::String>,
    /// Optional because a step can succeed but then error while running completion actions
    #[prost(message, optional, tag = "11")]
    pub succeeded_at: ::core::option::Option<
        super::super::super::super::google::protobuf::Timestamp,
    >,
    #[prost(string, optional, tag = "12")]
    pub succeeded_by: ::core::option::Option<::prost::alloc::string::String>,
}
/// The read-side state for an execution step.
/// Here is the state machine:
/// All steps start in the NOT_STARTED state.
/// From NOT_STARTED, a step can transition to IN_PROGRESS or SKIPPED.
/// - Transitioning to IN_PROGRESS can be done manually by a user or automatically if auto-start is enabled.
///    This transition can only happen if the step's dependencies are in a completed state (SUCCEEDED or SKIPPED)
/// From IN_PROGRESS, a step can transition to SUBMITTED or SKIPPED.
/// - Transitioning to SUBMITTED can be done manually by a user or automatically if auto-proceed is enabled.
///    This transition can only happen if the step's content has its required values set.
/// - Transitioning to SKIPPED can be done manually by a user.
/// From SUBMITTED, a step can transition to SUCCEEDED, ERRORED, or SKIPPED.
/// - Transitioning to SUCCEEDED or ERRORED is done by the backend after monitoring the completion
///    condition (if any) and executing the completion actions (if any).
/// - Transitioning to SKIPPED can be done manually by a user.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecutionStepState {
    #[prost(oneof = "execution_step_state::State", tags = "1, 2, 3, 4, 5, 6")]
    pub state: ::core::option::Option<execution_step_state::State>,
}
/// Nested message and enum types in `ExecutionStepState`.
pub mod execution_step_state {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum State {
        #[prost(message, tag = "1")]
        NotStarted(super::ExecutionStepNotStarted),
        #[prost(message, tag = "2")]
        InProgress(super::ExecutionStepInProgress),
        #[prost(message, tag = "3")]
        Submitted(super::ExecutionStepSubmitted),
        /// Terminal states below
        #[prost(message, tag = "4")]
        Skipped(super::ExecutionStepSkipped),
        #[prost(message, tag = "5")]
        Succeeded(super::ExecutionStepSucceeded),
        #[prost(message, tag = "6")]
        Errored(super::ExecutionStepErrored),
    }
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct StepInProgressRequest {}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct StepSubmittedRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StepSkippedRequest {
    #[prost(string, optional, tag = "1")]
    pub skip_reason: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StepErroredRequest {
    #[prost(string, optional, tag = "1")]
    pub error_reason: ::core::option::Option<::prost::alloc::string::String>,
}
/// A request to update the state of an execution step.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TargetStepStateRequest {
    #[prost(oneof = "target_step_state_request::TargetState", tags = "1, 2, 3, 4")]
    pub target_state: ::core::option::Option<target_step_state_request::TargetState>,
}
/// Nested message and enum types in `TargetStepStateRequest`.
pub mod target_step_state_request {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum TargetState {
        #[prost(message, tag = "1")]
        InProgress(super::StepInProgressRequest),
        #[prost(message, tag = "2")]
        Submitted(super::StepSubmittedRequest),
        #[prost(message, tag = "3")]
        Skipped(super::StepSkippedRequest),
        #[prost(message, tag = "4")]
        Errored(super::StepErroredRequest),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProcedureAsyncTask {
    #[prost(oneof = "procedure_async_task::Task", tags = "1")]
    pub task: ::core::option::Option<procedure_async_task::Task>,
}
/// Nested message and enum types in `ProcedureAsyncTask`.
pub mod procedure_async_task {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Task {
        #[prost(message, tag = "1")]
        ConditionObservation(super::ConditionObservation),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConditionObservation {
    #[prost(string, tag = "1")]
    pub user_rid: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub org_rid: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub procedure_execution_rid: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub step_id: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "5")]
    pub success_condition: ::core::option::Option<super::super::v1::SuccessCondition>,
}
/// Represents the current status of one or more nested completion conditions.
/// Mirrors the recursive SuccessCondition in nominal.procedures.v1
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SuccessConditionStatus {
    /// The type of condition being monitored.
    #[prost(oneof = "success_condition_status::Condition", tags = "1, 6, 7")]
    pub condition: ::core::option::Option<success_condition_status::Condition>,
    /// The status of this condition.
    #[prost(oneof = "success_condition_status::Status", tags = "2, 3, 4, 5, 8")]
    pub status: ::core::option::Option<success_condition_status::Status>,
}
/// Nested message and enum types in `SuccessConditionStatus`.
pub mod success_condition_status {
    /// The type of condition being monitored.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Condition {
        #[prost(message, tag = "1")]
        And(super::AndSuccessCondition),
        #[prost(message, tag = "6")]
        Timer(super::super::super::v1::TimerSuccessCondition),
        /// ChannelValidationSuccessCondition channel_validation = 4;
        /// OrSuccessConditionOrStatus or = 5;
        #[prost(message, tag = "7")]
        IngestJob(super::super::super::v1::IngestJobSuccessCondition),
    }
    /// The status of this condition.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Status {
        #[prost(message, tag = "2")]
        InProgress(super::SuccessConditionInProgress),
        #[prost(message, tag = "3")]
        Satisfied(super::SuccessConditionSatisfied),
        #[prost(message, tag = "4")]
        Failed(super::SuccessConditionFailed),
        #[prost(message, tag = "5")]
        Canceled(super::SuccessConditionCanceled),
        #[prost(message, tag = "8")]
        Submitted(super::SuccessConditionSubmitted),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AndSuccessCondition {
    #[prost(message, repeated, tag = "1")]
    pub conditions: ::prost::alloc::vec::Vec<SuccessConditionStatus>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SuccessConditionSubmitted {
    #[prost(message, optional, tag = "1")]
    pub submitted_at: ::core::option::Option<
        super::super::super::super::google::protobuf::Timestamp,
    >,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SuccessConditionInProgress {
    #[prost(message, optional, tag = "1")]
    pub started_at: ::core::option::Option<
        super::super::super::super::google::protobuf::Timestamp,
    >,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SuccessConditionSatisfied {
    #[prost(message, optional, tag = "1")]
    pub started_at: ::core::option::Option<
        super::super::super::super::google::protobuf::Timestamp,
    >,
    #[prost(message, optional, tag = "2")]
    pub satisfied_at: ::core::option::Option<
        super::super::super::super::google::protobuf::Timestamp,
    >,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SuccessConditionFailed {
    #[prost(message, optional, tag = "1")]
    pub started_at: ::core::option::Option<
        super::super::super::super::google::protobuf::Timestamp,
    >,
    #[prost(message, optional, tag = "2")]
    pub failed_at: ::core::option::Option<
        super::super::super::super::google::protobuf::Timestamp,
    >,
    #[prost(string, tag = "3")]
    pub failure_reason: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SuccessConditionCanceled {
    #[prost(message, optional, tag = "1")]
    pub started_at: ::core::option::Option<
        super::super::super::super::google::protobuf::Timestamp,
    >,
    #[prost(message, optional, tag = "2")]
    pub canceled_at: ::core::option::Option<
        super::super::super::super::google::protobuf::Timestamp,
    >,
}
/// The status of a completion action and its result (if any).
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompletionActionStatus {
    #[prost(message, optional, tag = "1")]
    pub state: ::core::option::Option<CompletionActionState>,
    /// This is intentionally not a required oneof
    #[prost(oneof = "completion_action_status::Result", tags = "2, 3, 4, 5")]
    pub result: ::core::option::Option<completion_action_status::Result>,
}
/// Nested message and enum types in `CompletionActionStatus`.
pub mod completion_action_status {
    /// This is intentionally not a required oneof
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Result {
        #[prost(message, tag = "2")]
        CreateEvent(super::CreateEventResult),
        #[prost(message, tag = "3")]
        CreateRun(super::CreateRunResult),
        #[prost(message, tag = "4")]
        ApplyWorkbookTemplates(super::ApplyWorkbookTemplatesResult),
        /// ...
        #[prost(message, tag = "5")]
        ApplyChecklists(super::ApplyChecklistsResult),
    }
}
/// A CreateEvent action results in an EventRid if successful.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateEventResult {
    #[prost(string, tag = "1")]
    pub event_rid: ::prost::alloc::string::String,
}
/// A CreateRun action results in a RunRid if successful.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateRunResult {
    #[prost(string, tag = "1")]
    pub run_rid: ::prost::alloc::string::String,
}
/// An ApplyWorkbookTemplates action results in a list of workbook RIDs if successful.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ApplyWorkbookTemplatesResult {
    #[prost(string, repeated, tag = "1")]
    pub workbook_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// An ApplyChecklists action results in a list of DataReviewRids if successful.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ApplyChecklistsResult {
    #[prost(string, repeated, tag = "1")]
    pub data_review_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompletionActionState {
    #[prost(oneof = "completion_action_state::State", tags = "1, 2, 3")]
    pub state: ::core::option::Option<completion_action_state::State>,
}
/// Nested message and enum types in `CompletionActionState`.
pub mod completion_action_state {
    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
    pub struct NotRun {}
    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
    pub struct Succeeded {}
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum State {
        /// The action was not run
        #[prost(message, tag = "1")]
        NotRun(NotRun),
        /// The action was run and succeeded. The result is available in CompletionActionStatus.result
        #[prost(message, tag = "2")]
        Succeeded(Succeeded),
        /// The action was run and errored. This field contains the error message.
        #[prost(string, tag = "3")]
        Error(::prost::alloc::string::String),
    }
}
/// The value for a step's content. Should match the ProcedureStepNode type.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StepContentValue {
    #[prost(oneof = "step_content_value::Value", tags = "1, 2, 3")]
    pub value: ::core::option::Option<step_content_value::Value>,
}
/// Nested message and enum types in `StepContentValue`.
pub mod step_content_value {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Value {
        #[prost(message, tag = "1")]
        Form(super::FormStepValue),
        #[prost(message, tag = "2")]
        StartIngest(super::StartIngestStepValue),
        /// ...
        #[prost(message, tag = "3")]
        SelectOrCreateAsset(super::SelectOrCreateAssetStepValue),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FormStepValue {
    #[prost(message, repeated, tag = "1")]
    pub fields: ::prost::alloc::vec::Vec<FormFieldValue>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartIngestStepValue {
    /// The RID of the ingest job that was started by the client.
    /// This must be populated for the step to be submitted.
    #[prost(string, optional, tag = "1")]
    pub ingest_job_rid: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SelectOrCreateAssetStepValue {
    /// The asset that was selected / created by the client.
    /// This must be populated for the step to be submitted.
    #[prost(message, optional, tag = "1")]
    pub asset_reference: ::core::option::Option<super::super::v1::AssetReference>,
}
/// The value chosen for a form field.
/// This differs from FieldOutput in that this should map 1:1 with FormField types,
/// while FieldOutput contains the resolved values after the execution step is complete.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FormFieldValue {
    #[prost(oneof = "form_field_value::Field", tags = "1, 2, 3, 4, 5, 6, 7, 8, 9")]
    pub field: ::core::option::Option<form_field_value::Field>,
}
/// Nested message and enum types in `FormFieldValue`.
pub mod form_field_value {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Field {
        #[prost(message, tag = "1")]
        Asset(super::AssetFieldValue),
        #[prost(message, tag = "2")]
        Checkbox(super::CheckboxFieldValue),
        #[prost(message, tag = "3")]
        Text(super::TextFieldValue),
        #[prost(message, tag = "4")]
        Int(super::IntFieldValue),
        #[prost(message, tag = "5")]
        Double(super::DoubleFieldValue),
        #[prost(message, tag = "6")]
        SingleEnum(super::SingleEnumFieldValue),
        #[prost(message, tag = "7")]
        MultiEnum(super::MultiEnumFieldValue),
        #[prost(message, tag = "8")]
        FileUpload(super::FileUploadFieldValue),
        #[prost(message, tag = "9")]
        MultiFileUpload(super::MultiFileUploadFieldValue),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AssetFieldValue {
    /// This oneof will be unset if no asset is set on the field.
    #[prost(oneof = "asset_field_value::Asset", tags = "1")]
    pub asset: ::core::option::Option<asset_field_value::Asset>,
}
/// Nested message and enum types in `AssetFieldValue`.
pub mod asset_field_value {
    /// This oneof will be unset if no asset is set on the field.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Asset {
        #[prost(message, tag = "1")]
        AssetReference(super::super::super::v1::AssetReference),
    }
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct CheckboxFieldValue {
    /// Default to false if not set
    #[prost(bool, tag = "1")]
    pub value: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TextFieldValue {
    /// Default to empty string if not set
    #[prost(string, optional, tag = "1")]
    pub value: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct IntFieldValue {
    #[prost(int64, optional, tag = "1")]
    pub value: ::core::option::Option<i64>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DoubleFieldValue {
    #[prost(double, optional, tag = "1")]
    pub value: ::core::option::Option<f64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SingleEnumFieldValue {
    /// Default to empty string if not set
    #[prost(string, optional, tag = "1")]
    pub value: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MultiEnumFieldValue {
    /// Default to empty list if not set
    #[prost(string, repeated, tag = "1")]
    pub value: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Corresponds to usage of the upload api
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FileUploadFieldValue {
    #[prost(oneof = "file_upload_field_value::UploadType", tags = "1")]
    pub upload_type: ::core::option::Option<file_upload_field_value::UploadType>,
}
/// Nested message and enum types in `FileUploadFieldValue`.
pub mod file_upload_field_value {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum UploadType {
        #[prost(message, tag = "1")]
        S3Upload(super::S3UploadFileValue),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct S3UploadFileValue {
    /// The S3 path where the uploaded file is stored
    #[prost(string, tag = "1")]
    pub s3_path: ::prost::alloc::string::String,
    /// The original filename of the uploaded file
    #[prost(string, tag = "2")]
    pub file_name: ::prost::alloc::string::String,
    /// The MIME type of the uploaded file
    /// Following the convention of <https://developer.mozilla.org/en-US/docs/Web/API/Blob/type> (from which the File api inherits, we will accept an empty string)
    #[prost(string, optional, tag = "3")]
    pub file_type: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MultiFileUploadFieldValue {
    /// The list of uploads
    #[prost(message, repeated, tag = "1")]
    pub uploads: ::prost::alloc::vec::Vec<FileUploadFieldValue>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProcedureExecution {
    #[prost(string, tag = "1")]
    pub rid: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "2")]
    pub metadata: ::core::option::Option<ProcedureExecutionMetadata>,
    #[prost(message, optional, tag = "3")]
    pub state: ::core::option::Option<ProcedureExecutionState>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProcedureExecutionMetadata {
    #[prost(string, tag = "1")]
    pub rid: ::prost::alloc::string::String,
    /// The procedure template rid this execution is based on.
    #[prost(string, tag = "2")]
    pub procedure_rid: ::prost::alloc::string::String,
    /// The commit ID of the procedure template this execution is based on.
    /// This can be overridden at the node level for individual nodes.
    #[prost(string, tag = "3")]
    pub procedure_commit_id: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub title: ::prost::alloc::string::String,
    #[prost(string, optional, tag = "5")]
    pub description: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, repeated, tag = "6")]
    pub labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(map = "string, string", tag = "7")]
    pub properties: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    #[prost(string, tag = "8")]
    pub created_by: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "9")]
    pub created_at: ::core::option::Option<
        super::super::super::super::google::protobuf::Timestamp,
    >,
    #[prost(string, tag = "10")]
    pub updated_by: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "11")]
    pub updated_at: ::core::option::Option<
        super::super::super::super::google::protobuf::Timestamp,
    >,
    /// Will be unset until the execution transitions from NOT_STARTED to IN_PROGRESS.
    #[prost(message, optional, tag = "12")]
    pub started_at: ::core::option::Option<
        super::super::super::super::google::protobuf::Timestamp,
    >,
    #[prost(string, optional, tag = "13")]
    pub started_by: ::core::option::Option<::prost::alloc::string::String>,
    /// Will be unset until the execution transitions from IN_PROGRESS to a terminal state.
    #[prost(message, optional, tag = "14")]
    pub finished_at: ::core::option::Option<
        super::super::super::super::google::protobuf::Timestamp,
    >,
    #[prost(string, optional, tag = "15")]
    pub finished_by: ::core::option::Option<::prost::alloc::string::String>,
    /// Will be true/set if the execution is the ABORTED terminal state.
    #[prost(message, optional, tag = "16")]
    pub aborted_at: ::core::option::Option<
        super::super::super::super::google::protobuf::Timestamp,
    >,
    #[prost(string, optional, tag = "17")]
    pub aborted_by: ::core::option::Option<::prost::alloc::string::String>,
    /// Will be set if the execution is in the ERRORED terminal state.
    #[prost(message, optional, tag = "18")]
    pub failed_at: ::core::option::Option<
        super::super::super::super::google::protobuf::Timestamp,
    >,
    #[prost(string, optional, tag = "19")]
    pub failed_by: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "20")]
    pub failed_reason: ::core::option::Option<::prost::alloc::string::String>,
}
/// ProcedureExecutionState is the state of an executing procedure.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProcedureExecutionState {
    /// The current values for the global fields in the procedure.
    #[prost(map = "string, message", tag = "1")]
    pub global_fields: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        FieldOutput,
    >,
    /// A map from execution node ID to the execution node.
    #[prost(map = "string, message", tag = "2")]
    pub nodes: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ProcedureExecutionNode,
    >,
    /// Section edges represent the visual grouping of sections and steps.
    /// All keys are IDs for section nodes, and all values are lists of IDs for section or step nodes.
    /// { A, \[B, C\] } means that section A visually groups nodes B and C together.
    #[prost(map = "string, message", tag = "3")]
    pub section_edges: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        super::super::v1::NodeList,
    >,
    /// Step edges represent the dependencies between steps.
    /// All keys and values are IDs for step nodes.
    /// { A, \[B, C\] } means that steps B and C depend on step A to complete to be started
    #[prost(map = "string, message", tag = "4")]
    pub step_edges: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        super::super::v1::NodeList,
    >,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Strings {
    #[prost(string, repeated, tag = "1")]
    pub values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// TODO(pchen): how to handle the value typing here
/// The outputs of a field in a step.
/// This is different from FormFieldValue in that this represents the resolved value after the step has
/// been completed. Eg, this would contain an AssetRid while the FormFieldValue could contain an AssetReference
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FieldOutput {
    /// The oneof can be unset if the field has not been set yet.
    #[prost(oneof = "field_output::Output", tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10")]
    pub output: ::core::option::Option<field_output::Output>,
}
/// Nested message and enum types in `FieldOutput`.
pub mod field_output {
    /// The oneof can be unset if the field has not been set yet.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Output {
        /// TODO(niwong): I think this could actually be buf validated to be required. If a global field is
        /// not yet defined, I think it's just not present in the global_fields map
        /// option (buf.validate.oneof) = {required: true};
        #[prost(string, tag = "1")]
        AssetRid(::prost::alloc::string::String),
        #[prost(string, tag = "2")]
        StringValue(::prost::alloc::string::String),
        #[prost(double, tag = "3")]
        DoubleValue(f64),
        #[prost(bool, tag = "4")]
        BooleanValue(bool),
        #[prost(int64, tag = "5")]
        IntValue(i64),
        #[prost(message, tag = "6")]
        StringsValue(super::Strings),
        #[prost(string, tag = "7")]
        IngestJobRid(::prost::alloc::string::String),
        #[prost(string, tag = "8")]
        RunRid(::prost::alloc::string::String),
        #[prost(message, tag = "9")]
        FileUploadValue(super::FileUploadFieldValue),
        #[prost(message, tag = "10")]
        MultiFileUploadValue(super::MultiFileUploadFieldValue),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateProcedureExecutionRequest {
    #[prost(string, tag = "1")]
    pub procedure_rid: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub procedure_commit_id: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub title: ::prost::alloc::string::String,
    #[prost(string, optional, tag = "4")]
    pub description: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateProcedureExecutionResponse {
    #[prost(message, optional, tag = "1")]
    pub procedure_execution: ::core::option::Option<ProcedureExecution>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartProcedureExecutionRequest {
    #[prost(string, tag = "1")]
    pub procedure_rid: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "2")]
    pub branch_or_commit: ::core::option::Option<
        super::super::super::versioning::v1::BranchOrCommit,
    >,
    #[prost(string, tag = "3")]
    pub title: ::prost::alloc::string::String,
    #[prost(string, optional, tag = "4")]
    pub description: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartProcedureExecutionResponse {
    #[prost(message, optional, tag = "1")]
    pub procedure_execution: ::core::option::Option<ProcedureExecution>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetProcedureExecutionRequest {
    #[prost(string, tag = "1")]
    pub procedure_execution_rid: ::prost::alloc::string::String,
    /// If true, the display graph will be included in the response.
    /// Default is false.
    #[prost(bool, tag = "2")]
    pub include_display_graph: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetProcedureExecutionResponse {
    #[prost(message, optional, tag = "1")]
    pub procedure_execution: ::core::option::Option<ProcedureExecution>,
    /// Included if include_display_graph was set to true. Note that this is the
    /// procedure template's display graph, not the execution graph.
    #[prost(message, optional, tag = "2")]
    pub display_graph: ::core::option::Option<super::super::v1::ProcedureDisplayGraph>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateProcedureExecutionMetadataRequest {
    #[prost(string, tag = "1")]
    pub procedure_execution_rid: ::prost::alloc::string::String,
    #[prost(string, optional, tag = "2")]
    pub title: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "3")]
    pub description: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "4")]
    pub commit_id: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(message, optional, tag = "5")]
    pub labels: ::core::option::Option<super::super::super::types::LabelUpdateWrapper>,
    #[prost(message, optional, tag = "6")]
    pub properties: ::core::option::Option<
        super::super::super::types::PropertyUpdateWrapper,
    >,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateProcedureExecutionMetadataResponse {
    #[prost(message, optional, tag = "1")]
    pub metadata: ::core::option::Option<ProcedureExecutionMetadata>,
}
/// TODO(niwong to pchen): I made an "update metadata" endpoint separately above,
/// I think it'd be nice to turn this into a dedicated endpoint for changing the state of
/// the overall execution (start, succeed, abort, fail)
/// I also think in general we shouldn't be updating the entire ProcedureExecutionState
/// but rather leveraging updateStep.
/// TODO(WB-1879): allow to just update the global fields within the ProcExecState.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateProcedureExecutionRequest {
    #[prost(string, tag = "1")]
    pub procedure_execution_rid: ::prost::alloc::string::String,
    #[prost(string, optional, tag = "2")]
    pub title: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "3")]
    pub description: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "4")]
    pub commit_id: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(message, optional, tag = "5")]
    pub labels: ::core::option::Option<super::super::super::types::LabelUpdateWrapper>,
    #[prost(message, optional, tag = "6")]
    pub properties: ::core::option::Option<
        super::super::super::types::PropertyUpdateWrapper,
    >,
    #[prost(message, optional, tag = "7")]
    pub state: ::core::option::Option<ProcedureExecutionState>,
    #[prost(bool, optional, tag = "8")]
    pub is_aborted: ::core::option::Option<bool>,
    #[prost(message, optional, tag = "9")]
    pub started_at: ::core::option::Option<
        super::super::super::super::google::protobuf::Timestamp,
    >,
    #[prost(message, optional, tag = "10")]
    pub finished_at: ::core::option::Option<
        super::super::super::super::google::protobuf::Timestamp,
    >,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateProcedureExecutionResponse {
    #[prost(message, optional, tag = "1")]
    pub procedure_execution: ::core::option::Option<ProcedureExecution>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateStepRequest {
    #[prost(string, tag = "1")]
    pub procedure_execution_rid: ::prost::alloc::string::String,
    /// The unique identifier of the execution step to update.
    #[prost(string, tag = "2")]
    pub step_id: ::prost::alloc::string::String,
    /// Setting the value of the step's content. This is only allowed if the step is NOT_STARTED
    /// or IN_PROGRESS.
    #[prost(message, optional, tag = "3")]
    pub value: ::core::option::Option<StepContentValue>,
    /// Set whether the step has auto-proceed enabled. This is only allowed if the step is NOT_STARTED.
    /// or IN_PROGRESS.
    #[prost(message, optional, tag = "4")]
    pub auto_proceed_config: ::core::option::Option<super::super::v1::AutoProceedConfig>,
    /// Setting the state of the step. This will occur after the other updates in this request.
    #[prost(message, optional, tag = "5")]
    pub target_state: ::core::option::Option<TargetStepStateRequest>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateStepResponse {
    #[prost(message, optional, tag = "1")]
    pub procedure_execution: ::core::option::Option<ProcedureExecution>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateStepSuccessConditionStatusRequest {
    #[prost(string, tag = "1")]
    pub procedure_execution_rid: ::prost::alloc::string::String,
    /// The unique identifier of the execution step to update.
    #[prost(string, tag = "2")]
    pub step_id: ::prost::alloc::string::String,
    /// Setting the success_condition_status is only allowed if the step is SUBMITTED
    /// and should only be done by the backend while monitoring the condition.
    /// If the step is SKIPPED, the success_condition_status will still be set but
    /// no completion actions will be run and the step's state will not be updated.
    #[prost(message, optional, tag = "3")]
    pub success_condition_status: ::core::option::Option<SuccessConditionStatus>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateStepSuccessConditionStatusResponse {
    #[prost(message, optional, tag = "1")]
    pub procedure_execution: ::core::option::Option<ProcedureExecution>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RepeatStepRequest {
    #[prost(string, tag = "1")]
    pub procedure_execution_rid: ::prost::alloc::string::String,
    /// The unique identifier of the execution step to repeat/duplicate.
    #[prost(string, tag = "2")]
    pub step_id: ::prost::alloc::string::String,
    /// Behavior for how repeating the step will affect dependants.
    #[prost(enumeration = "RepeatStepBehavior", tag = "6")]
    pub behavior: i32,
    /// Setting the value of the step's content.
    #[prost(message, optional, tag = "3")]
    pub value: ::core::option::Option<StepContentValue>,
    /// Set whether the step has auto-proceed enabled.
    #[prost(message, optional, tag = "4")]
    pub auto_proceed_config: ::core::option::Option<super::super::v1::AutoProceedConfig>,
    /// Setting the state of the step. This will occur after the other updates in this request.
    #[prost(message, optional, tag = "5")]
    pub target_state: ::core::option::Option<TargetStepStateRequest>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RepeatStepResponse {
    #[prost(message, optional, tag = "1")]
    pub procedure_execution: ::core::option::Option<ProcedureExecution>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProcedureExecutionSearchQuery {
    #[prost(
        oneof = "procedure_execution_search_query::Query",
        tags = "1, 2, 3, 4, 5, 6, 7, 8, 9"
    )]
    pub query: ::core::option::Option<procedure_execution_search_query::Query>,
}
/// Nested message and enum types in `ProcedureExecutionSearchQuery`.
pub mod procedure_execution_search_query {
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct ProcedureExecutionSearchAndQuery {
        #[prost(message, repeated, tag = "1")]
        pub queries: ::prost::alloc::vec::Vec<super::ProcedureExecutionSearchQuery>,
    }
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct ProcedureExecutionSearchOrQuery {
        #[prost(message, repeated, tag = "1")]
        pub queries: ::prost::alloc::vec::Vec<super::ProcedureExecutionSearchQuery>,
    }
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Query {
        #[prost(string, tag = "1")]
        SearchText(::prost::alloc::string::String),
        #[prost(string, tag = "2")]
        Label(::prost::alloc::string::String),
        #[prost(message, tag = "3")]
        Property(super::super::super::super::types::Property),
        #[prost(message, tag = "4")]
        And(ProcedureExecutionSearchAndQuery),
        #[prost(message, tag = "5")]
        Or(ProcedureExecutionSearchOrQuery),
        #[prost(string, tag = "6")]
        Workspace(::prost::alloc::string::String),
        #[prost(string, tag = "7")]
        ProcedureRid(::prost::alloc::string::String),
        #[prost(string, tag = "8")]
        CommitId(::prost::alloc::string::String),
        #[prost(string, tag = "9")]
        CreatedBy(::prost::alloc::string::String),
    }
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ProcedureExecutionSortOptions {
    #[prost(bool, tag = "1")]
    pub is_descending: bool,
    #[prost(enumeration = "SearchProcedureExecutionsSortField", tag = "2")]
    pub sort_field: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchProcedureExecutionsRequest {
    #[prost(message, optional, tag = "1")]
    pub query: ::core::option::Option<ProcedureExecutionSearchQuery>,
    #[prost(message, optional, tag = "2")]
    pub sort_options: ::core::option::Option<ProcedureExecutionSortOptions>,
    /// Page sizes greater than 1_000 will be rejected. Default pageSize is 100.
    #[prost(int32, optional, tag = "3")]
    pub page_size: ::core::option::Option<i32>,
    #[prost(string, optional, tag = "4")]
    pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchProcedureExecutionsResponse {
    #[prost(message, repeated, tag = "1")]
    pub procedure_executions: ::prost::alloc::vec::Vec<ProcedureExecutionMetadata>,
    #[prost(string, optional, tag = "2")]
    pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchGetProcedureExecutionMetadataRequest {
    #[prost(string, repeated, tag = "1")]
    pub procedure_execution_rids: ::prost::alloc::vec::Vec<
        ::prost::alloc::string::String,
    >,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchGetProcedureExecutionMetadataResponse {
    #[prost(message, repeated, tag = "1")]
    pub procedure_executions: ::prost::alloc::vec::Vec<ProcedureExecutionMetadata>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum RepeatStepBehavior {
    Unspecified = 0,
    /// The targeted step will be repeated, but the original graph will be preserved
    /// and only direct children will be checked for state updates
    Isolated = 1,
}
impl RepeatStepBehavior {
    /// 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 => "REPEAT_STEP_BEHAVIOR_UNSPECIFIED",
            Self::Isolated => "REPEAT_STEP_BEHAVIOR_ISOLATED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "REPEAT_STEP_BEHAVIOR_UNSPECIFIED" => Some(Self::Unspecified),
            "REPEAT_STEP_BEHAVIOR_ISOLATED" => Some(Self::Isolated),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SearchProcedureExecutionsSortField {
    Unspecified = 0,
    CreatedAt = 1,
    StartedAt = 2,
    FinishedAt = 3,
    UpdatedAt = 4,
}
impl SearchProcedureExecutionsSortField {
    /// 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 => "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_UNSPECIFIED",
            Self::CreatedAt => "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_CREATED_AT",
            Self::StartedAt => "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_STARTED_AT",
            Self::FinishedAt => "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_FINISHED_AT",
            Self::UpdatedAt => "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_UPDATED_AT",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_UNSPECIFIED" => {
                Some(Self::Unspecified)
            }
            "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_CREATED_AT" => Some(Self::CreatedAt),
            "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_STARTED_AT" => Some(Self::StartedAt),
            "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_FINISHED_AT" => {
                Some(Self::FinishedAt)
            }
            "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_UPDATED_AT" => Some(Self::UpdatedAt),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ProcedureExecutionsServiceError {
    Unspecified = 0,
    NotFound = 1,
    ProcNotFound = 2,
    NodeNotFound = 3,
    InvalidNode = 4,
    InvalidGraph = 5,
    InvalidStepTransition = 6,
    InvalidSearchToken = 7,
    InvalidStepUpdate = 8,
}
impl ProcedureExecutionsServiceError {
    /// 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 => "PROCEDURE_EXECUTIONS_SERVICE_ERROR_UNSPECIFIED",
            Self::NotFound => "PROCEDURE_EXECUTIONS_SERVICE_ERROR_NOT_FOUND",
            Self::ProcNotFound => "PROCEDURE_EXECUTIONS_SERVICE_ERROR_PROC_NOT_FOUND",
            Self::NodeNotFound => "PROCEDURE_EXECUTIONS_SERVICE_ERROR_NODE_NOT_FOUND",
            Self::InvalidNode => "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_NODE",
            Self::InvalidGraph => "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_GRAPH",
            Self::InvalidStepTransition => {
                "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_STEP_TRANSITION"
            }
            Self::InvalidSearchToken => {
                "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_SEARCH_TOKEN"
            }
            Self::InvalidStepUpdate => {
                "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_STEP_UPDATE"
            }
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "PROCEDURE_EXECUTIONS_SERVICE_ERROR_UNSPECIFIED" => Some(Self::Unspecified),
            "PROCEDURE_EXECUTIONS_SERVICE_ERROR_NOT_FOUND" => Some(Self::NotFound),
            "PROCEDURE_EXECUTIONS_SERVICE_ERROR_PROC_NOT_FOUND" => {
                Some(Self::ProcNotFound)
            }
            "PROCEDURE_EXECUTIONS_SERVICE_ERROR_NODE_NOT_FOUND" => {
                Some(Self::NodeNotFound)
            }
            "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_NODE" => Some(Self::InvalidNode),
            "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_GRAPH" => {
                Some(Self::InvalidGraph)
            }
            "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_STEP_TRANSITION" => {
                Some(Self::InvalidStepTransition)
            }
            "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_SEARCH_TOKEN" => {
                Some(Self::InvalidSearchToken)
            }
            "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_STEP_UPDATE" => {
                Some(Self::InvalidStepUpdate)
            }
            _ => None,
        }
    }
}
/// Generated client implementations.
pub mod procedure_executions_service_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// Service for creating and managing procedure executions.
    #[derive(Debug, Clone)]
    pub struct ProcedureExecutionsServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl ProcedureExecutionsServiceClient<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> ProcedureExecutionsServiceClient<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,
        ) -> ProcedureExecutionsServiceClient<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,
        {
            ProcedureExecutionsServiceClient::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
        }
        /// Create a new procedure execution from a procedure
        pub async fn create_procedure_execution(
            &mut self,
            request: impl tonic::IntoRequest<super::CreateProcedureExecutionRequest>,
        ) -> std::result::Result<
            tonic::Response<super::CreateProcedureExecutionResponse>,
            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(
                "/nominal.procedures.executions.v1.ProcedureExecutionsService/CreateProcedureExecution",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.procedures.executions.v1.ProcedureExecutionsService",
                        "CreateProcedureExecution",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Create a new procedure execution from a procedure and starts the first node, if possible
        pub async fn start_procedure_execution(
            &mut self,
            request: impl tonic::IntoRequest<super::StartProcedureExecutionRequest>,
        ) -> std::result::Result<
            tonic::Response<super::StartProcedureExecutionResponse>,
            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(
                "/nominal.procedures.executions.v1.ProcedureExecutionsService/StartProcedureExecution",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.procedures.executions.v1.ProcedureExecutionsService",
                        "StartProcedureExecution",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Get a procedure execution by its RID
        pub async fn get_procedure_execution(
            &mut self,
            request: impl tonic::IntoRequest<super::GetProcedureExecutionRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GetProcedureExecutionResponse>,
            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(
                "/nominal.procedures.executions.v1.ProcedureExecutionsService/GetProcedureExecution",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.procedures.executions.v1.ProcedureExecutionsService",
                        "GetProcedureExecution",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Update the metadata of a procedure execution
        pub async fn update_procedure_execution_metadata(
            &mut self,
            request: impl tonic::IntoRequest<
                super::UpdateProcedureExecutionMetadataRequest,
            >,
        ) -> std::result::Result<
            tonic::Response<super::UpdateProcedureExecutionMetadataResponse>,
            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(
                "/nominal.procedures.executions.v1.ProcedureExecutionsService/UpdateProcedureExecutionMetadata",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.procedures.executions.v1.ProcedureExecutionsService",
                        "UpdateProcedureExecutionMetadata",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Heavy-handed update method for procedure execution
        /// TODO(pchen): This isn't the expected final endpoint, this is just for editing the graph while we iterate
        /// There likely be additional fine-grained methods for editing the procedure
        pub async fn update_procedure_execution(
            &mut self,
            request: impl tonic::IntoRequest<super::UpdateProcedureExecutionRequest>,
        ) -> std::result::Result<
            tonic::Response<super::UpdateProcedureExecutionResponse>,
            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(
                "/nominal.procedures.executions.v1.ProcedureExecutionsService/UpdateProcedureExecution",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.procedures.executions.v1.ProcedureExecutionsService",
                        "UpdateProcedureExecution",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Update the status of a step in a procedure execution. This can only be done if the step is NOT_STARTED,
        /// IN_PROGRESS, or SUBMITTED. Other state transitions are managed by the backend.
        pub async fn update_step(
            &mut self,
            request: impl tonic::IntoRequest<super::UpdateStepRequest>,
        ) -> std::result::Result<
            tonic::Response<super::UpdateStepResponse>,
            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(
                "/nominal.procedures.executions.v1.ProcedureExecutionsService/UpdateStep",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.procedures.executions.v1.ProcedureExecutionsService",
                        "UpdateStep",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// This should only be called by the backend to update the success_condition_status of a step.
        /// This can only be done if the step is SUBMITTED.
        pub async fn update_step_success_condition_status(
            &mut self,
            request: impl tonic::IntoRequest<
                super::UpdateStepSuccessConditionStatusRequest,
            >,
        ) -> std::result::Result<
            tonic::Response<super::UpdateStepSuccessConditionStatusResponse>,
            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(
                "/nominal.procedures.executions.v1.ProcedureExecutionsService/UpdateStepSuccessConditionStatus",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.procedures.executions.v1.ProcedureExecutionsService",
                        "UpdateStepSuccessConditionStatus",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Repeat a previously finished step in a procedure execution. This can only be done if the given step
        /// is in state SUCCEEDED, SKIPPED or ERRORED. Other state transitions are managed by the backend.
        pub async fn repeat_step(
            &mut self,
            request: impl tonic::IntoRequest<super::RepeatStepRequest>,
        ) -> std::result::Result<
            tonic::Response<super::RepeatStepResponse>,
            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(
                "/nominal.procedures.executions.v1.ProcedureExecutionsService/RepeatStep",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.procedures.executions.v1.ProcedureExecutionsService",
                        "RepeatStep",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Search for procedure executions
        pub async fn search_procedure_executions(
            &mut self,
            request: impl tonic::IntoRequest<super::SearchProcedureExecutionsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::SearchProcedureExecutionsResponse>,
            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(
                "/nominal.procedures.executions.v1.ProcedureExecutionsService/SearchProcedureExecutions",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.procedures.executions.v1.ProcedureExecutionsService",
                        "SearchProcedureExecutions",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Batch get procedure execution metadata
        pub async fn batch_get_procedure_execution_metadata(
            &mut self,
            request: impl tonic::IntoRequest<
                super::BatchGetProcedureExecutionMetadataRequest,
            >,
        ) -> std::result::Result<
            tonic::Response<super::BatchGetProcedureExecutionMetadataResponse>,
            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(
                "/nominal.procedures.executions.v1.ProcedureExecutionsService/BatchGetProcedureExecutionMetadata",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.procedures.executions.v1.ProcedureExecutionsService",
                        "BatchGetProcedureExecutionMetadata",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
