Skip to main content

nominal_api/proto/
nominal.procedures.executions.v1.rs

1// This file is @generated by prost-build.
2/// A procedure execution node is either a section or a step.
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct ProcedureExecutionNode {
5    #[prost(oneof = "procedure_execution_node::Node", tags = "1, 2")]
6    pub node: ::core::option::Option<procedure_execution_node::Node>,
7}
8/// Nested message and enum types in `ProcedureExecutionNode`.
9pub mod procedure_execution_node {
10    #[derive(Clone, PartialEq, ::prost::Oneof)]
11    pub enum Node {
12        /// A section node is a visual grouping of other sections and steps.
13        /// Execution sections are static and do not have execution state.
14        #[prost(message, tag = "1")]
15        Section(super::ProcedureExecutionSectionNode),
16        /// Execution steps are the interactive steps in a procedure.
17        #[prost(message, tag = "2")]
18        Step(super::ProcedureExecutionStepNode),
19    }
20}
21/// A section node is a visual grouping of other sections and steps.
22#[derive(Clone, PartialEq, ::prost::Message)]
23pub struct ProcedureExecutionSectionNode {
24    /// Unique identifier of this execution node.
25    #[prost(string, tag = "1")]
26    pub id: ::prost::alloc::string::String,
27    /// Unique identifier of the template node this execution node is based on.
28    #[prost(string, tag = "2")]
29    pub template_node_id: ::prost::alloc::string::String,
30    /// Title of this section. Uses the template section's title and cannot be changed in execution.
31    #[prost(string, tag = "3")]
32    pub title: ::prost::alloc::string::String,
33    /// Description of this section. Uses the template section's description and cannot be changed in execution.
34    #[prost(string, optional, tag = "4")]
35    pub description: ::core::option::Option<::prost::alloc::string::String>,
36    /// If set, the commit ID of the procedure template this section is based on.
37    /// Otherwise, the section is based on the template commit specified at the top level of the execution.
38    #[prost(string, optional, tag = "5")]
39    pub template_commit_id: ::core::option::Option<::prost::alloc::string::String>,
40}
41/// Execution steps are the interactive steps in a procedure.
42#[derive(Clone, PartialEq, ::prost::Message)]
43pub struct ProcedureExecutionStepNode {
44    /// Unique identifier of this execution node.
45    #[prost(string, tag = "1")]
46    pub id: ::prost::alloc::string::String,
47    /// Unique identifier of the template node this execution node is based on.
48    #[prost(string, tag = "2")]
49    pub template_node_id: ::prost::alloc::string::String,
50    /// Execution steps become "outdated" once any upstream steps are re-run
51    /// An outdated execution step should not be further modified.
52    #[prost(bool, tag = "3")]
53    pub is_outdated: bool,
54    /// The current status of the step along with metadata about the status transitions.
55    #[prost(message, optional, tag = "4")]
56    pub state: ::core::option::Option<ExecutionStepState>,
57    /// The current value for the content of the step.
58    #[prost(message, optional, tag = "5")]
59    pub value: ::core::option::Option<StepContentValue>,
60    /// Whether the step has auto-proceed enabled.
61    #[prost(message, optional, tag = "6")]
62    pub auto_proceed_config: ::core::option::Option<super::super::v1::AutoProceedConfig>,
63    /// Completion_condition_status is the status of the completion condition for the step
64    /// The backend manages this property and will update it while it monitors the
65    /// completion_condition if set.
66    /// This property will be unset if no completion_condition is set on the step or
67    /// if the execution step's contents has not been submitted yet.
68    #[prost(message, optional, tag = "7")]
69    pub success_condition_status: ::core::option::Option<SuccessConditionStatus>,
70    /// Completion_action_statuses are the status of the completion actions for the step
71    /// The backend manages this property and will update it after performing
72    /// completion_actions.
73    #[prost(message, repeated, tag = "8")]
74    pub completion_action_statuses: ::prost::alloc::vec::Vec<CompletionActionStatus>,
75    /// Outputs are the values of the fields within this step, set by the backend after the step has reached
76    /// the SUCCEEDED state.
77    /// The backend will know how to introspect the node and determine these values, for example looking for
78    /// form fields with ids in a FormStep.
79    /// These outputs can be consumed by other steps later in the procedure by referencing `{output_id}:{field_id}`
80    #[prost(map = "string, message", tag = "10")]
81    pub outputs: ::std::collections::HashMap<
82        ::prost::alloc::string::String,
83        FieldOutput,
84    >,
85    /// If set, the commit ID of the procedure template this step is based on.
86    /// Otherwise, the step is based on the template commit specified at the top level of the execution.
87    #[prost(string, optional, tag = "11")]
88    pub template_commit_id: ::core::option::Option<::prost::alloc::string::String>,
89}
90/// All execution steps start in the NOT_STARTED state.
91/// In this state, the step's values can be modified by the user.
92#[derive(Clone, Copy, PartialEq, ::prost::Message)]
93pub struct ExecutionStepNotStarted {}
94/// An execution step is in the SKIPPED state if it was skipped by a user.
95/// An execution step cannot be skipped if it is in a terminal state (SUCCEEDED or ERRORED).
96/// This is a terminal state, the step's values cannot be modified by the user.
97#[derive(Clone, PartialEq, ::prost::Message)]
98pub struct ExecutionStepSkipped {
99    #[prost(message, optional, tag = "1")]
100    pub skipped_at: ::core::option::Option<
101        super::super::super::super::google::protobuf::Timestamp,
102    >,
103    #[prost(string, tag = "2")]
104    pub skipped_by: ::prost::alloc::string::String,
105    #[prost(string, optional, tag = "3")]
106    pub skip_reason: ::core::option::Option<::prost::alloc::string::String>,
107    /// Optional because a step can be skipped from the NOT_STARTED state before these are set
108    #[prost(message, optional, tag = "4")]
109    pub started_at: ::core::option::Option<
110        super::super::super::super::google::protobuf::Timestamp,
111    >,
112    #[prost(string, optional, tag = "5")]
113    pub started_by: ::core::option::Option<::prost::alloc::string::String>,
114    /// Optional because a step can be skipped from the IN_PROGRESS state before these are set
115    #[prost(message, optional, tag = "6")]
116    pub submitted_at: ::core::option::Option<
117        super::super::super::super::google::protobuf::Timestamp,
118    >,
119    #[prost(string, optional, tag = "7")]
120    pub submitted_by: ::core::option::Option<::prost::alloc::string::String>,
121}
122/// An execution step is in the IN_PROGRESS state once it has been started from NOT_STARTED,
123/// either manually or automatically.
124/// In this state, the step's values can be modified by the user.
125#[derive(Clone, PartialEq, ::prost::Message)]
126pub struct ExecutionStepInProgress {
127    #[prost(message, optional, tag = "1")]
128    pub started_at: ::core::option::Option<
129        super::super::super::super::google::protobuf::Timestamp,
130    >,
131    #[prost(string, tag = "2")]
132    pub started_by: ::prost::alloc::string::String,
133}
134/// An execution step is in the SUBMITTED state once it has been submitted from the IN_PROGRESS state,
135/// either manually or automatically.
136/// In this state, the step's values are considered submitted and cannot be modified by the user.
137/// In this state, the backend will monitor the completion condition (if any) and execute the completion
138/// actions (if any) once the condition is satisfied.
139#[derive(Clone, PartialEq, ::prost::Message)]
140pub struct ExecutionStepSubmitted {
141    #[prost(message, optional, tag = "1")]
142    pub started_at: ::core::option::Option<
143        super::super::super::super::google::protobuf::Timestamp,
144    >,
145    #[prost(string, tag = "2")]
146    pub started_by: ::prost::alloc::string::String,
147    #[prost(message, optional, tag = "3")]
148    pub submitted_at: ::core::option::Option<
149        super::super::super::super::google::protobuf::Timestamp,
150    >,
151    #[prost(string, tag = "4")]
152    pub submitted_by: ::prost::alloc::string::String,
153}
154/// An execution step reaches the SUCCEEDED state if all conditions were met and all actions successfully ran.
155/// This is a terminal state, the step's values cannot be modified by the user.
156#[derive(Clone, PartialEq, ::prost::Message)]
157pub struct ExecutionStepSucceeded {
158    #[prost(message, optional, tag = "1")]
159    pub started_at: ::core::option::Option<
160        super::super::super::super::google::protobuf::Timestamp,
161    >,
162    #[prost(string, tag = "2")]
163    pub started_by: ::prost::alloc::string::String,
164    #[prost(message, optional, tag = "3")]
165    pub submitted_at: ::core::option::Option<
166        super::super::super::super::google::protobuf::Timestamp,
167    >,
168    #[prost(string, tag = "4")]
169    pub submitted_by: ::prost::alloc::string::String,
170    #[prost(message, optional, tag = "5")]
171    pub succeeded_at: ::core::option::Option<
172        super::super::super::super::google::protobuf::Timestamp,
173    >,
174    #[prost(string, tag = "6")]
175    pub succeeded_by: ::prost::alloc::string::String,
176}
177/// An execution step reaches the ERRORED state if something went wrong while trying to complete the step.
178/// This could be due to a badly configured procedure, an error/timeout in the completion condition,
179/// or an error/timeout in one of the completion actions.
180/// This is a terminal state, the step's values cannot be modified by the user.
181#[derive(Clone, PartialEq, ::prost::Message)]
182pub struct ExecutionStepErrored {
183    /// Optinal because a step can be skipped -> errored before being started
184    #[prost(message, optional, tag = "1")]
185    pub started_at: ::core::option::Option<
186        super::super::super::super::google::protobuf::Timestamp,
187    >,
188    #[prost(string, optional, tag = "2")]
189    pub started_by: ::core::option::Option<::prost::alloc::string::String>,
190    /// Optional because a step can be errored before being submitted
191    #[prost(message, optional, tag = "3")]
192    pub submitted_at: ::core::option::Option<
193        super::super::super::super::google::protobuf::Timestamp,
194    >,
195    #[prost(string, optional, tag = "4")]
196    pub submitted_by: ::core::option::Option<::prost::alloc::string::String>,
197    #[prost(message, optional, tag = "5")]
198    pub errored_at: ::core::option::Option<
199        super::super::super::super::google::protobuf::Timestamp,
200    >,
201    #[prost(string, tag = "6")]
202    pub errored_by: ::prost::alloc::string::String,
203    #[prost(string, tag = "7")]
204    pub error: ::prost::alloc::string::String,
205    /// Optional because a step could be skipped but then error while running completion actions
206    #[prost(message, optional, tag = "8")]
207    pub skipped_at: ::core::option::Option<
208        super::super::super::super::google::protobuf::Timestamp,
209    >,
210    #[prost(string, optional, tag = "9")]
211    pub skipped_by: ::core::option::Option<::prost::alloc::string::String>,
212    #[prost(string, optional, tag = "10")]
213    pub skip_reason: ::core::option::Option<::prost::alloc::string::String>,
214    /// Optional because a step can succeed but then error while running completion actions
215    #[prost(message, optional, tag = "11")]
216    pub succeeded_at: ::core::option::Option<
217        super::super::super::super::google::protobuf::Timestamp,
218    >,
219    #[prost(string, optional, tag = "12")]
220    pub succeeded_by: ::core::option::Option<::prost::alloc::string::String>,
221}
222/// The read-side state for an execution step.
223/// Here is the state machine:
224/// All steps start in the NOT_STARTED state.
225/// From NOT_STARTED, a step can transition to IN_PROGRESS or SKIPPED.
226/// - Transitioning to IN_PROGRESS can be done manually by a user or automatically if auto-start is enabled.
227///    This transition can only happen if the step's dependencies are in a completed state (SUCCEEDED or SKIPPED)
228/// From IN_PROGRESS, a step can transition to SUBMITTED or SKIPPED.
229/// - Transitioning to SUBMITTED can be done manually by a user or automatically if auto-proceed is enabled.
230///    This transition can only happen if the step's content has its required values set.
231/// - Transitioning to SKIPPED can be done manually by a user.
232/// From SUBMITTED, a step can transition to SUCCEEDED, ERRORED, or SKIPPED.
233/// - Transitioning to SUCCEEDED or ERRORED is done by the backend after monitoring the completion
234///    condition (if any) and executing the completion actions (if any).
235/// - Transitioning to SKIPPED can be done manually by a user.
236#[derive(Clone, PartialEq, ::prost::Message)]
237pub struct ExecutionStepState {
238    #[prost(oneof = "execution_step_state::State", tags = "1, 2, 3, 4, 5, 6")]
239    pub state: ::core::option::Option<execution_step_state::State>,
240}
241/// Nested message and enum types in `ExecutionStepState`.
242pub mod execution_step_state {
243    #[derive(Clone, PartialEq, ::prost::Oneof)]
244    pub enum State {
245        #[prost(message, tag = "1")]
246        NotStarted(super::ExecutionStepNotStarted),
247        #[prost(message, tag = "2")]
248        InProgress(super::ExecutionStepInProgress),
249        #[prost(message, tag = "3")]
250        Submitted(super::ExecutionStepSubmitted),
251        /// Terminal states below
252        #[prost(message, tag = "4")]
253        Skipped(super::ExecutionStepSkipped),
254        #[prost(message, tag = "5")]
255        Succeeded(super::ExecutionStepSucceeded),
256        #[prost(message, tag = "6")]
257        Errored(super::ExecutionStepErrored),
258    }
259}
260#[derive(Clone, Copy, PartialEq, ::prost::Message)]
261pub struct StepInProgressRequest {}
262#[derive(Clone, Copy, PartialEq, ::prost::Message)]
263pub struct StepSubmittedRequest {}
264#[derive(Clone, PartialEq, ::prost::Message)]
265pub struct StepSkippedRequest {
266    #[prost(string, optional, tag = "1")]
267    pub skip_reason: ::core::option::Option<::prost::alloc::string::String>,
268}
269#[derive(Clone, PartialEq, ::prost::Message)]
270pub struct StepErroredRequest {
271    #[prost(string, optional, tag = "1")]
272    pub error_reason: ::core::option::Option<::prost::alloc::string::String>,
273}
274/// A request to update the state of an execution step.
275#[derive(Clone, PartialEq, ::prost::Message)]
276pub struct TargetStepStateRequest {
277    #[prost(oneof = "target_step_state_request::TargetState", tags = "1, 2, 3, 4")]
278    pub target_state: ::core::option::Option<target_step_state_request::TargetState>,
279}
280/// Nested message and enum types in `TargetStepStateRequest`.
281pub mod target_step_state_request {
282    #[derive(Clone, PartialEq, ::prost::Oneof)]
283    pub enum TargetState {
284        #[prost(message, tag = "1")]
285        InProgress(super::StepInProgressRequest),
286        #[prost(message, tag = "2")]
287        Submitted(super::StepSubmittedRequest),
288        #[prost(message, tag = "3")]
289        Skipped(super::StepSkippedRequest),
290        #[prost(message, tag = "4")]
291        Errored(super::StepErroredRequest),
292    }
293}
294#[derive(Clone, PartialEq, ::prost::Message)]
295pub struct ProcedureAsyncTask {
296    #[prost(oneof = "procedure_async_task::Task", tags = "1")]
297    pub task: ::core::option::Option<procedure_async_task::Task>,
298}
299/// Nested message and enum types in `ProcedureAsyncTask`.
300pub mod procedure_async_task {
301    #[derive(Clone, PartialEq, ::prost::Oneof)]
302    pub enum Task {
303        #[prost(message, tag = "1")]
304        ConditionObservation(super::ConditionObservation),
305    }
306}
307#[derive(Clone, PartialEq, ::prost::Message)]
308pub struct ConditionObservation {
309    #[prost(string, tag = "1")]
310    pub user_rid: ::prost::alloc::string::String,
311    #[prost(string, tag = "2")]
312    pub org_rid: ::prost::alloc::string::String,
313    #[prost(string, tag = "3")]
314    pub procedure_execution_rid: ::prost::alloc::string::String,
315    #[prost(string, tag = "4")]
316    pub step_id: ::prost::alloc::string::String,
317    #[prost(message, optional, tag = "5")]
318    pub success_condition: ::core::option::Option<super::super::v1::SuccessCondition>,
319}
320/// Represents the current status of one or more nested completion conditions.
321/// Mirrors the recursive SuccessCondition in nominal.procedures.v1
322#[derive(Clone, PartialEq, ::prost::Message)]
323pub struct SuccessConditionStatus {
324    /// The type of condition being monitored.
325    #[prost(oneof = "success_condition_status::Condition", tags = "1, 6, 7, 9")]
326    pub condition: ::core::option::Option<success_condition_status::Condition>,
327    /// The status of this condition.
328    #[prost(oneof = "success_condition_status::Status", tags = "2, 3, 4, 5, 8")]
329    pub status: ::core::option::Option<success_condition_status::Status>,
330}
331/// Nested message and enum types in `SuccessConditionStatus`.
332pub mod success_condition_status {
333    /// The type of condition being monitored.
334    #[derive(Clone, PartialEq, ::prost::Oneof)]
335    pub enum Condition {
336        #[prost(message, tag = "1")]
337        And(super::AndSuccessCondition),
338        #[prost(message, tag = "6")]
339        Timer(super::super::super::v1::TimerSuccessCondition),
340        #[prost(message, tag = "7")]
341        IngestJob(super::super::super::v1::IngestJobSuccessCondition),
342        /// OrSuccessConditionOrStatus or = 5;
343        #[prost(message, tag = "9")]
344        ChannelValidation(super::ChannelValidationSuccessConditionStatus),
345    }
346    /// The status of this condition.
347    #[derive(Clone, PartialEq, ::prost::Oneof)]
348    pub enum Status {
349        #[prost(message, tag = "2")]
350        InProgress(super::SuccessConditionInProgress),
351        #[prost(message, tag = "3")]
352        Satisfied(super::SuccessConditionSatisfied),
353        #[prost(message, tag = "4")]
354        Failed(super::SuccessConditionFailed),
355        #[prost(message, tag = "5")]
356        Canceled(super::SuccessConditionCanceled),
357        #[prost(message, tag = "8")]
358        Submitted(super::SuccessConditionSubmitted),
359    }
360}
361#[derive(Clone, PartialEq, ::prost::Message)]
362pub struct ChannelValidationSuccessConditionStatus {
363    #[prost(message, optional, tag = "9")]
364    pub condition: ::core::option::Option<
365        super::super::v1::ChannelValidationSuccessCondition,
366    >,
367    /// Persistence tracking state for channel validation conditions.
368    /// Tracks consecutive successful evaluations for point_persistence.
369    #[prost(int32, optional, tag = "2")]
370    pub consecutive_matches: ::core::option::Option<i32>,
371    /// Timestamp when the condition first became satisfied.
372    /// Used for time_persistence to track how long the condition has held true.
373    #[prost(message, optional, tag = "3")]
374    pub first_satisfied_at: ::core::option::Option<
375        super::super::super::super::google::protobuf::Timestamp,
376    >,
377}
378#[derive(Clone, PartialEq, ::prost::Message)]
379pub struct AndSuccessCondition {
380    #[prost(message, repeated, tag = "1")]
381    pub conditions: ::prost::alloc::vec::Vec<SuccessConditionStatus>,
382}
383#[derive(Clone, Copy, PartialEq, ::prost::Message)]
384pub struct SuccessConditionSubmitted {
385    #[prost(message, optional, tag = "1")]
386    pub submitted_at: ::core::option::Option<
387        super::super::super::super::google::protobuf::Timestamp,
388    >,
389}
390#[derive(Clone, Copy, PartialEq, ::prost::Message)]
391pub struct SuccessConditionInProgress {
392    #[prost(message, optional, tag = "1")]
393    pub started_at: ::core::option::Option<
394        super::super::super::super::google::protobuf::Timestamp,
395    >,
396}
397#[derive(Clone, Copy, PartialEq, ::prost::Message)]
398pub struct SuccessConditionSatisfied {
399    #[prost(message, optional, tag = "1")]
400    pub started_at: ::core::option::Option<
401        super::super::super::super::google::protobuf::Timestamp,
402    >,
403    #[prost(message, optional, tag = "2")]
404    pub satisfied_at: ::core::option::Option<
405        super::super::super::super::google::protobuf::Timestamp,
406    >,
407}
408#[derive(Clone, PartialEq, ::prost::Message)]
409pub struct SuccessConditionFailed {
410    #[prost(message, optional, tag = "1")]
411    pub started_at: ::core::option::Option<
412        super::super::super::super::google::protobuf::Timestamp,
413    >,
414    #[prost(message, optional, tag = "2")]
415    pub failed_at: ::core::option::Option<
416        super::super::super::super::google::protobuf::Timestamp,
417    >,
418    #[prost(string, tag = "3")]
419    pub failure_reason: ::prost::alloc::string::String,
420}
421#[derive(Clone, Copy, PartialEq, ::prost::Message)]
422pub struct SuccessConditionCanceled {
423    #[prost(message, optional, tag = "1")]
424    pub started_at: ::core::option::Option<
425        super::super::super::super::google::protobuf::Timestamp,
426    >,
427    #[prost(message, optional, tag = "2")]
428    pub canceled_at: ::core::option::Option<
429        super::super::super::super::google::protobuf::Timestamp,
430    >,
431}
432/// The status of a completion action and its result (if any).
433#[derive(Clone, PartialEq, ::prost::Message)]
434pub struct CompletionActionStatus {
435    #[prost(message, optional, tag = "1")]
436    pub state: ::core::option::Option<CompletionActionState>,
437    /// This is intentionally not a required oneof
438    #[prost(oneof = "completion_action_status::Result", tags = "2, 3, 4, 5")]
439    pub result: ::core::option::Option<completion_action_status::Result>,
440}
441/// Nested message and enum types in `CompletionActionStatus`.
442pub mod completion_action_status {
443    /// This is intentionally not a required oneof
444    #[derive(Clone, PartialEq, ::prost::Oneof)]
445    pub enum Result {
446        #[prost(message, tag = "2")]
447        CreateEvent(super::CreateEventResult),
448        #[prost(message, tag = "3")]
449        CreateRun(super::CreateRunResult),
450        #[prost(message, tag = "4")]
451        ApplyWorkbookTemplates(super::ApplyWorkbookTemplatesResult),
452        /// ...
453        #[prost(message, tag = "5")]
454        ApplyChecklists(super::ApplyChecklistsResult),
455    }
456}
457/// A CreateEvent action results in an EventRid if successful.
458#[derive(Clone, PartialEq, ::prost::Message)]
459pub struct CreateEventResult {
460    #[prost(string, tag = "1")]
461    pub event_rid: ::prost::alloc::string::String,
462}
463/// A CreateRun action results in a RunRid if successful.
464#[derive(Clone, PartialEq, ::prost::Message)]
465pub struct CreateRunResult {
466    #[prost(string, tag = "1")]
467    pub run_rid: ::prost::alloc::string::String,
468}
469/// An ApplyWorkbookTemplates action results in a list of workbook RIDs if successful.
470#[derive(Clone, PartialEq, ::prost::Message)]
471pub struct ApplyWorkbookTemplatesResult {
472    #[prost(string, repeated, tag = "1")]
473    pub workbook_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
474}
475/// An ApplyChecklists action results in a list of DataReviewRids if successful.
476#[derive(Clone, PartialEq, ::prost::Message)]
477pub struct ApplyChecklistsResult {
478    #[prost(string, repeated, tag = "1")]
479    pub data_review_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
480}
481#[derive(Clone, PartialEq, ::prost::Message)]
482pub struct CompletionActionState {
483    #[prost(oneof = "completion_action_state::State", tags = "1, 2, 3")]
484    pub state: ::core::option::Option<completion_action_state::State>,
485}
486/// Nested message and enum types in `CompletionActionState`.
487pub mod completion_action_state {
488    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
489    pub struct NotRun {}
490    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
491    pub struct Succeeded {}
492    #[derive(Clone, PartialEq, ::prost::Oneof)]
493    pub enum State {
494        /// The action was not run
495        #[prost(message, tag = "1")]
496        NotRun(NotRun),
497        /// The action was run and succeeded. The result is available in CompletionActionStatus.result
498        #[prost(message, tag = "2")]
499        Succeeded(Succeeded),
500        /// The action was run and errored. This field contains the error message.
501        #[prost(string, tag = "3")]
502        Error(::prost::alloc::string::String),
503    }
504}
505/// The value for a step's content. Should match the ProcedureStepNode type.
506#[derive(Clone, PartialEq, ::prost::Message)]
507pub struct StepContentValue {
508    #[prost(oneof = "step_content_value::Value", tags = "1, 2, 3, 4")]
509    pub value: ::core::option::Option<step_content_value::Value>,
510}
511/// Nested message and enum types in `StepContentValue`.
512pub mod step_content_value {
513    #[derive(Clone, PartialEq, ::prost::Oneof)]
514    pub enum Value {
515        #[prost(message, tag = "1")]
516        Form(super::FormStepValue),
517        #[prost(message, tag = "2")]
518        StartIngest(super::StartIngestStepValue),
519        #[prost(message, tag = "3")]
520        SelectOrCreateAsset(super::SelectOrCreateAssetStepValue),
521        /// ...
522        #[prost(message, tag = "4")]
523        Wait(super::WaitStepValue),
524    }
525}
526#[derive(Clone, Copy, PartialEq, ::prost::Message)]
527pub struct WaitStepValue {}
528#[derive(Clone, PartialEq, ::prost::Message)]
529pub struct FormStepValue {
530    #[prost(message, repeated, tag = "1")]
531    pub fields: ::prost::alloc::vec::Vec<FormFieldValue>,
532}
533#[derive(Clone, PartialEq, ::prost::Message)]
534pub struct StartIngestStepValue {
535    /// The RID of the ingest job that was started by the client.
536    /// This must be populated for the step to be submitted.
537    #[prost(string, optional, tag = "1")]
538    pub ingest_job_rid: ::core::option::Option<::prost::alloc::string::String>,
539}
540#[derive(Clone, PartialEq, ::prost::Message)]
541pub struct SelectOrCreateAssetStepValue {
542    /// The asset that was selected / created by the client.
543    /// This must be populated for the step to be submitted.
544    #[prost(message, optional, tag = "1")]
545    pub asset_reference: ::core::option::Option<super::super::v1::AssetReference>,
546}
547/// The value chosen for a form field.
548/// This differs from FieldOutput in that this should map 1:1 with FormField types,
549/// while FieldOutput contains the resolved values after the execution step is complete.
550#[derive(Clone, PartialEq, ::prost::Message)]
551pub struct FormFieldValue {
552    #[prost(oneof = "form_field_value::Field", tags = "1, 2, 3, 4, 5, 6, 7, 8, 9")]
553    pub field: ::core::option::Option<form_field_value::Field>,
554}
555/// Nested message and enum types in `FormFieldValue`.
556pub mod form_field_value {
557    #[derive(Clone, PartialEq, ::prost::Oneof)]
558    pub enum Field {
559        #[prost(message, tag = "1")]
560        Asset(super::AssetFieldValue),
561        #[prost(message, tag = "2")]
562        Checkbox(super::CheckboxFieldValue),
563        #[prost(message, tag = "3")]
564        Text(super::TextFieldValue),
565        #[prost(message, tag = "4")]
566        Int(super::IntFieldValue),
567        #[prost(message, tag = "5")]
568        Double(super::DoubleFieldValue),
569        #[prost(message, tag = "6")]
570        SingleEnum(super::SingleEnumFieldValue),
571        #[prost(message, tag = "7")]
572        MultiEnum(super::MultiEnumFieldValue),
573        #[prost(message, tag = "8")]
574        FileUpload(super::FileUploadFieldValue),
575        #[prost(message, tag = "9")]
576        MultiFileUpload(super::MultiFileUploadFieldValue),
577    }
578}
579#[derive(Clone, PartialEq, ::prost::Message)]
580pub struct AssetFieldValue {
581    /// This oneof will be unset if no asset is set on the field.
582    #[prost(oneof = "asset_field_value::Asset", tags = "1")]
583    pub asset: ::core::option::Option<asset_field_value::Asset>,
584}
585/// Nested message and enum types in `AssetFieldValue`.
586pub mod asset_field_value {
587    /// This oneof will be unset if no asset is set on the field.
588    #[derive(Clone, PartialEq, ::prost::Oneof)]
589    pub enum Asset {
590        #[prost(message, tag = "1")]
591        AssetReference(super::super::super::v1::AssetReference),
592    }
593}
594#[derive(Clone, Copy, PartialEq, ::prost::Message)]
595pub struct CheckboxFieldValue {
596    /// Default to false if not set
597    #[prost(bool, tag = "1")]
598    pub value: bool,
599}
600#[derive(Clone, PartialEq, ::prost::Message)]
601pub struct TextFieldValue {
602    /// Default to empty string if not set
603    #[prost(string, optional, tag = "1")]
604    pub value: ::core::option::Option<::prost::alloc::string::String>,
605}
606#[derive(Clone, Copy, PartialEq, ::prost::Message)]
607pub struct IntFieldValue {
608    #[prost(int64, optional, tag = "1")]
609    pub value: ::core::option::Option<i64>,
610}
611#[derive(Clone, Copy, PartialEq, ::prost::Message)]
612pub struct DoubleFieldValue {
613    #[prost(double, optional, tag = "1")]
614    pub value: ::core::option::Option<f64>,
615}
616#[derive(Clone, PartialEq, ::prost::Message)]
617pub struct SingleEnumFieldValue {
618    /// Default to empty string if not set
619    #[prost(string, optional, tag = "1")]
620    pub value: ::core::option::Option<::prost::alloc::string::String>,
621}
622#[derive(Clone, PartialEq, ::prost::Message)]
623pub struct MultiEnumFieldValue {
624    /// Default to empty list if not set
625    #[prost(string, repeated, tag = "1")]
626    pub value: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
627}
628/// Corresponds to usage of the upload api
629#[derive(Clone, PartialEq, ::prost::Message)]
630pub struct FileUploadFieldValue {
631    #[prost(oneof = "file_upload_field_value::UploadType", tags = "1")]
632    pub upload_type: ::core::option::Option<file_upload_field_value::UploadType>,
633}
634/// Nested message and enum types in `FileUploadFieldValue`.
635pub mod file_upload_field_value {
636    #[derive(Clone, PartialEq, ::prost::Oneof)]
637    pub enum UploadType {
638        #[prost(message, tag = "1")]
639        S3Upload(super::S3UploadFileValue),
640    }
641}
642#[derive(Clone, PartialEq, ::prost::Message)]
643pub struct S3UploadFileValue {
644    /// The S3 path where the uploaded file is stored
645    #[prost(string, tag = "1")]
646    pub s3_path: ::prost::alloc::string::String,
647    /// The original filename of the uploaded file
648    #[prost(string, tag = "2")]
649    pub file_name: ::prost::alloc::string::String,
650    /// The MIME type of the uploaded file
651    /// 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)
652    #[prost(string, optional, tag = "3")]
653    pub file_type: ::core::option::Option<::prost::alloc::string::String>,
654}
655#[derive(Clone, PartialEq, ::prost::Message)]
656pub struct MultiFileUploadFieldValue {
657    /// The list of uploads
658    #[prost(message, repeated, tag = "1")]
659    pub uploads: ::prost::alloc::vec::Vec<FileUploadFieldValue>,
660}
661#[derive(Clone, PartialEq, ::prost::Message)]
662pub struct ProcedureExecution {
663    #[prost(string, tag = "1")]
664    pub rid: ::prost::alloc::string::String,
665    #[prost(message, optional, tag = "2")]
666    pub metadata: ::core::option::Option<ProcedureExecutionMetadata>,
667    #[prost(message, optional, tag = "3")]
668    pub state: ::core::option::Option<ProcedureExecutionState>,
669}
670#[derive(Clone, PartialEq, ::prost::Message)]
671pub struct ProcedureExecutionMetadata {
672    #[prost(string, tag = "1")]
673    pub rid: ::prost::alloc::string::String,
674    /// The procedure template rid this execution is based on.
675    #[prost(string, tag = "2")]
676    pub procedure_rid: ::prost::alloc::string::String,
677    /// The commit ID of the procedure template this execution is based on.
678    /// This can be overridden at the node level for individual nodes.
679    #[prost(string, tag = "3")]
680    pub procedure_commit_id: ::prost::alloc::string::String,
681    #[prost(string, tag = "4")]
682    pub title: ::prost::alloc::string::String,
683    #[prost(string, optional, tag = "5")]
684    pub description: ::core::option::Option<::prost::alloc::string::String>,
685    #[prost(string, repeated, tag = "6")]
686    pub labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
687    #[prost(map = "string, string", tag = "7")]
688    pub properties: ::std::collections::HashMap<
689        ::prost::alloc::string::String,
690        ::prost::alloc::string::String,
691    >,
692    #[prost(string, tag = "8")]
693    pub created_by: ::prost::alloc::string::String,
694    #[prost(message, optional, tag = "9")]
695    pub created_at: ::core::option::Option<
696        super::super::super::super::google::protobuf::Timestamp,
697    >,
698    #[prost(string, tag = "10")]
699    pub updated_by: ::prost::alloc::string::String,
700    #[prost(message, optional, tag = "11")]
701    pub updated_at: ::core::option::Option<
702        super::super::super::super::google::protobuf::Timestamp,
703    >,
704    /// Will be unset until the execution transitions from NOT_STARTED to IN_PROGRESS.
705    #[prost(message, optional, tag = "12")]
706    pub started_at: ::core::option::Option<
707        super::super::super::super::google::protobuf::Timestamp,
708    >,
709    #[prost(string, optional, tag = "13")]
710    pub started_by: ::core::option::Option<::prost::alloc::string::String>,
711    /// Will be unset until the execution transitions from IN_PROGRESS to a terminal state.
712    #[prost(message, optional, tag = "14")]
713    pub finished_at: ::core::option::Option<
714        super::super::super::super::google::protobuf::Timestamp,
715    >,
716    #[prost(string, optional, tag = "15")]
717    pub finished_by: ::core::option::Option<::prost::alloc::string::String>,
718    /// Will be true/set if the execution is the ABORTED terminal state.
719    #[prost(message, optional, tag = "16")]
720    pub aborted_at: ::core::option::Option<
721        super::super::super::super::google::protobuf::Timestamp,
722    >,
723    #[prost(string, optional, tag = "17")]
724    pub aborted_by: ::core::option::Option<::prost::alloc::string::String>,
725    /// Will be set if the execution is in the ERRORED terminal state.
726    #[prost(message, optional, tag = "18")]
727    pub failed_at: ::core::option::Option<
728        super::super::super::super::google::protobuf::Timestamp,
729    >,
730    #[prost(string, optional, tag = "19")]
731    pub failed_by: ::core::option::Option<::prost::alloc::string::String>,
732    #[prost(string, optional, tag = "20")]
733    pub failed_reason: ::core::option::Option<::prost::alloc::string::String>,
734}
735/// ProcedureExecutionState is the state of an executing procedure.
736#[derive(Clone, PartialEq, ::prost::Message)]
737pub struct ProcedureExecutionState {
738    /// The current values for the global fields in the procedure.
739    #[prost(map = "string, message", tag = "1")]
740    pub global_fields: ::std::collections::HashMap<
741        ::prost::alloc::string::String,
742        FieldOutput,
743    >,
744    /// A map from execution node ID to the execution node.
745    #[prost(map = "string, message", tag = "2")]
746    pub nodes: ::std::collections::HashMap<
747        ::prost::alloc::string::String,
748        ProcedureExecutionNode,
749    >,
750    /// Section edges represent the visual grouping of sections and steps.
751    /// All keys are IDs for section nodes, and all values are lists of IDs for section or step nodes.
752    /// { A, \[B, C\] } means that section A visually groups nodes B and C together.
753    #[prost(map = "string, message", tag = "3")]
754    pub section_edges: ::std::collections::HashMap<
755        ::prost::alloc::string::String,
756        super::super::v1::NodeList,
757    >,
758    /// Step edges represent the dependencies between steps.
759    /// All keys and values are IDs for step nodes.
760    /// { A, \[B, C\] } means that steps B and C depend on step A to complete to be started
761    #[prost(map = "string, message", tag = "4")]
762    pub step_edges: ::std::collections::HashMap<
763        ::prost::alloc::string::String,
764        super::super::v1::NodeList,
765    >,
766}
767#[derive(Clone, PartialEq, ::prost::Message)]
768pub struct Strings {
769    #[prost(string, repeated, tag = "1")]
770    pub values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
771}
772/// TODO(pchen): how to handle the value typing here
773/// The outputs of a field in a step.
774/// This is different from FormFieldValue in that this represents the resolved value after the step has
775/// been completed. Eg, this would contain an AssetRid while the FormFieldValue could contain an AssetReference
776#[derive(Clone, PartialEq, ::prost::Message)]
777pub struct FieldOutput {
778    /// The oneof can be unset if the field has not been set yet.
779    #[prost(oneof = "field_output::Output", tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10")]
780    pub output: ::core::option::Option<field_output::Output>,
781}
782/// Nested message and enum types in `FieldOutput`.
783pub mod field_output {
784    /// The oneof can be unset if the field has not been set yet.
785    #[derive(Clone, PartialEq, ::prost::Oneof)]
786    pub enum Output {
787        /// TODO(niwong): I think this could actually be buf validated to be required. If a global field is
788        /// not yet defined, I think it's just not present in the global_fields map
789        /// option (buf.validate.oneof) = {required: true};
790        #[prost(string, tag = "1")]
791        AssetRid(::prost::alloc::string::String),
792        #[prost(string, tag = "2")]
793        StringValue(::prost::alloc::string::String),
794        #[prost(double, tag = "3")]
795        DoubleValue(f64),
796        #[prost(bool, tag = "4")]
797        BooleanValue(bool),
798        #[prost(int64, tag = "5")]
799        IntValue(i64),
800        #[prost(message, tag = "6")]
801        StringsValue(super::Strings),
802        #[prost(string, tag = "7")]
803        IngestJobRid(::prost::alloc::string::String),
804        #[prost(string, tag = "8")]
805        RunRid(::prost::alloc::string::String),
806        #[prost(message, tag = "9")]
807        FileUploadValue(super::FileUploadFieldValue),
808        #[prost(message, tag = "10")]
809        MultiFileUploadValue(super::MultiFileUploadFieldValue),
810    }
811}
812#[derive(Clone, PartialEq, ::prost::Message)]
813pub struct CreateProcedureExecutionRequest {
814    #[prost(string, tag = "1")]
815    pub procedure_rid: ::prost::alloc::string::String,
816    #[prost(string, tag = "2")]
817    pub procedure_commit_id: ::prost::alloc::string::String,
818    #[prost(string, tag = "3")]
819    pub title: ::prost::alloc::string::String,
820    #[prost(string, optional, tag = "4")]
821    pub description: ::core::option::Option<::prost::alloc::string::String>,
822    #[prost(bool, optional, tag = "5")]
823    pub start_immediately: ::core::option::Option<bool>,
824}
825#[derive(Clone, PartialEq, ::prost::Message)]
826pub struct CreateProcedureExecutionResponse {
827    #[prost(message, optional, tag = "1")]
828    pub procedure_execution: ::core::option::Option<ProcedureExecution>,
829}
830#[derive(Clone, PartialEq, ::prost::Message)]
831pub struct GetProcedureExecutionRequest {
832    #[prost(string, tag = "1")]
833    pub procedure_execution_rid: ::prost::alloc::string::String,
834    /// If true, the display graph will be included in the response.
835    /// Default is false.
836    #[prost(bool, tag = "2")]
837    pub include_display_graph: bool,
838}
839#[derive(Clone, PartialEq, ::prost::Message)]
840pub struct GetProcedureExecutionResponse {
841    #[prost(message, optional, tag = "1")]
842    pub procedure_execution: ::core::option::Option<ProcedureExecution>,
843    /// Included if include_display_graph was set to true. Note that this is the
844    /// procedure template's display graph, not the execution graph.
845    #[prost(message, optional, tag = "2")]
846    pub display_graph: ::core::option::Option<super::super::v1::ProcedureDisplayGraph>,
847}
848#[derive(Clone, PartialEq, ::prost::Message)]
849pub struct UpdateProcedureExecutionMetadataRequest {
850    #[prost(string, tag = "1")]
851    pub procedure_execution_rid: ::prost::alloc::string::String,
852    #[prost(string, optional, tag = "2")]
853    pub title: ::core::option::Option<::prost::alloc::string::String>,
854    #[prost(string, optional, tag = "3")]
855    pub description: ::core::option::Option<::prost::alloc::string::String>,
856    #[prost(string, optional, tag = "4")]
857    pub commit_id: ::core::option::Option<::prost::alloc::string::String>,
858    #[prost(message, optional, tag = "5")]
859    pub labels: ::core::option::Option<super::super::super::types::LabelUpdateWrapper>,
860    #[prost(message, optional, tag = "6")]
861    pub properties: ::core::option::Option<
862        super::super::super::types::PropertyUpdateWrapper,
863    >,
864}
865#[derive(Clone, PartialEq, ::prost::Message)]
866pub struct UpdateProcedureExecutionMetadataResponse {
867    #[prost(message, optional, tag = "1")]
868    pub metadata: ::core::option::Option<ProcedureExecutionMetadata>,
869}
870/// TODO(niwong to pchen): I made an "update metadata" endpoint separately above,
871/// I think it'd be nice to turn this into a dedicated endpoint for changing the state of
872/// the overall execution (start, succeed, abort, fail)
873/// I also think in general we shouldn't be updating the entire ProcedureExecutionState
874/// but rather leveraging updateStep.
875/// TODO(WB-1879): allow to just update the global fields within the ProcExecState.
876#[derive(Clone, PartialEq, ::prost::Message)]
877pub struct UpdateProcedureExecutionRequest {
878    #[prost(string, tag = "1")]
879    pub procedure_execution_rid: ::prost::alloc::string::String,
880    #[prost(string, optional, tag = "2")]
881    pub title: ::core::option::Option<::prost::alloc::string::String>,
882    #[prost(string, optional, tag = "3")]
883    pub description: ::core::option::Option<::prost::alloc::string::String>,
884    #[prost(string, optional, tag = "4")]
885    pub commit_id: ::core::option::Option<::prost::alloc::string::String>,
886    #[prost(message, optional, tag = "5")]
887    pub labels: ::core::option::Option<super::super::super::types::LabelUpdateWrapper>,
888    #[prost(message, optional, tag = "6")]
889    pub properties: ::core::option::Option<
890        super::super::super::types::PropertyUpdateWrapper,
891    >,
892    #[prost(message, optional, tag = "7")]
893    pub state: ::core::option::Option<ProcedureExecutionState>,
894    #[prost(bool, optional, tag = "8")]
895    pub is_aborted: ::core::option::Option<bool>,
896    #[prost(message, optional, tag = "9")]
897    pub started_at: ::core::option::Option<
898        super::super::super::super::google::protobuf::Timestamp,
899    >,
900    #[prost(message, optional, tag = "10")]
901    pub finished_at: ::core::option::Option<
902        super::super::super::super::google::protobuf::Timestamp,
903    >,
904}
905#[derive(Clone, PartialEq, ::prost::Message)]
906pub struct UpdateProcedureExecutionResponse {
907    #[prost(message, optional, tag = "1")]
908    pub procedure_execution: ::core::option::Option<ProcedureExecution>,
909}
910#[derive(Clone, PartialEq, ::prost::Message)]
911pub struct UpdateStepRequest {
912    #[prost(string, tag = "1")]
913    pub procedure_execution_rid: ::prost::alloc::string::String,
914    /// The unique identifier of the execution step to update.
915    #[prost(string, tag = "2")]
916    pub step_id: ::prost::alloc::string::String,
917    /// Setting the value of the step's content. This is only allowed if the step is NOT_STARTED
918    /// or IN_PROGRESS.
919    #[prost(message, optional, tag = "3")]
920    pub value: ::core::option::Option<StepContentValue>,
921    /// Set whether the step has auto-proceed enabled. This is only allowed if the step is NOT_STARTED.
922    /// or IN_PROGRESS.
923    #[prost(message, optional, tag = "4")]
924    pub auto_proceed_config: ::core::option::Option<super::super::v1::AutoProceedConfig>,
925    /// Setting the state of the step. This will occur after the other updates in this request.
926    #[prost(message, optional, tag = "5")]
927    pub target_state: ::core::option::Option<TargetStepStateRequest>,
928}
929#[derive(Clone, PartialEq, ::prost::Message)]
930pub struct UpdateStepResponse {
931    #[prost(message, optional, tag = "1")]
932    pub procedure_execution: ::core::option::Option<ProcedureExecution>,
933}
934#[derive(Clone, PartialEq, ::prost::Message)]
935pub struct UpdateStepSuccessConditionStatusRequest {
936    #[prost(string, tag = "1")]
937    pub procedure_execution_rid: ::prost::alloc::string::String,
938    /// The unique identifier of the execution step to update.
939    #[prost(string, tag = "2")]
940    pub step_id: ::prost::alloc::string::String,
941    /// Setting the success_condition_status is only allowed if the step is SUBMITTED
942    /// and should only be done by the backend while monitoring the condition.
943    /// If the step is SKIPPED, the success_condition_status will still be set but
944    /// no completion actions will be run and the step's state will not be updated.
945    #[prost(message, optional, tag = "3")]
946    pub success_condition_status: ::core::option::Option<SuccessConditionStatus>,
947}
948#[derive(Clone, PartialEq, ::prost::Message)]
949pub struct UpdateStepSuccessConditionStatusResponse {
950    #[prost(message, optional, tag = "1")]
951    pub procedure_execution: ::core::option::Option<ProcedureExecution>,
952}
953#[derive(Clone, PartialEq, ::prost::Message)]
954pub struct RepeatStepRequest {
955    #[prost(string, tag = "1")]
956    pub procedure_execution_rid: ::prost::alloc::string::String,
957    /// The unique identifier of the execution step to repeat/duplicate.
958    #[prost(string, tag = "2")]
959    pub step_id: ::prost::alloc::string::String,
960    /// Behavior for how repeating the step will affect dependants.
961    #[prost(enumeration = "RepeatStepBehavior", tag = "6")]
962    pub behavior: i32,
963    /// Setting the value of the step's content.
964    #[prost(message, optional, tag = "3")]
965    pub value: ::core::option::Option<StepContentValue>,
966    /// Set whether the step has auto-proceed enabled.
967    #[prost(message, optional, tag = "4")]
968    pub auto_proceed_config: ::core::option::Option<super::super::v1::AutoProceedConfig>,
969    /// Setting the state of the step. This will occur after the other updates in this request.
970    #[prost(message, optional, tag = "5")]
971    pub target_state: ::core::option::Option<TargetStepStateRequest>,
972}
973#[derive(Clone, PartialEq, ::prost::Message)]
974pub struct RepeatStepResponse {
975    #[prost(message, optional, tag = "1")]
976    pub procedure_execution: ::core::option::Option<ProcedureExecution>,
977}
978#[derive(Clone, PartialEq, ::prost::Message)]
979pub struct ProcedureExecutionSearchQuery {
980    #[prost(
981        oneof = "procedure_execution_search_query::Query",
982        tags = "1, 2, 3, 4, 5, 6, 7, 8, 9"
983    )]
984    pub query: ::core::option::Option<procedure_execution_search_query::Query>,
985}
986/// Nested message and enum types in `ProcedureExecutionSearchQuery`.
987pub mod procedure_execution_search_query {
988    #[derive(Clone, PartialEq, ::prost::Message)]
989    pub struct ProcedureExecutionSearchAndQuery {
990        #[prost(message, repeated, tag = "1")]
991        pub queries: ::prost::alloc::vec::Vec<super::ProcedureExecutionSearchQuery>,
992    }
993    #[derive(Clone, PartialEq, ::prost::Message)]
994    pub struct ProcedureExecutionSearchOrQuery {
995        #[prost(message, repeated, tag = "1")]
996        pub queries: ::prost::alloc::vec::Vec<super::ProcedureExecutionSearchQuery>,
997    }
998    #[derive(Clone, PartialEq, ::prost::Oneof)]
999    pub enum Query {
1000        #[prost(string, tag = "1")]
1001        SearchText(::prost::alloc::string::String),
1002        #[prost(string, tag = "2")]
1003        Label(::prost::alloc::string::String),
1004        #[prost(message, tag = "3")]
1005        Property(super::super::super::super::types::Property),
1006        #[prost(message, tag = "4")]
1007        And(ProcedureExecutionSearchAndQuery),
1008        #[prost(message, tag = "5")]
1009        Or(ProcedureExecutionSearchOrQuery),
1010        #[prost(string, tag = "6")]
1011        Workspace(::prost::alloc::string::String),
1012        #[prost(string, tag = "7")]
1013        ProcedureRid(::prost::alloc::string::String),
1014        #[prost(string, tag = "8")]
1015        CommitId(::prost::alloc::string::String),
1016        #[prost(string, tag = "9")]
1017        CreatedBy(::prost::alloc::string::String),
1018    }
1019}
1020#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1021pub struct ProcedureExecutionSortOptions {
1022    #[prost(bool, tag = "1")]
1023    pub is_descending: bool,
1024    #[prost(enumeration = "SearchProcedureExecutionsSortField", tag = "2")]
1025    pub sort_field: i32,
1026}
1027#[derive(Clone, PartialEq, ::prost::Message)]
1028pub struct SearchProcedureExecutionsRequest {
1029    #[prost(message, optional, tag = "1")]
1030    pub query: ::core::option::Option<ProcedureExecutionSearchQuery>,
1031    #[prost(message, optional, tag = "2")]
1032    pub sort_options: ::core::option::Option<ProcedureExecutionSortOptions>,
1033    /// Page sizes greater than 1_000 will be rejected. Default pageSize is 100.
1034    #[prost(int32, optional, tag = "3")]
1035    pub page_size: ::core::option::Option<i32>,
1036    #[prost(string, optional, tag = "4")]
1037    pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
1038}
1039#[derive(Clone, PartialEq, ::prost::Message)]
1040pub struct SearchProcedureExecutionsResponse {
1041    #[prost(message, repeated, tag = "1")]
1042    pub procedure_executions: ::prost::alloc::vec::Vec<ProcedureExecutionMetadata>,
1043    #[prost(string, optional, tag = "2")]
1044    pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
1045}
1046#[derive(Clone, PartialEq, ::prost::Message)]
1047pub struct BatchGetProcedureExecutionMetadataRequest {
1048    #[prost(string, repeated, tag = "1")]
1049    pub procedure_execution_rids: ::prost::alloc::vec::Vec<
1050        ::prost::alloc::string::String,
1051    >,
1052}
1053#[derive(Clone, PartialEq, ::prost::Message)]
1054pub struct BatchGetProcedureExecutionMetadataResponse {
1055    #[prost(message, repeated, tag = "1")]
1056    pub procedure_executions: ::prost::alloc::vec::Vec<ProcedureExecutionMetadata>,
1057}
1058#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1059#[repr(i32)]
1060pub enum RepeatStepBehavior {
1061    Unspecified = 0,
1062    /// The targeted step will be repeated, but the original graph will be preserved
1063    /// and only direct children will be checked for state updates
1064    Isolated = 1,
1065}
1066impl RepeatStepBehavior {
1067    /// String value of the enum field names used in the ProtoBuf definition.
1068    ///
1069    /// The values are not transformed in any way and thus are considered stable
1070    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1071    pub fn as_str_name(&self) -> &'static str {
1072        match self {
1073            Self::Unspecified => "REPEAT_STEP_BEHAVIOR_UNSPECIFIED",
1074            Self::Isolated => "REPEAT_STEP_BEHAVIOR_ISOLATED",
1075        }
1076    }
1077    /// Creates an enum from field names used in the ProtoBuf definition.
1078    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1079        match value {
1080            "REPEAT_STEP_BEHAVIOR_UNSPECIFIED" => Some(Self::Unspecified),
1081            "REPEAT_STEP_BEHAVIOR_ISOLATED" => Some(Self::Isolated),
1082            _ => None,
1083        }
1084    }
1085}
1086#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1087#[repr(i32)]
1088pub enum SearchProcedureExecutionsSortField {
1089    Unspecified = 0,
1090    CreatedAt = 1,
1091    StartedAt = 2,
1092    FinishedAt = 3,
1093    UpdatedAt = 4,
1094}
1095impl SearchProcedureExecutionsSortField {
1096    /// String value of the enum field names used in the ProtoBuf definition.
1097    ///
1098    /// The values are not transformed in any way and thus are considered stable
1099    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1100    pub fn as_str_name(&self) -> &'static str {
1101        match self {
1102            Self::Unspecified => "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_UNSPECIFIED",
1103            Self::CreatedAt => "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_CREATED_AT",
1104            Self::StartedAt => "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_STARTED_AT",
1105            Self::FinishedAt => "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_FINISHED_AT",
1106            Self::UpdatedAt => "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_UPDATED_AT",
1107        }
1108    }
1109    /// Creates an enum from field names used in the ProtoBuf definition.
1110    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1111        match value {
1112            "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_UNSPECIFIED" => {
1113                Some(Self::Unspecified)
1114            }
1115            "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_CREATED_AT" => Some(Self::CreatedAt),
1116            "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_STARTED_AT" => Some(Self::StartedAt),
1117            "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_FINISHED_AT" => {
1118                Some(Self::FinishedAt)
1119            }
1120            "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_UPDATED_AT" => Some(Self::UpdatedAt),
1121            _ => None,
1122        }
1123    }
1124}
1125#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1126#[repr(i32)]
1127pub enum ProcedureExecutionsServiceError {
1128    Unspecified = 0,
1129    NotFound = 1,
1130    ProcNotFound = 2,
1131    NodeNotFound = 3,
1132    InvalidNode = 4,
1133    InvalidGraph = 5,
1134    InvalidStepTransition = 6,
1135    InvalidSearchToken = 7,
1136    InvalidStepUpdate = 8,
1137}
1138impl ProcedureExecutionsServiceError {
1139    /// String value of the enum field names used in the ProtoBuf definition.
1140    ///
1141    /// The values are not transformed in any way and thus are considered stable
1142    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1143    pub fn as_str_name(&self) -> &'static str {
1144        match self {
1145            Self::Unspecified => "PROCEDURE_EXECUTIONS_SERVICE_ERROR_UNSPECIFIED",
1146            Self::NotFound => "PROCEDURE_EXECUTIONS_SERVICE_ERROR_NOT_FOUND",
1147            Self::ProcNotFound => "PROCEDURE_EXECUTIONS_SERVICE_ERROR_PROC_NOT_FOUND",
1148            Self::NodeNotFound => "PROCEDURE_EXECUTIONS_SERVICE_ERROR_NODE_NOT_FOUND",
1149            Self::InvalidNode => "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_NODE",
1150            Self::InvalidGraph => "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_GRAPH",
1151            Self::InvalidStepTransition => {
1152                "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_STEP_TRANSITION"
1153            }
1154            Self::InvalidSearchToken => {
1155                "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_SEARCH_TOKEN"
1156            }
1157            Self::InvalidStepUpdate => {
1158                "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_STEP_UPDATE"
1159            }
1160        }
1161    }
1162    /// Creates an enum from field names used in the ProtoBuf definition.
1163    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1164        match value {
1165            "PROCEDURE_EXECUTIONS_SERVICE_ERROR_UNSPECIFIED" => Some(Self::Unspecified),
1166            "PROCEDURE_EXECUTIONS_SERVICE_ERROR_NOT_FOUND" => Some(Self::NotFound),
1167            "PROCEDURE_EXECUTIONS_SERVICE_ERROR_PROC_NOT_FOUND" => {
1168                Some(Self::ProcNotFound)
1169            }
1170            "PROCEDURE_EXECUTIONS_SERVICE_ERROR_NODE_NOT_FOUND" => {
1171                Some(Self::NodeNotFound)
1172            }
1173            "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_NODE" => Some(Self::InvalidNode),
1174            "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_GRAPH" => {
1175                Some(Self::InvalidGraph)
1176            }
1177            "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_STEP_TRANSITION" => {
1178                Some(Self::InvalidStepTransition)
1179            }
1180            "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_SEARCH_TOKEN" => {
1181                Some(Self::InvalidSearchToken)
1182            }
1183            "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_STEP_UPDATE" => {
1184                Some(Self::InvalidStepUpdate)
1185            }
1186            _ => None,
1187        }
1188    }
1189}
1190/// Generated client implementations.
1191pub mod procedure_executions_service_client {
1192    #![allow(
1193        unused_variables,
1194        dead_code,
1195        missing_docs,
1196        clippy::wildcard_imports,
1197        clippy::let_unit_value,
1198    )]
1199    use tonic::codegen::*;
1200    use tonic::codegen::http::Uri;
1201    /// Service for creating and managing procedure executions.
1202    #[derive(Debug, Clone)]
1203    pub struct ProcedureExecutionsServiceClient<T> {
1204        inner: tonic::client::Grpc<T>,
1205    }
1206    impl ProcedureExecutionsServiceClient<tonic::transport::Channel> {
1207        /// Attempt to create a new client by connecting to a given endpoint.
1208        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1209        where
1210            D: TryInto<tonic::transport::Endpoint>,
1211            D::Error: Into<StdError>,
1212        {
1213            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1214            Ok(Self::new(conn))
1215        }
1216    }
1217    impl<T> ProcedureExecutionsServiceClient<T>
1218    where
1219        T: tonic::client::GrpcService<tonic::body::Body>,
1220        T::Error: Into<StdError>,
1221        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1222        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1223    {
1224        pub fn new(inner: T) -> Self {
1225            let inner = tonic::client::Grpc::new(inner);
1226            Self { inner }
1227        }
1228        pub fn with_origin(inner: T, origin: Uri) -> Self {
1229            let inner = tonic::client::Grpc::with_origin(inner, origin);
1230            Self { inner }
1231        }
1232        pub fn with_interceptor<F>(
1233            inner: T,
1234            interceptor: F,
1235        ) -> ProcedureExecutionsServiceClient<InterceptedService<T, F>>
1236        where
1237            F: tonic::service::Interceptor,
1238            T::ResponseBody: Default,
1239            T: tonic::codegen::Service<
1240                http::Request<tonic::body::Body>,
1241                Response = http::Response<
1242                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
1243                >,
1244            >,
1245            <T as tonic::codegen::Service<
1246                http::Request<tonic::body::Body>,
1247            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1248        {
1249            ProcedureExecutionsServiceClient::new(
1250                InterceptedService::new(inner, interceptor),
1251            )
1252        }
1253        /// Compress requests with the given encoding.
1254        ///
1255        /// This requires the server to support it otherwise it might respond with an
1256        /// error.
1257        #[must_use]
1258        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1259            self.inner = self.inner.send_compressed(encoding);
1260            self
1261        }
1262        /// Enable decompressing responses.
1263        #[must_use]
1264        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1265            self.inner = self.inner.accept_compressed(encoding);
1266            self
1267        }
1268        /// Limits the maximum size of a decoded message.
1269        ///
1270        /// Default: `4MB`
1271        #[must_use]
1272        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1273            self.inner = self.inner.max_decoding_message_size(limit);
1274            self
1275        }
1276        /// Limits the maximum size of an encoded message.
1277        ///
1278        /// Default: `usize::MAX`
1279        #[must_use]
1280        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1281            self.inner = self.inner.max_encoding_message_size(limit);
1282            self
1283        }
1284        /// Create a new procedure execution from a procedure
1285        pub async fn create_procedure_execution(
1286            &mut self,
1287            request: impl tonic::IntoRequest<super::CreateProcedureExecutionRequest>,
1288        ) -> std::result::Result<
1289            tonic::Response<super::CreateProcedureExecutionResponse>,
1290            tonic::Status,
1291        > {
1292            self.inner
1293                .ready()
1294                .await
1295                .map_err(|e| {
1296                    tonic::Status::unknown(
1297                        format!("Service was not ready: {}", e.into()),
1298                    )
1299                })?;
1300            let codec = tonic::codec::ProstCodec::default();
1301            let path = http::uri::PathAndQuery::from_static(
1302                "/nominal.procedures.executions.v1.ProcedureExecutionsService/CreateProcedureExecution",
1303            );
1304            let mut req = request.into_request();
1305            req.extensions_mut()
1306                .insert(
1307                    GrpcMethod::new(
1308                        "nominal.procedures.executions.v1.ProcedureExecutionsService",
1309                        "CreateProcedureExecution",
1310                    ),
1311                );
1312            self.inner.unary(req, path, codec).await
1313        }
1314        /// Get a procedure execution by its RID
1315        pub async fn get_procedure_execution(
1316            &mut self,
1317            request: impl tonic::IntoRequest<super::GetProcedureExecutionRequest>,
1318        ) -> std::result::Result<
1319            tonic::Response<super::GetProcedureExecutionResponse>,
1320            tonic::Status,
1321        > {
1322            self.inner
1323                .ready()
1324                .await
1325                .map_err(|e| {
1326                    tonic::Status::unknown(
1327                        format!("Service was not ready: {}", e.into()),
1328                    )
1329                })?;
1330            let codec = tonic::codec::ProstCodec::default();
1331            let path = http::uri::PathAndQuery::from_static(
1332                "/nominal.procedures.executions.v1.ProcedureExecutionsService/GetProcedureExecution",
1333            );
1334            let mut req = request.into_request();
1335            req.extensions_mut()
1336                .insert(
1337                    GrpcMethod::new(
1338                        "nominal.procedures.executions.v1.ProcedureExecutionsService",
1339                        "GetProcedureExecution",
1340                    ),
1341                );
1342            self.inner.unary(req, path, codec).await
1343        }
1344        /// Update the metadata of a procedure execution
1345        pub async fn update_procedure_execution_metadata(
1346            &mut self,
1347            request: impl tonic::IntoRequest<
1348                super::UpdateProcedureExecutionMetadataRequest,
1349            >,
1350        ) -> std::result::Result<
1351            tonic::Response<super::UpdateProcedureExecutionMetadataResponse>,
1352            tonic::Status,
1353        > {
1354            self.inner
1355                .ready()
1356                .await
1357                .map_err(|e| {
1358                    tonic::Status::unknown(
1359                        format!("Service was not ready: {}", e.into()),
1360                    )
1361                })?;
1362            let codec = tonic::codec::ProstCodec::default();
1363            let path = http::uri::PathAndQuery::from_static(
1364                "/nominal.procedures.executions.v1.ProcedureExecutionsService/UpdateProcedureExecutionMetadata",
1365            );
1366            let mut req = request.into_request();
1367            req.extensions_mut()
1368                .insert(
1369                    GrpcMethod::new(
1370                        "nominal.procedures.executions.v1.ProcedureExecutionsService",
1371                        "UpdateProcedureExecutionMetadata",
1372                    ),
1373                );
1374            self.inner.unary(req, path, codec).await
1375        }
1376        /// Heavy-handed update method for procedure execution
1377        /// TODO(pchen): This isn't the expected final endpoint, this is just for editing the graph while we iterate
1378        /// There likely be additional fine-grained methods for editing the procedure
1379        pub async fn update_procedure_execution(
1380            &mut self,
1381            request: impl tonic::IntoRequest<super::UpdateProcedureExecutionRequest>,
1382        ) -> std::result::Result<
1383            tonic::Response<super::UpdateProcedureExecutionResponse>,
1384            tonic::Status,
1385        > {
1386            self.inner
1387                .ready()
1388                .await
1389                .map_err(|e| {
1390                    tonic::Status::unknown(
1391                        format!("Service was not ready: {}", e.into()),
1392                    )
1393                })?;
1394            let codec = tonic::codec::ProstCodec::default();
1395            let path = http::uri::PathAndQuery::from_static(
1396                "/nominal.procedures.executions.v1.ProcedureExecutionsService/UpdateProcedureExecution",
1397            );
1398            let mut req = request.into_request();
1399            req.extensions_mut()
1400                .insert(
1401                    GrpcMethod::new(
1402                        "nominal.procedures.executions.v1.ProcedureExecutionsService",
1403                        "UpdateProcedureExecution",
1404                    ),
1405                );
1406            self.inner.unary(req, path, codec).await
1407        }
1408        /// Update the status of a step in a procedure execution. This can only be done if the step is NOT_STARTED,
1409        /// IN_PROGRESS, or SUBMITTED. Other state transitions are managed by the backend.
1410        pub async fn update_step(
1411            &mut self,
1412            request: impl tonic::IntoRequest<super::UpdateStepRequest>,
1413        ) -> std::result::Result<
1414            tonic::Response<super::UpdateStepResponse>,
1415            tonic::Status,
1416        > {
1417            self.inner
1418                .ready()
1419                .await
1420                .map_err(|e| {
1421                    tonic::Status::unknown(
1422                        format!("Service was not ready: {}", e.into()),
1423                    )
1424                })?;
1425            let codec = tonic::codec::ProstCodec::default();
1426            let path = http::uri::PathAndQuery::from_static(
1427                "/nominal.procedures.executions.v1.ProcedureExecutionsService/UpdateStep",
1428            );
1429            let mut req = request.into_request();
1430            req.extensions_mut()
1431                .insert(
1432                    GrpcMethod::new(
1433                        "nominal.procedures.executions.v1.ProcedureExecutionsService",
1434                        "UpdateStep",
1435                    ),
1436                );
1437            self.inner.unary(req, path, codec).await
1438        }
1439        /// This should only be called by the backend to update the success_condition_status of a step.
1440        /// This can only be done if the step is SUBMITTED.
1441        pub async fn update_step_success_condition_status(
1442            &mut self,
1443            request: impl tonic::IntoRequest<
1444                super::UpdateStepSuccessConditionStatusRequest,
1445            >,
1446        ) -> std::result::Result<
1447            tonic::Response<super::UpdateStepSuccessConditionStatusResponse>,
1448            tonic::Status,
1449        > {
1450            self.inner
1451                .ready()
1452                .await
1453                .map_err(|e| {
1454                    tonic::Status::unknown(
1455                        format!("Service was not ready: {}", e.into()),
1456                    )
1457                })?;
1458            let codec = tonic::codec::ProstCodec::default();
1459            let path = http::uri::PathAndQuery::from_static(
1460                "/nominal.procedures.executions.v1.ProcedureExecutionsService/UpdateStepSuccessConditionStatus",
1461            );
1462            let mut req = request.into_request();
1463            req.extensions_mut()
1464                .insert(
1465                    GrpcMethod::new(
1466                        "nominal.procedures.executions.v1.ProcedureExecutionsService",
1467                        "UpdateStepSuccessConditionStatus",
1468                    ),
1469                );
1470            self.inner.unary(req, path, codec).await
1471        }
1472        /// Repeat a previously finished step in a procedure execution. This can only be done if the given step
1473        /// is in state SUCCEEDED, SKIPPED or ERRORED. Other state transitions are managed by the backend.
1474        pub async fn repeat_step(
1475            &mut self,
1476            request: impl tonic::IntoRequest<super::RepeatStepRequest>,
1477        ) -> std::result::Result<
1478            tonic::Response<super::RepeatStepResponse>,
1479            tonic::Status,
1480        > {
1481            self.inner
1482                .ready()
1483                .await
1484                .map_err(|e| {
1485                    tonic::Status::unknown(
1486                        format!("Service was not ready: {}", e.into()),
1487                    )
1488                })?;
1489            let codec = tonic::codec::ProstCodec::default();
1490            let path = http::uri::PathAndQuery::from_static(
1491                "/nominal.procedures.executions.v1.ProcedureExecutionsService/RepeatStep",
1492            );
1493            let mut req = request.into_request();
1494            req.extensions_mut()
1495                .insert(
1496                    GrpcMethod::new(
1497                        "nominal.procedures.executions.v1.ProcedureExecutionsService",
1498                        "RepeatStep",
1499                    ),
1500                );
1501            self.inner.unary(req, path, codec).await
1502        }
1503        /// Search for procedure executions
1504        pub async fn search_procedure_executions(
1505            &mut self,
1506            request: impl tonic::IntoRequest<super::SearchProcedureExecutionsRequest>,
1507        ) -> std::result::Result<
1508            tonic::Response<super::SearchProcedureExecutionsResponse>,
1509            tonic::Status,
1510        > {
1511            self.inner
1512                .ready()
1513                .await
1514                .map_err(|e| {
1515                    tonic::Status::unknown(
1516                        format!("Service was not ready: {}", e.into()),
1517                    )
1518                })?;
1519            let codec = tonic::codec::ProstCodec::default();
1520            let path = http::uri::PathAndQuery::from_static(
1521                "/nominal.procedures.executions.v1.ProcedureExecutionsService/SearchProcedureExecutions",
1522            );
1523            let mut req = request.into_request();
1524            req.extensions_mut()
1525                .insert(
1526                    GrpcMethod::new(
1527                        "nominal.procedures.executions.v1.ProcedureExecutionsService",
1528                        "SearchProcedureExecutions",
1529                    ),
1530                );
1531            self.inner.unary(req, path, codec).await
1532        }
1533        /// Batch get procedure execution metadata
1534        pub async fn batch_get_procedure_execution_metadata(
1535            &mut self,
1536            request: impl tonic::IntoRequest<
1537                super::BatchGetProcedureExecutionMetadataRequest,
1538            >,
1539        ) -> std::result::Result<
1540            tonic::Response<super::BatchGetProcedureExecutionMetadataResponse>,
1541            tonic::Status,
1542        > {
1543            self.inner
1544                .ready()
1545                .await
1546                .map_err(|e| {
1547                    tonic::Status::unknown(
1548                        format!("Service was not ready: {}", e.into()),
1549                    )
1550                })?;
1551            let codec = tonic::codec::ProstCodec::default();
1552            let path = http::uri::PathAndQuery::from_static(
1553                "/nominal.procedures.executions.v1.ProcedureExecutionsService/BatchGetProcedureExecutionMetadata",
1554            );
1555            let mut req = request.into_request();
1556            req.extensions_mut()
1557                .insert(
1558                    GrpcMethod::new(
1559                        "nominal.procedures.executions.v1.ProcedureExecutionsService",
1560                        "BatchGetProcedureExecutionMetadata",
1561                    ),
1562                );
1563            self.inner.unary(req, path, codec).await
1564        }
1565    }
1566}