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::super::super::v1::ChannelValidationSuccessCondition),
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 AndSuccessCondition {
363    #[prost(message, repeated, tag = "1")]
364    pub conditions: ::prost::alloc::vec::Vec<SuccessConditionStatus>,
365}
366#[derive(Clone, Copy, PartialEq, ::prost::Message)]
367pub struct SuccessConditionSubmitted {
368    #[prost(message, optional, tag = "1")]
369    pub submitted_at: ::core::option::Option<
370        super::super::super::super::google::protobuf::Timestamp,
371    >,
372}
373#[derive(Clone, Copy, PartialEq, ::prost::Message)]
374pub struct SuccessConditionInProgress {
375    #[prost(message, optional, tag = "1")]
376    pub started_at: ::core::option::Option<
377        super::super::super::super::google::protobuf::Timestamp,
378    >,
379}
380#[derive(Clone, Copy, PartialEq, ::prost::Message)]
381pub struct SuccessConditionSatisfied {
382    #[prost(message, optional, tag = "1")]
383    pub started_at: ::core::option::Option<
384        super::super::super::super::google::protobuf::Timestamp,
385    >,
386    #[prost(message, optional, tag = "2")]
387    pub satisfied_at: ::core::option::Option<
388        super::super::super::super::google::protobuf::Timestamp,
389    >,
390}
391#[derive(Clone, PartialEq, ::prost::Message)]
392pub struct SuccessConditionFailed {
393    #[prost(message, optional, tag = "1")]
394    pub started_at: ::core::option::Option<
395        super::super::super::super::google::protobuf::Timestamp,
396    >,
397    #[prost(message, optional, tag = "2")]
398    pub failed_at: ::core::option::Option<
399        super::super::super::super::google::protobuf::Timestamp,
400    >,
401    #[prost(string, tag = "3")]
402    pub failure_reason: ::prost::alloc::string::String,
403}
404#[derive(Clone, Copy, PartialEq, ::prost::Message)]
405pub struct SuccessConditionCanceled {
406    #[prost(message, optional, tag = "1")]
407    pub started_at: ::core::option::Option<
408        super::super::super::super::google::protobuf::Timestamp,
409    >,
410    #[prost(message, optional, tag = "2")]
411    pub canceled_at: ::core::option::Option<
412        super::super::super::super::google::protobuf::Timestamp,
413    >,
414}
415/// The status of a completion action and its result (if any).
416#[derive(Clone, PartialEq, ::prost::Message)]
417pub struct CompletionActionStatus {
418    #[prost(message, optional, tag = "1")]
419    pub state: ::core::option::Option<CompletionActionState>,
420    /// This is intentionally not a required oneof
421    #[prost(oneof = "completion_action_status::Result", tags = "2, 3, 4, 5")]
422    pub result: ::core::option::Option<completion_action_status::Result>,
423}
424/// Nested message and enum types in `CompletionActionStatus`.
425pub mod completion_action_status {
426    /// This is intentionally not a required oneof
427    #[derive(Clone, PartialEq, ::prost::Oneof)]
428    pub enum Result {
429        #[prost(message, tag = "2")]
430        CreateEvent(super::CreateEventResult),
431        #[prost(message, tag = "3")]
432        CreateRun(super::CreateRunResult),
433        #[prost(message, tag = "4")]
434        ApplyWorkbookTemplates(super::ApplyWorkbookTemplatesResult),
435        /// ...
436        #[prost(message, tag = "5")]
437        ApplyChecklists(super::ApplyChecklistsResult),
438    }
439}
440/// A CreateEvent action results in an EventRid if successful.
441#[derive(Clone, PartialEq, ::prost::Message)]
442pub struct CreateEventResult {
443    #[prost(string, tag = "1")]
444    pub event_rid: ::prost::alloc::string::String,
445}
446/// A CreateRun action results in a RunRid if successful.
447#[derive(Clone, PartialEq, ::prost::Message)]
448pub struct CreateRunResult {
449    #[prost(string, tag = "1")]
450    pub run_rid: ::prost::alloc::string::String,
451}
452/// An ApplyWorkbookTemplates action results in a list of workbook RIDs if successful.
453#[derive(Clone, PartialEq, ::prost::Message)]
454pub struct ApplyWorkbookTemplatesResult {
455    #[prost(string, repeated, tag = "1")]
456    pub workbook_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
457}
458/// An ApplyChecklists action results in a list of DataReviewRids if successful.
459#[derive(Clone, PartialEq, ::prost::Message)]
460pub struct ApplyChecklistsResult {
461    #[prost(string, repeated, tag = "1")]
462    pub data_review_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
463}
464#[derive(Clone, PartialEq, ::prost::Message)]
465pub struct CompletionActionState {
466    #[prost(oneof = "completion_action_state::State", tags = "1, 2, 3")]
467    pub state: ::core::option::Option<completion_action_state::State>,
468}
469/// Nested message and enum types in `CompletionActionState`.
470pub mod completion_action_state {
471    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
472    pub struct NotRun {}
473    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
474    pub struct Succeeded {}
475    #[derive(Clone, PartialEq, ::prost::Oneof)]
476    pub enum State {
477        /// The action was not run
478        #[prost(message, tag = "1")]
479        NotRun(NotRun),
480        /// The action was run and succeeded. The result is available in CompletionActionStatus.result
481        #[prost(message, tag = "2")]
482        Succeeded(Succeeded),
483        /// The action was run and errored. This field contains the error message.
484        #[prost(string, tag = "3")]
485        Error(::prost::alloc::string::String),
486    }
487}
488/// The value for a step's content. Should match the ProcedureStepNode type.
489#[derive(Clone, PartialEq, ::prost::Message)]
490pub struct StepContentValue {
491    #[prost(oneof = "step_content_value::Value", tags = "1, 2, 3")]
492    pub value: ::core::option::Option<step_content_value::Value>,
493}
494/// Nested message and enum types in `StepContentValue`.
495pub mod step_content_value {
496    #[derive(Clone, PartialEq, ::prost::Oneof)]
497    pub enum Value {
498        #[prost(message, tag = "1")]
499        Form(super::FormStepValue),
500        #[prost(message, tag = "2")]
501        StartIngest(super::StartIngestStepValue),
502        /// ...
503        #[prost(message, tag = "3")]
504        SelectOrCreateAsset(super::SelectOrCreateAssetStepValue),
505    }
506}
507#[derive(Clone, PartialEq, ::prost::Message)]
508pub struct FormStepValue {
509    #[prost(message, repeated, tag = "1")]
510    pub fields: ::prost::alloc::vec::Vec<FormFieldValue>,
511}
512#[derive(Clone, PartialEq, ::prost::Message)]
513pub struct StartIngestStepValue {
514    /// The RID of the ingest job that was started by the client.
515    /// This must be populated for the step to be submitted.
516    #[prost(string, optional, tag = "1")]
517    pub ingest_job_rid: ::core::option::Option<::prost::alloc::string::String>,
518}
519#[derive(Clone, PartialEq, ::prost::Message)]
520pub struct SelectOrCreateAssetStepValue {
521    /// The asset that was selected / created by the client.
522    /// This must be populated for the step to be submitted.
523    #[prost(message, optional, tag = "1")]
524    pub asset_reference: ::core::option::Option<super::super::v1::AssetReference>,
525}
526/// The value chosen for a form field.
527/// This differs from FieldOutput in that this should map 1:1 with FormField types,
528/// while FieldOutput contains the resolved values after the execution step is complete.
529#[derive(Clone, PartialEq, ::prost::Message)]
530pub struct FormFieldValue {
531    #[prost(oneof = "form_field_value::Field", tags = "1, 2, 3, 4, 5, 6, 7, 8, 9")]
532    pub field: ::core::option::Option<form_field_value::Field>,
533}
534/// Nested message and enum types in `FormFieldValue`.
535pub mod form_field_value {
536    #[derive(Clone, PartialEq, ::prost::Oneof)]
537    pub enum Field {
538        #[prost(message, tag = "1")]
539        Asset(super::AssetFieldValue),
540        #[prost(message, tag = "2")]
541        Checkbox(super::CheckboxFieldValue),
542        #[prost(message, tag = "3")]
543        Text(super::TextFieldValue),
544        #[prost(message, tag = "4")]
545        Int(super::IntFieldValue),
546        #[prost(message, tag = "5")]
547        Double(super::DoubleFieldValue),
548        #[prost(message, tag = "6")]
549        SingleEnum(super::SingleEnumFieldValue),
550        #[prost(message, tag = "7")]
551        MultiEnum(super::MultiEnumFieldValue),
552        #[prost(message, tag = "8")]
553        FileUpload(super::FileUploadFieldValue),
554        #[prost(message, tag = "9")]
555        MultiFileUpload(super::MultiFileUploadFieldValue),
556    }
557}
558#[derive(Clone, PartialEq, ::prost::Message)]
559pub struct AssetFieldValue {
560    /// This oneof will be unset if no asset is set on the field.
561    #[prost(oneof = "asset_field_value::Asset", tags = "1")]
562    pub asset: ::core::option::Option<asset_field_value::Asset>,
563}
564/// Nested message and enum types in `AssetFieldValue`.
565pub mod asset_field_value {
566    /// This oneof will be unset if no asset is set on the field.
567    #[derive(Clone, PartialEq, ::prost::Oneof)]
568    pub enum Asset {
569        #[prost(message, tag = "1")]
570        AssetReference(super::super::super::v1::AssetReference),
571    }
572}
573#[derive(Clone, Copy, PartialEq, ::prost::Message)]
574pub struct CheckboxFieldValue {
575    /// Default to false if not set
576    #[prost(bool, tag = "1")]
577    pub value: bool,
578}
579#[derive(Clone, PartialEq, ::prost::Message)]
580pub struct TextFieldValue {
581    /// Default to empty string if not set
582    #[prost(string, optional, tag = "1")]
583    pub value: ::core::option::Option<::prost::alloc::string::String>,
584}
585#[derive(Clone, Copy, PartialEq, ::prost::Message)]
586pub struct IntFieldValue {
587    #[prost(int64, optional, tag = "1")]
588    pub value: ::core::option::Option<i64>,
589}
590#[derive(Clone, Copy, PartialEq, ::prost::Message)]
591pub struct DoubleFieldValue {
592    #[prost(double, optional, tag = "1")]
593    pub value: ::core::option::Option<f64>,
594}
595#[derive(Clone, PartialEq, ::prost::Message)]
596pub struct SingleEnumFieldValue {
597    /// Default to empty string if not set
598    #[prost(string, optional, tag = "1")]
599    pub value: ::core::option::Option<::prost::alloc::string::String>,
600}
601#[derive(Clone, PartialEq, ::prost::Message)]
602pub struct MultiEnumFieldValue {
603    /// Default to empty list if not set
604    #[prost(string, repeated, tag = "1")]
605    pub value: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
606}
607/// Corresponds to usage of the upload api
608#[derive(Clone, PartialEq, ::prost::Message)]
609pub struct FileUploadFieldValue {
610    #[prost(oneof = "file_upload_field_value::UploadType", tags = "1")]
611    pub upload_type: ::core::option::Option<file_upload_field_value::UploadType>,
612}
613/// Nested message and enum types in `FileUploadFieldValue`.
614pub mod file_upload_field_value {
615    #[derive(Clone, PartialEq, ::prost::Oneof)]
616    pub enum UploadType {
617        #[prost(message, tag = "1")]
618        S3Upload(super::S3UploadFileValue),
619    }
620}
621#[derive(Clone, PartialEq, ::prost::Message)]
622pub struct S3UploadFileValue {
623    /// The S3 path where the uploaded file is stored
624    #[prost(string, tag = "1")]
625    pub s3_path: ::prost::alloc::string::String,
626    /// The original filename of the uploaded file
627    #[prost(string, tag = "2")]
628    pub file_name: ::prost::alloc::string::String,
629    /// The MIME type of the uploaded file
630    /// 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)
631    #[prost(string, optional, tag = "3")]
632    pub file_type: ::core::option::Option<::prost::alloc::string::String>,
633}
634#[derive(Clone, PartialEq, ::prost::Message)]
635pub struct MultiFileUploadFieldValue {
636    /// The list of uploads
637    #[prost(message, repeated, tag = "1")]
638    pub uploads: ::prost::alloc::vec::Vec<FileUploadFieldValue>,
639}
640#[derive(Clone, PartialEq, ::prost::Message)]
641pub struct ProcedureExecution {
642    #[prost(string, tag = "1")]
643    pub rid: ::prost::alloc::string::String,
644    #[prost(message, optional, tag = "2")]
645    pub metadata: ::core::option::Option<ProcedureExecutionMetadata>,
646    #[prost(message, optional, tag = "3")]
647    pub state: ::core::option::Option<ProcedureExecutionState>,
648}
649#[derive(Clone, PartialEq, ::prost::Message)]
650pub struct ProcedureExecutionMetadata {
651    #[prost(string, tag = "1")]
652    pub rid: ::prost::alloc::string::String,
653    /// The procedure template rid this execution is based on.
654    #[prost(string, tag = "2")]
655    pub procedure_rid: ::prost::alloc::string::String,
656    /// The commit ID of the procedure template this execution is based on.
657    /// This can be overridden at the node level for individual nodes.
658    #[prost(string, tag = "3")]
659    pub procedure_commit_id: ::prost::alloc::string::String,
660    #[prost(string, tag = "4")]
661    pub title: ::prost::alloc::string::String,
662    #[prost(string, optional, tag = "5")]
663    pub description: ::core::option::Option<::prost::alloc::string::String>,
664    #[prost(string, repeated, tag = "6")]
665    pub labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
666    #[prost(map = "string, string", tag = "7")]
667    pub properties: ::std::collections::HashMap<
668        ::prost::alloc::string::String,
669        ::prost::alloc::string::String,
670    >,
671    #[prost(string, tag = "8")]
672    pub created_by: ::prost::alloc::string::String,
673    #[prost(message, optional, tag = "9")]
674    pub created_at: ::core::option::Option<
675        super::super::super::super::google::protobuf::Timestamp,
676    >,
677    #[prost(string, tag = "10")]
678    pub updated_by: ::prost::alloc::string::String,
679    #[prost(message, optional, tag = "11")]
680    pub updated_at: ::core::option::Option<
681        super::super::super::super::google::protobuf::Timestamp,
682    >,
683    /// Will be unset until the execution transitions from NOT_STARTED to IN_PROGRESS.
684    #[prost(message, optional, tag = "12")]
685    pub started_at: ::core::option::Option<
686        super::super::super::super::google::protobuf::Timestamp,
687    >,
688    #[prost(string, optional, tag = "13")]
689    pub started_by: ::core::option::Option<::prost::alloc::string::String>,
690    /// Will be unset until the execution transitions from IN_PROGRESS to a terminal state.
691    #[prost(message, optional, tag = "14")]
692    pub finished_at: ::core::option::Option<
693        super::super::super::super::google::protobuf::Timestamp,
694    >,
695    #[prost(string, optional, tag = "15")]
696    pub finished_by: ::core::option::Option<::prost::alloc::string::String>,
697    /// Will be true/set if the execution is the ABORTED terminal state.
698    #[prost(message, optional, tag = "16")]
699    pub aborted_at: ::core::option::Option<
700        super::super::super::super::google::protobuf::Timestamp,
701    >,
702    #[prost(string, optional, tag = "17")]
703    pub aborted_by: ::core::option::Option<::prost::alloc::string::String>,
704    /// Will be set if the execution is in the ERRORED terminal state.
705    #[prost(message, optional, tag = "18")]
706    pub failed_at: ::core::option::Option<
707        super::super::super::super::google::protobuf::Timestamp,
708    >,
709    #[prost(string, optional, tag = "19")]
710    pub failed_by: ::core::option::Option<::prost::alloc::string::String>,
711    #[prost(string, optional, tag = "20")]
712    pub failed_reason: ::core::option::Option<::prost::alloc::string::String>,
713}
714/// ProcedureExecutionState is the state of an executing procedure.
715#[derive(Clone, PartialEq, ::prost::Message)]
716pub struct ProcedureExecutionState {
717    /// The current values for the global fields in the procedure.
718    #[prost(map = "string, message", tag = "1")]
719    pub global_fields: ::std::collections::HashMap<
720        ::prost::alloc::string::String,
721        FieldOutput,
722    >,
723    /// A map from execution node ID to the execution node.
724    #[prost(map = "string, message", tag = "2")]
725    pub nodes: ::std::collections::HashMap<
726        ::prost::alloc::string::String,
727        ProcedureExecutionNode,
728    >,
729    /// Section edges represent the visual grouping of sections and steps.
730    /// All keys are IDs for section nodes, and all values are lists of IDs for section or step nodes.
731    /// { A, \[B, C\] } means that section A visually groups nodes B and C together.
732    #[prost(map = "string, message", tag = "3")]
733    pub section_edges: ::std::collections::HashMap<
734        ::prost::alloc::string::String,
735        super::super::v1::NodeList,
736    >,
737    /// Step edges represent the dependencies between steps.
738    /// All keys and values are IDs for step nodes.
739    /// { A, \[B, C\] } means that steps B and C depend on step A to complete to be started
740    #[prost(map = "string, message", tag = "4")]
741    pub step_edges: ::std::collections::HashMap<
742        ::prost::alloc::string::String,
743        super::super::v1::NodeList,
744    >,
745}
746#[derive(Clone, PartialEq, ::prost::Message)]
747pub struct Strings {
748    #[prost(string, repeated, tag = "1")]
749    pub values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
750}
751/// TODO(pchen): how to handle the value typing here
752/// The outputs of a field in a step.
753/// This is different from FormFieldValue in that this represents the resolved value after the step has
754/// been completed. Eg, this would contain an AssetRid while the FormFieldValue could contain an AssetReference
755#[derive(Clone, PartialEq, ::prost::Message)]
756pub struct FieldOutput {
757    /// The oneof can be unset if the field has not been set yet.
758    #[prost(oneof = "field_output::Output", tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10")]
759    pub output: ::core::option::Option<field_output::Output>,
760}
761/// Nested message and enum types in `FieldOutput`.
762pub mod field_output {
763    /// The oneof can be unset if the field has not been set yet.
764    #[derive(Clone, PartialEq, ::prost::Oneof)]
765    pub enum Output {
766        /// TODO(niwong): I think this could actually be buf validated to be required. If a global field is
767        /// not yet defined, I think it's just not present in the global_fields map
768        /// option (buf.validate.oneof) = {required: true};
769        #[prost(string, tag = "1")]
770        AssetRid(::prost::alloc::string::String),
771        #[prost(string, tag = "2")]
772        StringValue(::prost::alloc::string::String),
773        #[prost(double, tag = "3")]
774        DoubleValue(f64),
775        #[prost(bool, tag = "4")]
776        BooleanValue(bool),
777        #[prost(int64, tag = "5")]
778        IntValue(i64),
779        #[prost(message, tag = "6")]
780        StringsValue(super::Strings),
781        #[prost(string, tag = "7")]
782        IngestJobRid(::prost::alloc::string::String),
783        #[prost(string, tag = "8")]
784        RunRid(::prost::alloc::string::String),
785        #[prost(message, tag = "9")]
786        FileUploadValue(super::FileUploadFieldValue),
787        #[prost(message, tag = "10")]
788        MultiFileUploadValue(super::MultiFileUploadFieldValue),
789    }
790}
791#[derive(Clone, PartialEq, ::prost::Message)]
792pub struct CreateProcedureExecutionRequest {
793    #[prost(string, tag = "1")]
794    pub procedure_rid: ::prost::alloc::string::String,
795    #[prost(string, tag = "2")]
796    pub procedure_commit_id: ::prost::alloc::string::String,
797    #[prost(string, tag = "3")]
798    pub title: ::prost::alloc::string::String,
799    #[prost(string, optional, tag = "4")]
800    pub description: ::core::option::Option<::prost::alloc::string::String>,
801    #[prost(bool, optional, tag = "5")]
802    pub start_immediately: ::core::option::Option<bool>,
803}
804#[derive(Clone, PartialEq, ::prost::Message)]
805pub struct CreateProcedureExecutionResponse {
806    #[prost(message, optional, tag = "1")]
807    pub procedure_execution: ::core::option::Option<ProcedureExecution>,
808}
809#[derive(Clone, PartialEq, ::prost::Message)]
810pub struct GetProcedureExecutionRequest {
811    #[prost(string, tag = "1")]
812    pub procedure_execution_rid: ::prost::alloc::string::String,
813    /// If true, the display graph will be included in the response.
814    /// Default is false.
815    #[prost(bool, tag = "2")]
816    pub include_display_graph: bool,
817}
818#[derive(Clone, PartialEq, ::prost::Message)]
819pub struct GetProcedureExecutionResponse {
820    #[prost(message, optional, tag = "1")]
821    pub procedure_execution: ::core::option::Option<ProcedureExecution>,
822    /// Included if include_display_graph was set to true. Note that this is the
823    /// procedure template's display graph, not the execution graph.
824    #[prost(message, optional, tag = "2")]
825    pub display_graph: ::core::option::Option<super::super::v1::ProcedureDisplayGraph>,
826}
827#[derive(Clone, PartialEq, ::prost::Message)]
828pub struct UpdateProcedureExecutionMetadataRequest {
829    #[prost(string, tag = "1")]
830    pub procedure_execution_rid: ::prost::alloc::string::String,
831    #[prost(string, optional, tag = "2")]
832    pub title: ::core::option::Option<::prost::alloc::string::String>,
833    #[prost(string, optional, tag = "3")]
834    pub description: ::core::option::Option<::prost::alloc::string::String>,
835    #[prost(string, optional, tag = "4")]
836    pub commit_id: ::core::option::Option<::prost::alloc::string::String>,
837    #[prost(message, optional, tag = "5")]
838    pub labels: ::core::option::Option<super::super::super::types::LabelUpdateWrapper>,
839    #[prost(message, optional, tag = "6")]
840    pub properties: ::core::option::Option<
841        super::super::super::types::PropertyUpdateWrapper,
842    >,
843}
844#[derive(Clone, PartialEq, ::prost::Message)]
845pub struct UpdateProcedureExecutionMetadataResponse {
846    #[prost(message, optional, tag = "1")]
847    pub metadata: ::core::option::Option<ProcedureExecutionMetadata>,
848}
849/// TODO(niwong to pchen): I made an "update metadata" endpoint separately above,
850/// I think it'd be nice to turn this into a dedicated endpoint for changing the state of
851/// the overall execution (start, succeed, abort, fail)
852/// I also think in general we shouldn't be updating the entire ProcedureExecutionState
853/// but rather leveraging updateStep.
854/// TODO(WB-1879): allow to just update the global fields within the ProcExecState.
855#[derive(Clone, PartialEq, ::prost::Message)]
856pub struct UpdateProcedureExecutionRequest {
857    #[prost(string, tag = "1")]
858    pub procedure_execution_rid: ::prost::alloc::string::String,
859    #[prost(string, optional, tag = "2")]
860    pub title: ::core::option::Option<::prost::alloc::string::String>,
861    #[prost(string, optional, tag = "3")]
862    pub description: ::core::option::Option<::prost::alloc::string::String>,
863    #[prost(string, optional, tag = "4")]
864    pub commit_id: ::core::option::Option<::prost::alloc::string::String>,
865    #[prost(message, optional, tag = "5")]
866    pub labels: ::core::option::Option<super::super::super::types::LabelUpdateWrapper>,
867    #[prost(message, optional, tag = "6")]
868    pub properties: ::core::option::Option<
869        super::super::super::types::PropertyUpdateWrapper,
870    >,
871    #[prost(message, optional, tag = "7")]
872    pub state: ::core::option::Option<ProcedureExecutionState>,
873    #[prost(bool, optional, tag = "8")]
874    pub is_aborted: ::core::option::Option<bool>,
875    #[prost(message, optional, tag = "9")]
876    pub started_at: ::core::option::Option<
877        super::super::super::super::google::protobuf::Timestamp,
878    >,
879    #[prost(message, optional, tag = "10")]
880    pub finished_at: ::core::option::Option<
881        super::super::super::super::google::protobuf::Timestamp,
882    >,
883}
884#[derive(Clone, PartialEq, ::prost::Message)]
885pub struct UpdateProcedureExecutionResponse {
886    #[prost(message, optional, tag = "1")]
887    pub procedure_execution: ::core::option::Option<ProcedureExecution>,
888}
889#[derive(Clone, PartialEq, ::prost::Message)]
890pub struct UpdateStepRequest {
891    #[prost(string, tag = "1")]
892    pub procedure_execution_rid: ::prost::alloc::string::String,
893    /// The unique identifier of the execution step to update.
894    #[prost(string, tag = "2")]
895    pub step_id: ::prost::alloc::string::String,
896    /// Setting the value of the step's content. This is only allowed if the step is NOT_STARTED
897    /// or IN_PROGRESS.
898    #[prost(message, optional, tag = "3")]
899    pub value: ::core::option::Option<StepContentValue>,
900    /// Set whether the step has auto-proceed enabled. This is only allowed if the step is NOT_STARTED.
901    /// or IN_PROGRESS.
902    #[prost(message, optional, tag = "4")]
903    pub auto_proceed_config: ::core::option::Option<super::super::v1::AutoProceedConfig>,
904    /// Setting the state of the step. This will occur after the other updates in this request.
905    #[prost(message, optional, tag = "5")]
906    pub target_state: ::core::option::Option<TargetStepStateRequest>,
907}
908#[derive(Clone, PartialEq, ::prost::Message)]
909pub struct UpdateStepResponse {
910    #[prost(message, optional, tag = "1")]
911    pub procedure_execution: ::core::option::Option<ProcedureExecution>,
912}
913#[derive(Clone, PartialEq, ::prost::Message)]
914pub struct UpdateStepSuccessConditionStatusRequest {
915    #[prost(string, tag = "1")]
916    pub procedure_execution_rid: ::prost::alloc::string::String,
917    /// The unique identifier of the execution step to update.
918    #[prost(string, tag = "2")]
919    pub step_id: ::prost::alloc::string::String,
920    /// Setting the success_condition_status is only allowed if the step is SUBMITTED
921    /// and should only be done by the backend while monitoring the condition.
922    /// If the step is SKIPPED, the success_condition_status will still be set but
923    /// no completion actions will be run and the step's state will not be updated.
924    #[prost(message, optional, tag = "3")]
925    pub success_condition_status: ::core::option::Option<SuccessConditionStatus>,
926}
927#[derive(Clone, PartialEq, ::prost::Message)]
928pub struct UpdateStepSuccessConditionStatusResponse {
929    #[prost(message, optional, tag = "1")]
930    pub procedure_execution: ::core::option::Option<ProcedureExecution>,
931}
932#[derive(Clone, PartialEq, ::prost::Message)]
933pub struct RepeatStepRequest {
934    #[prost(string, tag = "1")]
935    pub procedure_execution_rid: ::prost::alloc::string::String,
936    /// The unique identifier of the execution step to repeat/duplicate.
937    #[prost(string, tag = "2")]
938    pub step_id: ::prost::alloc::string::String,
939    /// Behavior for how repeating the step will affect dependants.
940    #[prost(enumeration = "RepeatStepBehavior", tag = "6")]
941    pub behavior: i32,
942    /// Setting the value of the step's content.
943    #[prost(message, optional, tag = "3")]
944    pub value: ::core::option::Option<StepContentValue>,
945    /// Set whether the step has auto-proceed enabled.
946    #[prost(message, optional, tag = "4")]
947    pub auto_proceed_config: ::core::option::Option<super::super::v1::AutoProceedConfig>,
948    /// Setting the state of the step. This will occur after the other updates in this request.
949    #[prost(message, optional, tag = "5")]
950    pub target_state: ::core::option::Option<TargetStepStateRequest>,
951}
952#[derive(Clone, PartialEq, ::prost::Message)]
953pub struct RepeatStepResponse {
954    #[prost(message, optional, tag = "1")]
955    pub procedure_execution: ::core::option::Option<ProcedureExecution>,
956}
957#[derive(Clone, PartialEq, ::prost::Message)]
958pub struct ProcedureExecutionSearchQuery {
959    #[prost(
960        oneof = "procedure_execution_search_query::Query",
961        tags = "1, 2, 3, 4, 5, 6, 7, 8, 9"
962    )]
963    pub query: ::core::option::Option<procedure_execution_search_query::Query>,
964}
965/// Nested message and enum types in `ProcedureExecutionSearchQuery`.
966pub mod procedure_execution_search_query {
967    #[derive(Clone, PartialEq, ::prost::Message)]
968    pub struct ProcedureExecutionSearchAndQuery {
969        #[prost(message, repeated, tag = "1")]
970        pub queries: ::prost::alloc::vec::Vec<super::ProcedureExecutionSearchQuery>,
971    }
972    #[derive(Clone, PartialEq, ::prost::Message)]
973    pub struct ProcedureExecutionSearchOrQuery {
974        #[prost(message, repeated, tag = "1")]
975        pub queries: ::prost::alloc::vec::Vec<super::ProcedureExecutionSearchQuery>,
976    }
977    #[derive(Clone, PartialEq, ::prost::Oneof)]
978    pub enum Query {
979        #[prost(string, tag = "1")]
980        SearchText(::prost::alloc::string::String),
981        #[prost(string, tag = "2")]
982        Label(::prost::alloc::string::String),
983        #[prost(message, tag = "3")]
984        Property(super::super::super::super::types::Property),
985        #[prost(message, tag = "4")]
986        And(ProcedureExecutionSearchAndQuery),
987        #[prost(message, tag = "5")]
988        Or(ProcedureExecutionSearchOrQuery),
989        #[prost(string, tag = "6")]
990        Workspace(::prost::alloc::string::String),
991        #[prost(string, tag = "7")]
992        ProcedureRid(::prost::alloc::string::String),
993        #[prost(string, tag = "8")]
994        CommitId(::prost::alloc::string::String),
995        #[prost(string, tag = "9")]
996        CreatedBy(::prost::alloc::string::String),
997    }
998}
999#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1000pub struct ProcedureExecutionSortOptions {
1001    #[prost(bool, tag = "1")]
1002    pub is_descending: bool,
1003    #[prost(enumeration = "SearchProcedureExecutionsSortField", tag = "2")]
1004    pub sort_field: i32,
1005}
1006#[derive(Clone, PartialEq, ::prost::Message)]
1007pub struct SearchProcedureExecutionsRequest {
1008    #[prost(message, optional, tag = "1")]
1009    pub query: ::core::option::Option<ProcedureExecutionSearchQuery>,
1010    #[prost(message, optional, tag = "2")]
1011    pub sort_options: ::core::option::Option<ProcedureExecutionSortOptions>,
1012    /// Page sizes greater than 1_000 will be rejected. Default pageSize is 100.
1013    #[prost(int32, optional, tag = "3")]
1014    pub page_size: ::core::option::Option<i32>,
1015    #[prost(string, optional, tag = "4")]
1016    pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
1017}
1018#[derive(Clone, PartialEq, ::prost::Message)]
1019pub struct SearchProcedureExecutionsResponse {
1020    #[prost(message, repeated, tag = "1")]
1021    pub procedure_executions: ::prost::alloc::vec::Vec<ProcedureExecutionMetadata>,
1022    #[prost(string, optional, tag = "2")]
1023    pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
1024}
1025#[derive(Clone, PartialEq, ::prost::Message)]
1026pub struct BatchGetProcedureExecutionMetadataRequest {
1027    #[prost(string, repeated, tag = "1")]
1028    pub procedure_execution_rids: ::prost::alloc::vec::Vec<
1029        ::prost::alloc::string::String,
1030    >,
1031}
1032#[derive(Clone, PartialEq, ::prost::Message)]
1033pub struct BatchGetProcedureExecutionMetadataResponse {
1034    #[prost(message, repeated, tag = "1")]
1035    pub procedure_executions: ::prost::alloc::vec::Vec<ProcedureExecutionMetadata>,
1036}
1037#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1038#[repr(i32)]
1039pub enum RepeatStepBehavior {
1040    Unspecified = 0,
1041    /// The targeted step will be repeated, but the original graph will be preserved
1042    /// and only direct children will be checked for state updates
1043    Isolated = 1,
1044}
1045impl RepeatStepBehavior {
1046    /// String value of the enum field names used in the ProtoBuf definition.
1047    ///
1048    /// The values are not transformed in any way and thus are considered stable
1049    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1050    pub fn as_str_name(&self) -> &'static str {
1051        match self {
1052            Self::Unspecified => "REPEAT_STEP_BEHAVIOR_UNSPECIFIED",
1053            Self::Isolated => "REPEAT_STEP_BEHAVIOR_ISOLATED",
1054        }
1055    }
1056    /// Creates an enum from field names used in the ProtoBuf definition.
1057    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1058        match value {
1059            "REPEAT_STEP_BEHAVIOR_UNSPECIFIED" => Some(Self::Unspecified),
1060            "REPEAT_STEP_BEHAVIOR_ISOLATED" => Some(Self::Isolated),
1061            _ => None,
1062        }
1063    }
1064}
1065#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1066#[repr(i32)]
1067pub enum SearchProcedureExecutionsSortField {
1068    Unspecified = 0,
1069    CreatedAt = 1,
1070    StartedAt = 2,
1071    FinishedAt = 3,
1072    UpdatedAt = 4,
1073}
1074impl SearchProcedureExecutionsSortField {
1075    /// String value of the enum field names used in the ProtoBuf definition.
1076    ///
1077    /// The values are not transformed in any way and thus are considered stable
1078    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1079    pub fn as_str_name(&self) -> &'static str {
1080        match self {
1081            Self::Unspecified => "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_UNSPECIFIED",
1082            Self::CreatedAt => "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_CREATED_AT",
1083            Self::StartedAt => "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_STARTED_AT",
1084            Self::FinishedAt => "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_FINISHED_AT",
1085            Self::UpdatedAt => "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_UPDATED_AT",
1086        }
1087    }
1088    /// Creates an enum from field names used in the ProtoBuf definition.
1089    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1090        match value {
1091            "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_UNSPECIFIED" => {
1092                Some(Self::Unspecified)
1093            }
1094            "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_CREATED_AT" => Some(Self::CreatedAt),
1095            "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_STARTED_AT" => Some(Self::StartedAt),
1096            "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_FINISHED_AT" => {
1097                Some(Self::FinishedAt)
1098            }
1099            "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_UPDATED_AT" => Some(Self::UpdatedAt),
1100            _ => None,
1101        }
1102    }
1103}
1104#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1105#[repr(i32)]
1106pub enum ProcedureExecutionsServiceError {
1107    Unspecified = 0,
1108    NotFound = 1,
1109    ProcNotFound = 2,
1110    NodeNotFound = 3,
1111    InvalidNode = 4,
1112    InvalidGraph = 5,
1113    InvalidStepTransition = 6,
1114    InvalidSearchToken = 7,
1115    InvalidStepUpdate = 8,
1116}
1117impl ProcedureExecutionsServiceError {
1118    /// String value of the enum field names used in the ProtoBuf definition.
1119    ///
1120    /// The values are not transformed in any way and thus are considered stable
1121    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1122    pub fn as_str_name(&self) -> &'static str {
1123        match self {
1124            Self::Unspecified => "PROCEDURE_EXECUTIONS_SERVICE_ERROR_UNSPECIFIED",
1125            Self::NotFound => "PROCEDURE_EXECUTIONS_SERVICE_ERROR_NOT_FOUND",
1126            Self::ProcNotFound => "PROCEDURE_EXECUTIONS_SERVICE_ERROR_PROC_NOT_FOUND",
1127            Self::NodeNotFound => "PROCEDURE_EXECUTIONS_SERVICE_ERROR_NODE_NOT_FOUND",
1128            Self::InvalidNode => "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_NODE",
1129            Self::InvalidGraph => "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_GRAPH",
1130            Self::InvalidStepTransition => {
1131                "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_STEP_TRANSITION"
1132            }
1133            Self::InvalidSearchToken => {
1134                "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_SEARCH_TOKEN"
1135            }
1136            Self::InvalidStepUpdate => {
1137                "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_STEP_UPDATE"
1138            }
1139        }
1140    }
1141    /// Creates an enum from field names used in the ProtoBuf definition.
1142    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1143        match value {
1144            "PROCEDURE_EXECUTIONS_SERVICE_ERROR_UNSPECIFIED" => Some(Self::Unspecified),
1145            "PROCEDURE_EXECUTIONS_SERVICE_ERROR_NOT_FOUND" => Some(Self::NotFound),
1146            "PROCEDURE_EXECUTIONS_SERVICE_ERROR_PROC_NOT_FOUND" => {
1147                Some(Self::ProcNotFound)
1148            }
1149            "PROCEDURE_EXECUTIONS_SERVICE_ERROR_NODE_NOT_FOUND" => {
1150                Some(Self::NodeNotFound)
1151            }
1152            "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_NODE" => Some(Self::InvalidNode),
1153            "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_GRAPH" => {
1154                Some(Self::InvalidGraph)
1155            }
1156            "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_STEP_TRANSITION" => {
1157                Some(Self::InvalidStepTransition)
1158            }
1159            "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_SEARCH_TOKEN" => {
1160                Some(Self::InvalidSearchToken)
1161            }
1162            "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_STEP_UPDATE" => {
1163                Some(Self::InvalidStepUpdate)
1164            }
1165            _ => None,
1166        }
1167    }
1168}
1169/// Generated client implementations.
1170pub mod procedure_executions_service_client {
1171    #![allow(
1172        unused_variables,
1173        dead_code,
1174        missing_docs,
1175        clippy::wildcard_imports,
1176        clippy::let_unit_value,
1177    )]
1178    use tonic::codegen::*;
1179    use tonic::codegen::http::Uri;
1180    /// Service for creating and managing procedure executions.
1181    #[derive(Debug, Clone)]
1182    pub struct ProcedureExecutionsServiceClient<T> {
1183        inner: tonic::client::Grpc<T>,
1184    }
1185    impl ProcedureExecutionsServiceClient<tonic::transport::Channel> {
1186        /// Attempt to create a new client by connecting to a given endpoint.
1187        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1188        where
1189            D: TryInto<tonic::transport::Endpoint>,
1190            D::Error: Into<StdError>,
1191        {
1192            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1193            Ok(Self::new(conn))
1194        }
1195    }
1196    impl<T> ProcedureExecutionsServiceClient<T>
1197    where
1198        T: tonic::client::GrpcService<tonic::body::Body>,
1199        T::Error: Into<StdError>,
1200        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1201        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1202    {
1203        pub fn new(inner: T) -> Self {
1204            let inner = tonic::client::Grpc::new(inner);
1205            Self { inner }
1206        }
1207        pub fn with_origin(inner: T, origin: Uri) -> Self {
1208            let inner = tonic::client::Grpc::with_origin(inner, origin);
1209            Self { inner }
1210        }
1211        pub fn with_interceptor<F>(
1212            inner: T,
1213            interceptor: F,
1214        ) -> ProcedureExecutionsServiceClient<InterceptedService<T, F>>
1215        where
1216            F: tonic::service::Interceptor,
1217            T::ResponseBody: Default,
1218            T: tonic::codegen::Service<
1219                http::Request<tonic::body::Body>,
1220                Response = http::Response<
1221                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
1222                >,
1223            >,
1224            <T as tonic::codegen::Service<
1225                http::Request<tonic::body::Body>,
1226            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1227        {
1228            ProcedureExecutionsServiceClient::new(
1229                InterceptedService::new(inner, interceptor),
1230            )
1231        }
1232        /// Compress requests with the given encoding.
1233        ///
1234        /// This requires the server to support it otherwise it might respond with an
1235        /// error.
1236        #[must_use]
1237        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1238            self.inner = self.inner.send_compressed(encoding);
1239            self
1240        }
1241        /// Enable decompressing responses.
1242        #[must_use]
1243        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1244            self.inner = self.inner.accept_compressed(encoding);
1245            self
1246        }
1247        /// Limits the maximum size of a decoded message.
1248        ///
1249        /// Default: `4MB`
1250        #[must_use]
1251        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1252            self.inner = self.inner.max_decoding_message_size(limit);
1253            self
1254        }
1255        /// Limits the maximum size of an encoded message.
1256        ///
1257        /// Default: `usize::MAX`
1258        #[must_use]
1259        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1260            self.inner = self.inner.max_encoding_message_size(limit);
1261            self
1262        }
1263        /// Create a new procedure execution from a procedure
1264        pub async fn create_procedure_execution(
1265            &mut self,
1266            request: impl tonic::IntoRequest<super::CreateProcedureExecutionRequest>,
1267        ) -> std::result::Result<
1268            tonic::Response<super::CreateProcedureExecutionResponse>,
1269            tonic::Status,
1270        > {
1271            self.inner
1272                .ready()
1273                .await
1274                .map_err(|e| {
1275                    tonic::Status::unknown(
1276                        format!("Service was not ready: {}", e.into()),
1277                    )
1278                })?;
1279            let codec = tonic::codec::ProstCodec::default();
1280            let path = http::uri::PathAndQuery::from_static(
1281                "/nominal.procedures.executions.v1.ProcedureExecutionsService/CreateProcedureExecution",
1282            );
1283            let mut req = request.into_request();
1284            req.extensions_mut()
1285                .insert(
1286                    GrpcMethod::new(
1287                        "nominal.procedures.executions.v1.ProcedureExecutionsService",
1288                        "CreateProcedureExecution",
1289                    ),
1290                );
1291            self.inner.unary(req, path, codec).await
1292        }
1293        /// Get a procedure execution by its RID
1294        pub async fn get_procedure_execution(
1295            &mut self,
1296            request: impl tonic::IntoRequest<super::GetProcedureExecutionRequest>,
1297        ) -> std::result::Result<
1298            tonic::Response<super::GetProcedureExecutionResponse>,
1299            tonic::Status,
1300        > {
1301            self.inner
1302                .ready()
1303                .await
1304                .map_err(|e| {
1305                    tonic::Status::unknown(
1306                        format!("Service was not ready: {}", e.into()),
1307                    )
1308                })?;
1309            let codec = tonic::codec::ProstCodec::default();
1310            let path = http::uri::PathAndQuery::from_static(
1311                "/nominal.procedures.executions.v1.ProcedureExecutionsService/GetProcedureExecution",
1312            );
1313            let mut req = request.into_request();
1314            req.extensions_mut()
1315                .insert(
1316                    GrpcMethod::new(
1317                        "nominal.procedures.executions.v1.ProcedureExecutionsService",
1318                        "GetProcedureExecution",
1319                    ),
1320                );
1321            self.inner.unary(req, path, codec).await
1322        }
1323        /// Update the metadata of a procedure execution
1324        pub async fn update_procedure_execution_metadata(
1325            &mut self,
1326            request: impl tonic::IntoRequest<
1327                super::UpdateProcedureExecutionMetadataRequest,
1328            >,
1329        ) -> std::result::Result<
1330            tonic::Response<super::UpdateProcedureExecutionMetadataResponse>,
1331            tonic::Status,
1332        > {
1333            self.inner
1334                .ready()
1335                .await
1336                .map_err(|e| {
1337                    tonic::Status::unknown(
1338                        format!("Service was not ready: {}", e.into()),
1339                    )
1340                })?;
1341            let codec = tonic::codec::ProstCodec::default();
1342            let path = http::uri::PathAndQuery::from_static(
1343                "/nominal.procedures.executions.v1.ProcedureExecutionsService/UpdateProcedureExecutionMetadata",
1344            );
1345            let mut req = request.into_request();
1346            req.extensions_mut()
1347                .insert(
1348                    GrpcMethod::new(
1349                        "nominal.procedures.executions.v1.ProcedureExecutionsService",
1350                        "UpdateProcedureExecutionMetadata",
1351                    ),
1352                );
1353            self.inner.unary(req, path, codec).await
1354        }
1355        /// Heavy-handed update method for procedure execution
1356        /// TODO(pchen): This isn't the expected final endpoint, this is just for editing the graph while we iterate
1357        /// There likely be additional fine-grained methods for editing the procedure
1358        pub async fn update_procedure_execution(
1359            &mut self,
1360            request: impl tonic::IntoRequest<super::UpdateProcedureExecutionRequest>,
1361        ) -> std::result::Result<
1362            tonic::Response<super::UpdateProcedureExecutionResponse>,
1363            tonic::Status,
1364        > {
1365            self.inner
1366                .ready()
1367                .await
1368                .map_err(|e| {
1369                    tonic::Status::unknown(
1370                        format!("Service was not ready: {}", e.into()),
1371                    )
1372                })?;
1373            let codec = tonic::codec::ProstCodec::default();
1374            let path = http::uri::PathAndQuery::from_static(
1375                "/nominal.procedures.executions.v1.ProcedureExecutionsService/UpdateProcedureExecution",
1376            );
1377            let mut req = request.into_request();
1378            req.extensions_mut()
1379                .insert(
1380                    GrpcMethod::new(
1381                        "nominal.procedures.executions.v1.ProcedureExecutionsService",
1382                        "UpdateProcedureExecution",
1383                    ),
1384                );
1385            self.inner.unary(req, path, codec).await
1386        }
1387        /// Update the status of a step in a procedure execution. This can only be done if the step is NOT_STARTED,
1388        /// IN_PROGRESS, or SUBMITTED. Other state transitions are managed by the backend.
1389        pub async fn update_step(
1390            &mut self,
1391            request: impl tonic::IntoRequest<super::UpdateStepRequest>,
1392        ) -> std::result::Result<
1393            tonic::Response<super::UpdateStepResponse>,
1394            tonic::Status,
1395        > {
1396            self.inner
1397                .ready()
1398                .await
1399                .map_err(|e| {
1400                    tonic::Status::unknown(
1401                        format!("Service was not ready: {}", e.into()),
1402                    )
1403                })?;
1404            let codec = tonic::codec::ProstCodec::default();
1405            let path = http::uri::PathAndQuery::from_static(
1406                "/nominal.procedures.executions.v1.ProcedureExecutionsService/UpdateStep",
1407            );
1408            let mut req = request.into_request();
1409            req.extensions_mut()
1410                .insert(
1411                    GrpcMethod::new(
1412                        "nominal.procedures.executions.v1.ProcedureExecutionsService",
1413                        "UpdateStep",
1414                    ),
1415                );
1416            self.inner.unary(req, path, codec).await
1417        }
1418        /// This should only be called by the backend to update the success_condition_status of a step.
1419        /// This can only be done if the step is SUBMITTED.
1420        pub async fn update_step_success_condition_status(
1421            &mut self,
1422            request: impl tonic::IntoRequest<
1423                super::UpdateStepSuccessConditionStatusRequest,
1424            >,
1425        ) -> std::result::Result<
1426            tonic::Response<super::UpdateStepSuccessConditionStatusResponse>,
1427            tonic::Status,
1428        > {
1429            self.inner
1430                .ready()
1431                .await
1432                .map_err(|e| {
1433                    tonic::Status::unknown(
1434                        format!("Service was not ready: {}", e.into()),
1435                    )
1436                })?;
1437            let codec = tonic::codec::ProstCodec::default();
1438            let path = http::uri::PathAndQuery::from_static(
1439                "/nominal.procedures.executions.v1.ProcedureExecutionsService/UpdateStepSuccessConditionStatus",
1440            );
1441            let mut req = request.into_request();
1442            req.extensions_mut()
1443                .insert(
1444                    GrpcMethod::new(
1445                        "nominal.procedures.executions.v1.ProcedureExecutionsService",
1446                        "UpdateStepSuccessConditionStatus",
1447                    ),
1448                );
1449            self.inner.unary(req, path, codec).await
1450        }
1451        /// Repeat a previously finished step in a procedure execution. This can only be done if the given step
1452        /// is in state SUCCEEDED, SKIPPED or ERRORED. Other state transitions are managed by the backend.
1453        pub async fn repeat_step(
1454            &mut self,
1455            request: impl tonic::IntoRequest<super::RepeatStepRequest>,
1456        ) -> std::result::Result<
1457            tonic::Response<super::RepeatStepResponse>,
1458            tonic::Status,
1459        > {
1460            self.inner
1461                .ready()
1462                .await
1463                .map_err(|e| {
1464                    tonic::Status::unknown(
1465                        format!("Service was not ready: {}", e.into()),
1466                    )
1467                })?;
1468            let codec = tonic::codec::ProstCodec::default();
1469            let path = http::uri::PathAndQuery::from_static(
1470                "/nominal.procedures.executions.v1.ProcedureExecutionsService/RepeatStep",
1471            );
1472            let mut req = request.into_request();
1473            req.extensions_mut()
1474                .insert(
1475                    GrpcMethod::new(
1476                        "nominal.procedures.executions.v1.ProcedureExecutionsService",
1477                        "RepeatStep",
1478                    ),
1479                );
1480            self.inner.unary(req, path, codec).await
1481        }
1482        /// Search for procedure executions
1483        pub async fn search_procedure_executions(
1484            &mut self,
1485            request: impl tonic::IntoRequest<super::SearchProcedureExecutionsRequest>,
1486        ) -> std::result::Result<
1487            tonic::Response<super::SearchProcedureExecutionsResponse>,
1488            tonic::Status,
1489        > {
1490            self.inner
1491                .ready()
1492                .await
1493                .map_err(|e| {
1494                    tonic::Status::unknown(
1495                        format!("Service was not ready: {}", e.into()),
1496                    )
1497                })?;
1498            let codec = tonic::codec::ProstCodec::default();
1499            let path = http::uri::PathAndQuery::from_static(
1500                "/nominal.procedures.executions.v1.ProcedureExecutionsService/SearchProcedureExecutions",
1501            );
1502            let mut req = request.into_request();
1503            req.extensions_mut()
1504                .insert(
1505                    GrpcMethod::new(
1506                        "nominal.procedures.executions.v1.ProcedureExecutionsService",
1507                        "SearchProcedureExecutions",
1508                    ),
1509                );
1510            self.inner.unary(req, path, codec).await
1511        }
1512        /// Batch get procedure execution metadata
1513        pub async fn batch_get_procedure_execution_metadata(
1514            &mut self,
1515            request: impl tonic::IntoRequest<
1516                super::BatchGetProcedureExecutionMetadataRequest,
1517            >,
1518        ) -> std::result::Result<
1519            tonic::Response<super::BatchGetProcedureExecutionMetadataResponse>,
1520            tonic::Status,
1521        > {
1522            self.inner
1523                .ready()
1524                .await
1525                .map_err(|e| {
1526                    tonic::Status::unknown(
1527                        format!("Service was not ready: {}", e.into()),
1528                    )
1529                })?;
1530            let codec = tonic::codec::ProstCodec::default();
1531            let path = http::uri::PathAndQuery::from_static(
1532                "/nominal.procedures.executions.v1.ProcedureExecutionsService/BatchGetProcedureExecutionMetadata",
1533            );
1534            let mut req = request.into_request();
1535            req.extensions_mut()
1536                .insert(
1537                    GrpcMethod::new(
1538                        "nominal.procedures.executions.v1.ProcedureExecutionsService",
1539                        "BatchGetProcedureExecutionMetadata",
1540                    ),
1541                );
1542            self.inner.unary(req, path, codec).await
1543        }
1544    }
1545}