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