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")]
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}
441#[derive(Clone, PartialEq, ::prost::Message)]
442pub struct FormStepValue {
443    #[prost(message, repeated, tag = "1")]
444    pub fields: ::prost::alloc::vec::Vec<FormFieldValue>,
445}
446/// The value chosen for a form field.
447/// This differs from FormFieldOutput in that this should be very closely tied to the content definition,
448/// while FormFieldOutput contains the resolved values after the execution step is complete.
449#[derive(Clone, PartialEq, ::prost::Message)]
450pub struct FormFieldValue {
451    #[prost(oneof = "form_field_value::Field", tags = "1, 2, 3, 4, 5, 6, 7")]
452    pub field: ::core::option::Option<form_field_value::Field>,
453}
454/// Nested message and enum types in `FormFieldValue`.
455pub mod form_field_value {
456    #[derive(Clone, PartialEq, ::prost::Oneof)]
457    pub enum Field {
458        #[prost(message, tag = "1")]
459        Asset(super::AssetFieldValue),
460        #[prost(message, tag = "2")]
461        Checkbox(super::CheckboxFieldValue),
462        #[prost(message, tag = "3")]
463        Text(super::TextFieldValue),
464        #[prost(message, tag = "4")]
465        Int(super::IntFieldValue),
466        #[prost(message, tag = "5")]
467        Double(super::DoubleFieldValue),
468        #[prost(message, tag = "6")]
469        SingleEnum(super::SingleEnumFieldValue),
470        #[prost(message, tag = "7")]
471        MultiEnum(super::MultiEnumFieldValue),
472    }
473}
474#[derive(Clone, PartialEq, ::prost::Message)]
475pub struct AssetFieldValue {
476    /// This oneof will be unset if no asset is set on the field.
477    #[prost(oneof = "asset_field_value::Asset", tags = "1")]
478    pub asset: ::core::option::Option<asset_field_value::Asset>,
479}
480/// Nested message and enum types in `AssetFieldValue`.
481pub mod asset_field_value {
482    /// This oneof will be unset if no asset is set on the field.
483    #[derive(Clone, PartialEq, ::prost::Oneof)]
484    pub enum Asset {
485        #[prost(message, tag = "1")]
486        AssetReference(super::super::super::v1::AssetReference),
487    }
488}
489#[derive(Clone, Copy, PartialEq, ::prost::Message)]
490pub struct CheckboxFieldValue {
491    /// Default to false if not set
492    #[prost(bool, tag = "1")]
493    pub value: bool,
494}
495#[derive(Clone, PartialEq, ::prost::Message)]
496pub struct TextFieldValue {
497    /// Default to empty string if not set
498    #[prost(string, optional, tag = "1")]
499    pub value: ::core::option::Option<::prost::alloc::string::String>,
500}
501#[derive(Clone, Copy, PartialEq, ::prost::Message)]
502pub struct IntFieldValue {
503    #[prost(int64, optional, tag = "1")]
504    pub value: ::core::option::Option<i64>,
505}
506#[derive(Clone, Copy, PartialEq, ::prost::Message)]
507pub struct DoubleFieldValue {
508    #[prost(double, optional, tag = "1")]
509    pub value: ::core::option::Option<f64>,
510}
511#[derive(Clone, PartialEq, ::prost::Message)]
512pub struct SingleEnumFieldValue {
513    /// Default to empty string if not set
514    #[prost(string, optional, tag = "1")]
515    pub value: ::core::option::Option<::prost::alloc::string::String>,
516}
517#[derive(Clone, PartialEq, ::prost::Message)]
518pub struct MultiEnumFieldValue {
519    /// Default to empty list if not set
520    #[prost(string, repeated, tag = "1")]
521    pub value: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
522}
523#[derive(Clone, PartialEq, ::prost::Message)]
524pub struct ProcedureExecution {
525    #[prost(string, tag = "1")]
526    pub rid: ::prost::alloc::string::String,
527    #[prost(message, optional, tag = "2")]
528    pub metadata: ::core::option::Option<ProcedureExecutionMetadata>,
529    #[prost(message, optional, tag = "3")]
530    pub state: ::core::option::Option<ProcedureExecutionState>,
531}
532#[derive(Clone, PartialEq, ::prost::Message)]
533pub struct ProcedureExecutionMetadata {
534    #[prost(string, tag = "1")]
535    pub rid: ::prost::alloc::string::String,
536    /// The procedure template rid this execution is based on.
537    #[prost(string, tag = "2")]
538    pub procedure_rid: ::prost::alloc::string::String,
539    /// The commit ID of the procedure template this execution is based on.
540    /// This can be overridden at the node level for individual nodes.
541    #[prost(string, tag = "3")]
542    pub procedure_commit_id: ::prost::alloc::string::String,
543    #[prost(string, tag = "4")]
544    pub title: ::prost::alloc::string::String,
545    #[prost(string, optional, tag = "5")]
546    pub description: ::core::option::Option<::prost::alloc::string::String>,
547    #[prost(string, repeated, tag = "6")]
548    pub labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
549    #[prost(map = "string, string", tag = "7")]
550    pub properties: ::std::collections::HashMap<
551        ::prost::alloc::string::String,
552        ::prost::alloc::string::String,
553    >,
554    #[prost(string, tag = "8")]
555    pub created_by: ::prost::alloc::string::String,
556    #[prost(message, optional, tag = "9")]
557    pub created_at: ::core::option::Option<
558        super::super::super::super::google::protobuf::Timestamp,
559    >,
560    #[prost(string, tag = "10")]
561    pub updated_by: ::prost::alloc::string::String,
562    #[prost(message, optional, tag = "11")]
563    pub updated_at: ::core::option::Option<
564        super::super::super::super::google::protobuf::Timestamp,
565    >,
566    /// Will be unset until the execution transitions from NOT_STARTED to IN_PROGRESS.
567    #[prost(message, optional, tag = "12")]
568    pub started_at: ::core::option::Option<
569        super::super::super::super::google::protobuf::Timestamp,
570    >,
571    #[prost(string, optional, tag = "13")]
572    pub started_by: ::core::option::Option<::prost::alloc::string::String>,
573    /// Will be unset until the execution transitions from IN_PROGRESS to a terminal state.
574    #[prost(message, optional, tag = "14")]
575    pub finished_at: ::core::option::Option<
576        super::super::super::super::google::protobuf::Timestamp,
577    >,
578    #[prost(string, optional, tag = "15")]
579    pub finished_by: ::core::option::Option<::prost::alloc::string::String>,
580    /// Will be true/set if the execution is the ABORTED terminal state.
581    #[prost(message, optional, tag = "16")]
582    pub aborted_at: ::core::option::Option<
583        super::super::super::super::google::protobuf::Timestamp,
584    >,
585    #[prost(string, optional, tag = "17")]
586    pub aborted_by: ::core::option::Option<::prost::alloc::string::String>,
587    /// Will be set if the execution is in the ERRORED terminal state.
588    #[prost(message, optional, tag = "18")]
589    pub failed_at: ::core::option::Option<
590        super::super::super::super::google::protobuf::Timestamp,
591    >,
592    #[prost(string, optional, tag = "19")]
593    pub failed_by: ::core::option::Option<::prost::alloc::string::String>,
594    #[prost(string, optional, tag = "20")]
595    pub failed_reason: ::core::option::Option<::prost::alloc::string::String>,
596}
597/// ProcedureExecutionState is the state of an executing procedure.
598#[derive(Clone, PartialEq, ::prost::Message)]
599pub struct ProcedureExecutionState {
600    /// The current values for the global fields in the procedure.
601    #[prost(map = "string, message", tag = "1")]
602    pub global_fields: ::std::collections::HashMap<
603        ::prost::alloc::string::String,
604        FieldOutput,
605    >,
606    /// A map from execution node ID to the execution node.
607    #[prost(map = "string, message", tag = "2")]
608    pub nodes: ::std::collections::HashMap<
609        ::prost::alloc::string::String,
610        ProcedureExecutionNode,
611    >,
612    /// Section edges represent the visual grouping of sections and steps.
613    /// All keys are IDs for section nodes, and all values are lists of IDs for section or step nodes.
614    /// { A, \[B, C\] } means that section A visually groups nodes B and C together.
615    #[prost(map = "string, message", tag = "3")]
616    pub section_edges: ::std::collections::HashMap<
617        ::prost::alloc::string::String,
618        super::super::v1::NodeList,
619    >,
620    /// Step edges represent the dependencies between steps.
621    /// All keys and values are IDs for step nodes.
622    /// { A, \[B, C\] } means that steps B and C depend on step A to complete to be started
623    #[prost(map = "string, message", tag = "4")]
624    pub step_edges: ::std::collections::HashMap<
625        ::prost::alloc::string::String,
626        super::super::v1::NodeList,
627    >,
628}
629#[derive(Clone, PartialEq, ::prost::Message)]
630pub struct Strings {
631    #[prost(string, repeated, tag = "1")]
632    pub values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
633}
634/// TODO(pchen): how to handle the value typing here
635/// The outputs of a field in a step.
636/// This is different from FormFieldValue in that this represents the resolved value after
637/// the step has been completed. Eg, this would contain the AssetRid of an asset chosen via a FieldId.
638#[derive(Clone, PartialEq, ::prost::Message)]
639pub struct FieldOutput {
640    /// The oneof can be unset if the field has not been set yet.
641    #[prost(oneof = "field_output::Output", tags = "1, 2, 3, 4, 5, 6")]
642    pub output: ::core::option::Option<field_output::Output>,
643}
644/// Nested message and enum types in `FieldOutput`.
645pub mod field_output {
646    /// The oneof can be unset if the field has not been set yet.
647    #[derive(Clone, PartialEq, ::prost::Oneof)]
648    pub enum Output {
649        #[prost(string, tag = "1")]
650        AssetRid(::prost::alloc::string::String),
651        #[prost(string, tag = "2")]
652        StringValue(::prost::alloc::string::String),
653        #[prost(double, tag = "3")]
654        DoubleValue(f64),
655        #[prost(bool, tag = "4")]
656        BooleanValue(bool),
657        #[prost(int64, tag = "5")]
658        IntValue(i64),
659        #[prost(message, tag = "6")]
660        StringsValue(super::Strings),
661    }
662}
663#[derive(Clone, PartialEq, ::prost::Message)]
664pub struct CreateProcedureExecutionRequest {
665    #[prost(string, tag = "1")]
666    pub procedure_rid: ::prost::alloc::string::String,
667    #[prost(string, tag = "2")]
668    pub procedure_commit_id: ::prost::alloc::string::String,
669    #[prost(string, tag = "3")]
670    pub title: ::prost::alloc::string::String,
671    #[prost(string, optional, tag = "4")]
672    pub description: ::core::option::Option<::prost::alloc::string::String>,
673}
674#[derive(Clone, PartialEq, ::prost::Message)]
675pub struct CreateProcedureExecutionResponse {
676    #[prost(message, optional, tag = "1")]
677    pub procedure_execution: ::core::option::Option<ProcedureExecution>,
678}
679#[derive(Clone, PartialEq, ::prost::Message)]
680pub struct GetProcedureExecutionRequest {
681    #[prost(string, tag = "1")]
682    pub procedure_execution_rid: ::prost::alloc::string::String,
683    /// If true, the display graph will be included in the response.
684    /// Default is false.
685    #[prost(bool, tag = "2")]
686    pub include_display_graph: bool,
687}
688#[derive(Clone, PartialEq, ::prost::Message)]
689pub struct GetProcedureExecutionResponse {
690    #[prost(message, optional, tag = "1")]
691    pub procedure_execution: ::core::option::Option<ProcedureExecution>,
692    /// Included if include_display_graph was set to true. Note that this is the
693    /// procedure template's display graph, not the execution graph.
694    #[prost(message, optional, tag = "2")]
695    pub display_graph: ::core::option::Option<super::super::v1::ProcedureDisplayGraph>,
696}
697#[derive(Clone, PartialEq, ::prost::Message)]
698pub struct UpdateProcedureExecutionMetadataRequest {
699    #[prost(string, tag = "1")]
700    pub procedure_execution_rid: ::prost::alloc::string::String,
701    #[prost(string, optional, tag = "2")]
702    pub title: ::core::option::Option<::prost::alloc::string::String>,
703    #[prost(string, optional, tag = "3")]
704    pub description: ::core::option::Option<::prost::alloc::string::String>,
705    #[prost(string, optional, tag = "4")]
706    pub commit_id: ::core::option::Option<::prost::alloc::string::String>,
707    #[prost(message, optional, tag = "5")]
708    pub labels: ::core::option::Option<super::super::super::types::LabelUpdateWrapper>,
709    #[prost(message, optional, tag = "6")]
710    pub properties: ::core::option::Option<
711        super::super::super::types::PropertyUpdateWrapper,
712    >,
713}
714#[derive(Clone, PartialEq, ::prost::Message)]
715pub struct UpdateProcedureExecutionMetadataResponse {
716    #[prost(message, optional, tag = "1")]
717    pub metadata: ::core::option::Option<ProcedureExecutionMetadata>,
718}
719/// TODO(niwong to pchen): I made an "update metadata" endpoint separately above,
720/// I think it'd be nice to turn this into a dedicated endpoint for changing the state of
721/// the overall execution (start, succeed, abort, fail)
722/// I also think in general we shouldn't be updating the entire ProcedureExecutionState
723/// but rather leveraging updateStep.
724#[derive(Clone, PartialEq, ::prost::Message)]
725pub struct UpdateProcedureExecutionRequest {
726    #[prost(string, tag = "1")]
727    pub procedure_execution_rid: ::prost::alloc::string::String,
728    #[prost(string, optional, tag = "2")]
729    pub title: ::core::option::Option<::prost::alloc::string::String>,
730    #[prost(string, optional, tag = "3")]
731    pub description: ::core::option::Option<::prost::alloc::string::String>,
732    #[prost(string, optional, tag = "4")]
733    pub commit_id: ::core::option::Option<::prost::alloc::string::String>,
734    #[prost(message, optional, tag = "5")]
735    pub labels: ::core::option::Option<super::super::super::types::LabelUpdateWrapper>,
736    #[prost(message, optional, tag = "6")]
737    pub properties: ::core::option::Option<
738        super::super::super::types::PropertyUpdateWrapper,
739    >,
740    #[prost(message, optional, tag = "7")]
741    pub state: ::core::option::Option<ProcedureExecutionState>,
742    #[prost(bool, optional, tag = "8")]
743    pub is_aborted: ::core::option::Option<bool>,
744    #[prost(message, optional, tag = "9")]
745    pub started_at: ::core::option::Option<
746        super::super::super::super::google::protobuf::Timestamp,
747    >,
748    #[prost(message, optional, tag = "10")]
749    pub finished_at: ::core::option::Option<
750        super::super::super::super::google::protobuf::Timestamp,
751    >,
752}
753#[derive(Clone, PartialEq, ::prost::Message)]
754pub struct UpdateProcedureExecutionResponse {
755    #[prost(message, optional, tag = "1")]
756    pub procedure_execution: ::core::option::Option<ProcedureExecution>,
757}
758#[derive(Clone, PartialEq, ::prost::Message)]
759pub struct UpdateStepRequest {
760    #[prost(string, tag = "1")]
761    pub procedure_execution_rid: ::prost::alloc::string::String,
762    /// The unique identifier of the execution step to update.
763    #[prost(string, tag = "2")]
764    pub step_id: ::prost::alloc::string::String,
765    /// Setting the value of the step's content. This is only allowed if the step is NOT_STARTED
766    /// or IN_PROGRESS.
767    #[prost(message, optional, tag = "3")]
768    pub value: ::core::option::Option<StepContentValue>,
769    /// Set whether the step has auto-proceed enabled. This is only allowed if the step is NOT_STARTED.
770    /// or IN_PROGRESS.
771    #[prost(message, optional, tag = "4")]
772    pub auto_proceed_config: ::core::option::Option<super::super::v1::AutoProceedConfig>,
773    /// Setting the state of the step. This will occur after the other updates in this request.
774    #[prost(message, optional, tag = "5")]
775    pub target_state: ::core::option::Option<TargetStepStateRequest>,
776}
777#[derive(Clone, PartialEq, ::prost::Message)]
778pub struct UpdateStepResponse {
779    #[prost(message, optional, tag = "1")]
780    pub procedure_execution: ::core::option::Option<ProcedureExecution>,
781}
782#[derive(Clone, PartialEq, ::prost::Message)]
783pub struct UpdateStepSuccessConditionStatusRequest {
784    #[prost(string, tag = "1")]
785    pub procedure_execution_rid: ::prost::alloc::string::String,
786    /// The unique identifier of the execution step to update.
787    #[prost(string, tag = "2")]
788    pub step_id: ::prost::alloc::string::String,
789    /// Setting the success_condition_status is only allowed if the step is SUBMITTED
790    /// and should only be done by the backend while monitoring the condition.
791    /// If the step is SKIPPED, the success_condition_status will still be set but
792    /// no completion actions will be run and the step's state will not be updated.
793    #[prost(message, optional, tag = "3")]
794    pub success_condition_status: ::core::option::Option<SuccessConditionStatus>,
795}
796#[derive(Clone, PartialEq, ::prost::Message)]
797pub struct UpdateStepSuccessConditionStatusResponse {
798    #[prost(message, optional, tag = "1")]
799    pub procedure_execution: ::core::option::Option<ProcedureExecution>,
800}
801#[derive(Clone, PartialEq, ::prost::Message)]
802pub struct ProcedureExecutionSearchQuery {
803    #[prost(
804        oneof = "procedure_execution_search_query::Query",
805        tags = "1, 2, 3, 4, 5, 6, 7, 8, 9"
806    )]
807    pub query: ::core::option::Option<procedure_execution_search_query::Query>,
808}
809/// Nested message and enum types in `ProcedureExecutionSearchQuery`.
810pub mod procedure_execution_search_query {
811    #[derive(Clone, PartialEq, ::prost::Message)]
812    pub struct ProcedureExecutionSearchAndQuery {
813        #[prost(message, repeated, tag = "1")]
814        pub queries: ::prost::alloc::vec::Vec<super::ProcedureExecutionSearchQuery>,
815    }
816    #[derive(Clone, PartialEq, ::prost::Message)]
817    pub struct ProcedureExecutionSearchOrQuery {
818        #[prost(message, repeated, tag = "1")]
819        pub queries: ::prost::alloc::vec::Vec<super::ProcedureExecutionSearchQuery>,
820    }
821    #[derive(Clone, PartialEq, ::prost::Oneof)]
822    pub enum Query {
823        #[prost(string, tag = "1")]
824        SearchText(::prost::alloc::string::String),
825        #[prost(string, tag = "2")]
826        Label(::prost::alloc::string::String),
827        #[prost(message, tag = "3")]
828        Property(super::super::super::super::types::Property),
829        #[prost(message, tag = "4")]
830        And(ProcedureExecutionSearchAndQuery),
831        #[prost(message, tag = "5")]
832        Or(ProcedureExecutionSearchOrQuery),
833        #[prost(string, tag = "6")]
834        Workspace(::prost::alloc::string::String),
835        #[prost(string, tag = "7")]
836        ProcedureRid(::prost::alloc::string::String),
837        #[prost(string, tag = "8")]
838        CommitId(::prost::alloc::string::String),
839        #[prost(string, tag = "9")]
840        CreatedBy(::prost::alloc::string::String),
841    }
842}
843#[derive(Clone, Copy, PartialEq, ::prost::Message)]
844pub struct ProcedureExecutionSortOptions {
845    #[prost(bool, tag = "1")]
846    pub is_descending: bool,
847    #[prost(enumeration = "SearchProcedureExecutionsSortField", tag = "2")]
848    pub sort_field: i32,
849}
850#[derive(Clone, PartialEq, ::prost::Message)]
851pub struct SearchProcedureExecutionsRequest {
852    #[prost(message, optional, tag = "1")]
853    pub query: ::core::option::Option<ProcedureExecutionSearchQuery>,
854    #[prost(message, optional, tag = "2")]
855    pub sort_options: ::core::option::Option<ProcedureExecutionSortOptions>,
856    /// Page sizes greater than 1_000 will be rejected. Default pageSize is 100.
857    #[prost(int32, optional, tag = "3")]
858    pub page_size: ::core::option::Option<i32>,
859    #[prost(string, optional, tag = "4")]
860    pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
861}
862#[derive(Clone, PartialEq, ::prost::Message)]
863pub struct SearchProcedureExecutionsResponse {
864    #[prost(message, repeated, tag = "1")]
865    pub procedure_executions: ::prost::alloc::vec::Vec<ProcedureExecutionMetadata>,
866    #[prost(string, optional, tag = "2")]
867    pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
868}
869#[derive(Clone, PartialEq, ::prost::Message)]
870pub struct BatchGetProcedureExecutionMetadataRequest {
871    #[prost(string, repeated, tag = "1")]
872    pub procedure_execution_rids: ::prost::alloc::vec::Vec<
873        ::prost::alloc::string::String,
874    >,
875}
876#[derive(Clone, PartialEq, ::prost::Message)]
877pub struct BatchGetProcedureExecutionMetadataResponse {
878    #[prost(message, repeated, tag = "1")]
879    pub procedure_executions: ::prost::alloc::vec::Vec<ProcedureExecutionMetadata>,
880}
881#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
882#[repr(i32)]
883pub enum SearchProcedureExecutionsSortField {
884    Unspecified = 0,
885    CreatedAt = 1,
886    StartedAt = 2,
887    FinishedAt = 3,
888    UpdatedAt = 4,
889}
890impl SearchProcedureExecutionsSortField {
891    /// String value of the enum field names used in the ProtoBuf definition.
892    ///
893    /// The values are not transformed in any way and thus are considered stable
894    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
895    pub fn as_str_name(&self) -> &'static str {
896        match self {
897            Self::Unspecified => "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_UNSPECIFIED",
898            Self::CreatedAt => "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_CREATED_AT",
899            Self::StartedAt => "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_STARTED_AT",
900            Self::FinishedAt => "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_FINISHED_AT",
901            Self::UpdatedAt => "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_UPDATED_AT",
902        }
903    }
904    /// Creates an enum from field names used in the ProtoBuf definition.
905    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
906        match value {
907            "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_UNSPECIFIED" => {
908                Some(Self::Unspecified)
909            }
910            "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_CREATED_AT" => Some(Self::CreatedAt),
911            "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_STARTED_AT" => Some(Self::StartedAt),
912            "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_FINISHED_AT" => {
913                Some(Self::FinishedAt)
914            }
915            "SEARCH_PROCEDURE_EXECUTIONS_SORT_FIELD_UPDATED_AT" => Some(Self::UpdatedAt),
916            _ => None,
917        }
918    }
919}
920#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
921#[repr(i32)]
922pub enum ProcedureExecutionsServiceError {
923    Unspecified = 0,
924    NotFound = 1,
925    ProcNotFound = 2,
926    NodeNotFound = 3,
927    InvalidNode = 4,
928    InvalidGraph = 5,
929    InvalidStepTransition = 6,
930    InvalidSearchToken = 7,
931    InvalidStepUpdate = 8,
932}
933impl ProcedureExecutionsServiceError {
934    /// String value of the enum field names used in the ProtoBuf definition.
935    ///
936    /// The values are not transformed in any way and thus are considered stable
937    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
938    pub fn as_str_name(&self) -> &'static str {
939        match self {
940            Self::Unspecified => "PROCEDURE_EXECUTIONS_SERVICE_ERROR_UNSPECIFIED",
941            Self::NotFound => "PROCEDURE_EXECUTIONS_SERVICE_ERROR_NOT_FOUND",
942            Self::ProcNotFound => "PROCEDURE_EXECUTIONS_SERVICE_ERROR_PROC_NOT_FOUND",
943            Self::NodeNotFound => "PROCEDURE_EXECUTIONS_SERVICE_ERROR_NODE_NOT_FOUND",
944            Self::InvalidNode => "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_NODE",
945            Self::InvalidGraph => "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_GRAPH",
946            Self::InvalidStepTransition => {
947                "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_STEP_TRANSITION"
948            }
949            Self::InvalidSearchToken => {
950                "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_SEARCH_TOKEN"
951            }
952            Self::InvalidStepUpdate => {
953                "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_STEP_UPDATE"
954            }
955        }
956    }
957    /// Creates an enum from field names used in the ProtoBuf definition.
958    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
959        match value {
960            "PROCEDURE_EXECUTIONS_SERVICE_ERROR_UNSPECIFIED" => Some(Self::Unspecified),
961            "PROCEDURE_EXECUTIONS_SERVICE_ERROR_NOT_FOUND" => Some(Self::NotFound),
962            "PROCEDURE_EXECUTIONS_SERVICE_ERROR_PROC_NOT_FOUND" => {
963                Some(Self::ProcNotFound)
964            }
965            "PROCEDURE_EXECUTIONS_SERVICE_ERROR_NODE_NOT_FOUND" => {
966                Some(Self::NodeNotFound)
967            }
968            "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_NODE" => Some(Self::InvalidNode),
969            "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_GRAPH" => {
970                Some(Self::InvalidGraph)
971            }
972            "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_STEP_TRANSITION" => {
973                Some(Self::InvalidStepTransition)
974            }
975            "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_SEARCH_TOKEN" => {
976                Some(Self::InvalidSearchToken)
977            }
978            "PROCEDURE_EXECUTIONS_SERVICE_ERROR_INVALID_STEP_UPDATE" => {
979                Some(Self::InvalidStepUpdate)
980            }
981            _ => None,
982        }
983    }
984}
985/// Generated client implementations.
986pub mod procedure_executions_service_client {
987    #![allow(
988        unused_variables,
989        dead_code,
990        missing_docs,
991        clippy::wildcard_imports,
992        clippy::let_unit_value,
993    )]
994    use tonic::codegen::*;
995    use tonic::codegen::http::Uri;
996    /// Service for creating and managing procedure executions.
997    #[derive(Debug, Clone)]
998    pub struct ProcedureExecutionsServiceClient<T> {
999        inner: tonic::client::Grpc<T>,
1000    }
1001    impl ProcedureExecutionsServiceClient<tonic::transport::Channel> {
1002        /// Attempt to create a new client by connecting to a given endpoint.
1003        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1004        where
1005            D: TryInto<tonic::transport::Endpoint>,
1006            D::Error: Into<StdError>,
1007        {
1008            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1009            Ok(Self::new(conn))
1010        }
1011    }
1012    impl<T> ProcedureExecutionsServiceClient<T>
1013    where
1014        T: tonic::client::GrpcService<tonic::body::Body>,
1015        T::Error: Into<StdError>,
1016        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1017        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1018    {
1019        pub fn new(inner: T) -> Self {
1020            let inner = tonic::client::Grpc::new(inner);
1021            Self { inner }
1022        }
1023        pub fn with_origin(inner: T, origin: Uri) -> Self {
1024            let inner = tonic::client::Grpc::with_origin(inner, origin);
1025            Self { inner }
1026        }
1027        pub fn with_interceptor<F>(
1028            inner: T,
1029            interceptor: F,
1030        ) -> ProcedureExecutionsServiceClient<InterceptedService<T, F>>
1031        where
1032            F: tonic::service::Interceptor,
1033            T::ResponseBody: Default,
1034            T: tonic::codegen::Service<
1035                http::Request<tonic::body::Body>,
1036                Response = http::Response<
1037                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
1038                >,
1039            >,
1040            <T as tonic::codegen::Service<
1041                http::Request<tonic::body::Body>,
1042            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1043        {
1044            ProcedureExecutionsServiceClient::new(
1045                InterceptedService::new(inner, interceptor),
1046            )
1047        }
1048        /// Compress requests with the given encoding.
1049        ///
1050        /// This requires the server to support it otherwise it might respond with an
1051        /// error.
1052        #[must_use]
1053        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1054            self.inner = self.inner.send_compressed(encoding);
1055            self
1056        }
1057        /// Enable decompressing responses.
1058        #[must_use]
1059        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1060            self.inner = self.inner.accept_compressed(encoding);
1061            self
1062        }
1063        /// Limits the maximum size of a decoded message.
1064        ///
1065        /// Default: `4MB`
1066        #[must_use]
1067        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1068            self.inner = self.inner.max_decoding_message_size(limit);
1069            self
1070        }
1071        /// Limits the maximum size of an encoded message.
1072        ///
1073        /// Default: `usize::MAX`
1074        #[must_use]
1075        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1076            self.inner = self.inner.max_encoding_message_size(limit);
1077            self
1078        }
1079        /// Create a new procedure execution from a procedure
1080        pub async fn create_procedure_execution(
1081            &mut self,
1082            request: impl tonic::IntoRequest<super::CreateProcedureExecutionRequest>,
1083        ) -> std::result::Result<
1084            tonic::Response<super::CreateProcedureExecutionResponse>,
1085            tonic::Status,
1086        > {
1087            self.inner
1088                .ready()
1089                .await
1090                .map_err(|e| {
1091                    tonic::Status::unknown(
1092                        format!("Service was not ready: {}", e.into()),
1093                    )
1094                })?;
1095            let codec = tonic::codec::ProstCodec::default();
1096            let path = http::uri::PathAndQuery::from_static(
1097                "/nominal.procedures.executions.v1.ProcedureExecutionsService/CreateProcedureExecution",
1098            );
1099            let mut req = request.into_request();
1100            req.extensions_mut()
1101                .insert(
1102                    GrpcMethod::new(
1103                        "nominal.procedures.executions.v1.ProcedureExecutionsService",
1104                        "CreateProcedureExecution",
1105                    ),
1106                );
1107            self.inner.unary(req, path, codec).await
1108        }
1109        /// Get a procedure execution by its RID
1110        pub async fn get_procedure_execution(
1111            &mut self,
1112            request: impl tonic::IntoRequest<super::GetProcedureExecutionRequest>,
1113        ) -> std::result::Result<
1114            tonic::Response<super::GetProcedureExecutionResponse>,
1115            tonic::Status,
1116        > {
1117            self.inner
1118                .ready()
1119                .await
1120                .map_err(|e| {
1121                    tonic::Status::unknown(
1122                        format!("Service was not ready: {}", e.into()),
1123                    )
1124                })?;
1125            let codec = tonic::codec::ProstCodec::default();
1126            let path = http::uri::PathAndQuery::from_static(
1127                "/nominal.procedures.executions.v1.ProcedureExecutionsService/GetProcedureExecution",
1128            );
1129            let mut req = request.into_request();
1130            req.extensions_mut()
1131                .insert(
1132                    GrpcMethod::new(
1133                        "nominal.procedures.executions.v1.ProcedureExecutionsService",
1134                        "GetProcedureExecution",
1135                    ),
1136                );
1137            self.inner.unary(req, path, codec).await
1138        }
1139        /// Update the metadata of a procedure execution
1140        pub async fn update_procedure_execution_metadata(
1141            &mut self,
1142            request: impl tonic::IntoRequest<
1143                super::UpdateProcedureExecutionMetadataRequest,
1144            >,
1145        ) -> std::result::Result<
1146            tonic::Response<super::UpdateProcedureExecutionMetadataResponse>,
1147            tonic::Status,
1148        > {
1149            self.inner
1150                .ready()
1151                .await
1152                .map_err(|e| {
1153                    tonic::Status::unknown(
1154                        format!("Service was not ready: {}", e.into()),
1155                    )
1156                })?;
1157            let codec = tonic::codec::ProstCodec::default();
1158            let path = http::uri::PathAndQuery::from_static(
1159                "/nominal.procedures.executions.v1.ProcedureExecutionsService/UpdateProcedureExecutionMetadata",
1160            );
1161            let mut req = request.into_request();
1162            req.extensions_mut()
1163                .insert(
1164                    GrpcMethod::new(
1165                        "nominal.procedures.executions.v1.ProcedureExecutionsService",
1166                        "UpdateProcedureExecutionMetadata",
1167                    ),
1168                );
1169            self.inner.unary(req, path, codec).await
1170        }
1171        /// Heavy-handed update method for procedure execution
1172        /// TODO(pchen): This isn't the expected final endpoint, this is just for editing the graph while we iterate
1173        /// There likely be additional fine-grained methods for editing the procedure
1174        pub async fn update_procedure_execution(
1175            &mut self,
1176            request: impl tonic::IntoRequest<super::UpdateProcedureExecutionRequest>,
1177        ) -> std::result::Result<
1178            tonic::Response<super::UpdateProcedureExecutionResponse>,
1179            tonic::Status,
1180        > {
1181            self.inner
1182                .ready()
1183                .await
1184                .map_err(|e| {
1185                    tonic::Status::unknown(
1186                        format!("Service was not ready: {}", e.into()),
1187                    )
1188                })?;
1189            let codec = tonic::codec::ProstCodec::default();
1190            let path = http::uri::PathAndQuery::from_static(
1191                "/nominal.procedures.executions.v1.ProcedureExecutionsService/UpdateProcedureExecution",
1192            );
1193            let mut req = request.into_request();
1194            req.extensions_mut()
1195                .insert(
1196                    GrpcMethod::new(
1197                        "nominal.procedures.executions.v1.ProcedureExecutionsService",
1198                        "UpdateProcedureExecution",
1199                    ),
1200                );
1201            self.inner.unary(req, path, codec).await
1202        }
1203        /// Update the status of a step in a procedure execution. This can only be done if the step is NOT_STARTED,
1204        /// IN_PROGRESS, or SUBMITTED. Other state transitions are managed by the backend.
1205        pub async fn update_step(
1206            &mut self,
1207            request: impl tonic::IntoRequest<super::UpdateStepRequest>,
1208        ) -> std::result::Result<
1209            tonic::Response<super::UpdateStepResponse>,
1210            tonic::Status,
1211        > {
1212            self.inner
1213                .ready()
1214                .await
1215                .map_err(|e| {
1216                    tonic::Status::unknown(
1217                        format!("Service was not ready: {}", e.into()),
1218                    )
1219                })?;
1220            let codec = tonic::codec::ProstCodec::default();
1221            let path = http::uri::PathAndQuery::from_static(
1222                "/nominal.procedures.executions.v1.ProcedureExecutionsService/UpdateStep",
1223            );
1224            let mut req = request.into_request();
1225            req.extensions_mut()
1226                .insert(
1227                    GrpcMethod::new(
1228                        "nominal.procedures.executions.v1.ProcedureExecutionsService",
1229                        "UpdateStep",
1230                    ),
1231                );
1232            self.inner.unary(req, path, codec).await
1233        }
1234        /// This should only be called by the backend to update the success_condition_status of a step.
1235        /// This can only be done if the step is SUBMITTED.
1236        pub async fn update_step_success_condition_status(
1237            &mut self,
1238            request: impl tonic::IntoRequest<
1239                super::UpdateStepSuccessConditionStatusRequest,
1240            >,
1241        ) -> std::result::Result<
1242            tonic::Response<super::UpdateStepSuccessConditionStatusResponse>,
1243            tonic::Status,
1244        > {
1245            self.inner
1246                .ready()
1247                .await
1248                .map_err(|e| {
1249                    tonic::Status::unknown(
1250                        format!("Service was not ready: {}", e.into()),
1251                    )
1252                })?;
1253            let codec = tonic::codec::ProstCodec::default();
1254            let path = http::uri::PathAndQuery::from_static(
1255                "/nominal.procedures.executions.v1.ProcedureExecutionsService/UpdateStepSuccessConditionStatus",
1256            );
1257            let mut req = request.into_request();
1258            req.extensions_mut()
1259                .insert(
1260                    GrpcMethod::new(
1261                        "nominal.procedures.executions.v1.ProcedureExecutionsService",
1262                        "UpdateStepSuccessConditionStatus",
1263                    ),
1264                );
1265            self.inner.unary(req, path, codec).await
1266        }
1267        /// Search for procedure executions
1268        pub async fn search_procedure_executions(
1269            &mut self,
1270            request: impl tonic::IntoRequest<super::SearchProcedureExecutionsRequest>,
1271        ) -> std::result::Result<
1272            tonic::Response<super::SearchProcedureExecutionsResponse>,
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/SearchProcedureExecutions",
1286            );
1287            let mut req = request.into_request();
1288            req.extensions_mut()
1289                .insert(
1290                    GrpcMethod::new(
1291                        "nominal.procedures.executions.v1.ProcedureExecutionsService",
1292                        "SearchProcedureExecutions",
1293                    ),
1294                );
1295            self.inner.unary(req, path, codec).await
1296        }
1297        /// Batch get procedure execution metadata
1298        pub async fn batch_get_procedure_execution_metadata(
1299            &mut self,
1300            request: impl tonic::IntoRequest<
1301                super::BatchGetProcedureExecutionMetadataRequest,
1302            >,
1303        ) -> std::result::Result<
1304            tonic::Response<super::BatchGetProcedureExecutionMetadataResponse>,
1305            tonic::Status,
1306        > {
1307            self.inner
1308                .ready()
1309                .await
1310                .map_err(|e| {
1311                    tonic::Status::unknown(
1312                        format!("Service was not ready: {}", e.into()),
1313                    )
1314                })?;
1315            let codec = tonic::codec::ProstCodec::default();
1316            let path = http::uri::PathAndQuery::from_static(
1317                "/nominal.procedures.executions.v1.ProcedureExecutionsService/BatchGetProcedureExecutionMetadata",
1318            );
1319            let mut req = request.into_request();
1320            req.extensions_mut()
1321                .insert(
1322                    GrpcMethod::new(
1323                        "nominal.procedures.executions.v1.ProcedureExecutionsService",
1324                        "BatchGetProcedureExecutionMetadata",
1325                    ),
1326                );
1327            self.inner.unary(req, path, codec).await
1328        }
1329    }
1330}