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