nominal_api/proto/
nominal.procedures.v1.rs

1// This file is @generated by prost-build.
2/// ProcedureState is the versioned state of a procedure template.
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct ProcedureState {
5    /// Global fields are set at the beginning of the procedure execution.
6    /// These fields can be referenced by any step in the procedure by using {field_id}.
7    #[prost(map = "string, message", tag = "1")]
8    pub global_fields: ::std::collections::HashMap<
9        ::prost::alloc::string::String,
10        FormField,
11    >,
12    /// A map from node ID to the node.
13    #[prost(map = "string, message", tag = "2")]
14    pub nodes: ::std::collections::HashMap<
15        ::prost::alloc::string::String,
16        ProcedureNode,
17    >,
18    /// Section edges represent the visual grouping of sections and steps.
19    /// All keys are IDs for section nodes, and all values are lists of IDs for section or step nodes.
20    /// { A, \[B, C\] } means that section A visually groups nodes B and C together.
21    #[prost(map = "string, message", tag = "3")]
22    pub section_edges: ::std::collections::HashMap<
23        ::prost::alloc::string::String,
24        NodeList,
25    >,
26    /// Step edges represent the dependencies between steps.
27    /// All keys and values are IDs for step nodes.
28    /// { A, \[B, C\] } means that steps B and C depend on step A to complete to be started
29    #[prost(map = "string, message", tag = "4")]
30    pub step_edges: ::std::collections::HashMap<
31        ::prost::alloc::string::String,
32        NodeList,
33    >,
34}
35/// A simpler representation of the procedure graph that is used for display in a UI.
36#[derive(Clone, PartialEq, ::prost::Message)]
37pub struct ProcedureDisplayGraph {
38    /// Sections or steps that do not belong to any parent sections.
39    /// This is ordered in a topological ordering of steps.
40    #[prost(string, repeated, tag = "1")]
41    pub top_level_nodes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
42    /// Map of section node IDs to their topologically sorted children
43    #[prost(map = "string, message", tag = "2")]
44    pub section_to_sorted_children: ::std::collections::HashMap<
45        ::prost::alloc::string::String,
46        NodeList,
47    >,
48}
49/// A simplified version of procedure state that is currently used for procedure authoring.
50/// In this form, the graph is a completely linear structure where each step depends solely
51/// on the preceding step.
52#[derive(Clone, PartialEq, ::prost::Message)]
53pub struct NestedProcedure {
54    /// Title of the procedure
55    #[prost(string, tag = "1")]
56    pub title: ::prost::alloc::string::String,
57    /// Optional long-form description for the procedure
58    #[prost(string, optional, tag = "2")]
59    pub description: ::core::option::Option<::prost::alloc::string::String>,
60    /// Steps in the procedure
61    #[prost(message, repeated, tag = "3")]
62    pub steps: ::prost::alloc::vec::Vec<NestedProcedureNode>,
63    /// Global fields are set at the beginning of the procedure execution.
64    /// These fields can be referenced by any step in the procedure by using {field_id}.
65    #[prost(map = "string, message", tag = "4")]
66    pub global_fields: ::std::collections::HashMap<
67        ::prost::alloc::string::String,
68        FormField,
69    >,
70}
71/// A list of node IDs.
72#[derive(Clone, PartialEq, ::prost::Message)]
73pub struct NodeList {
74    #[prost(string, repeated, tag = "1")]
75    pub node_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
76}
77/// A procedure node is either a section or a step.
78#[derive(Clone, PartialEq, ::prost::Message)]
79pub struct ProcedureNode {
80    #[prost(oneof = "procedure_node::Node", tags = "1, 2")]
81    pub node: ::core::option::Option<procedure_node::Node>,
82}
83/// Nested message and enum types in `ProcedureNode`.
84pub mod procedure_node {
85    #[derive(Clone, PartialEq, ::prost::Oneof)]
86    pub enum Node {
87        /// A section node provides a visual grouping of other sections and steps.
88        #[prost(message, tag = "1")]
89        Section(super::ProcedureSectionNode),
90        /// A step node represents a step in the procedure.
91        /// It serves as a "template" for the ExecutionStep that will be created during procedure execution.
92        #[prost(message, tag = "2")]
93        Step(super::ProcedureStepNode),
94    }
95}
96/// A procedure section node visually groups other sections and steps.
97#[derive(Clone, PartialEq, ::prost::Message)]
98pub struct ProcedureSectionNode {
99    /// Unique identifier for this node in the procedure graph.
100    #[prost(string, tag = "1")]
101    pub id: ::prost::alloc::string::String,
102    /// Title of this section
103    #[prost(string, tag = "2")]
104    pub title: ::prost::alloc::string::String,
105    /// Optional long-form description for this section
106    #[prost(string, optional, tag = "3")]
107    pub description: ::core::option::Option<::prost::alloc::string::String>,
108}
109/// A procedure step node represents a step in the procedure.
110#[derive(Clone, PartialEq, ::prost::Message)]
111pub struct ProcedureStepNode {
112    /// Unique identifier for this node in the procedure graph.
113    #[prost(string, tag = "1")]
114    pub id: ::prost::alloc::string::String,
115    /// Title of this step
116    #[prost(string, tag = "2")]
117    pub title: ::prost::alloc::string::String,
118    /// The content of this step.
119    #[prost(message, optional, tag = "3")]
120    pub content: ::core::option::Option<ProcedureStepContent>,
121    /// If set, other steps can reference this step's outputs using "{output_id}.{field_id}".
122    /// Output_id must be globally unique across all steps in the procedure.
123    /// During execution, we also enforce that the output_id is unique across all non-outdated steps.
124    #[prost(string, optional, tag = "4")]
125    pub output_id: ::core::option::Option<::prost::alloc::string::String>,
126    /// Optional long-form description for this step
127    #[prost(string, optional, tag = "5")]
128    pub description: ::core::option::Option<::prost::alloc::string::String>,
129    /// is_required defaults to false, meaning that the step may be skipped
130    #[prost(bool, optional, tag = "6")]
131    pub is_required: ::core::option::Option<bool>,
132    /// Configuration for if and how the step should automatically transition from NOT_STARTED to IN_PROGRESS
133    /// By default, this will be `all_parents`.
134    #[prost(message, optional, tag = "7")]
135    pub auto_start: ::core::option::Option<AutoStartConfig>,
136    /// Configuration for if and how the step should automatically submit the step contents when requirements are met.
137    /// By default, this will be `disabled`.
138    #[prost(message, optional, tag = "8")]
139    pub initial_auto_proceed_config: ::core::option::Option<AutoProceedConfig>,
140    /// Configuration for whether the step will require a condition to be met for the step to be completed
141    /// By default, this is not set, meaning that the step will not wait on any conditions before completing.
142    #[prost(message, optional, tag = "9")]
143    pub success_condition: ::core::option::Option<SuccessCondition>,
144    /// Configuration for the actions to take when the step transitions to a completed state (SUCCEEDED, ERRORED, SKIPPED)
145    /// By default, there are no actions.
146    #[prost(message, repeated, tag = "10")]
147    pub completion_action_configs: ::prost::alloc::vec::Vec<CompletionActionConfig>,
148}
149/// A section or a step in a NestedProcedure.
150#[derive(Clone, PartialEq, ::prost::Message)]
151pub struct NestedProcedureNode {
152    /// TODO(pchen): used for nested procedure parsing
153    #[prost(string, optional, tag = "5")]
154    pub id: ::core::option::Option<::prost::alloc::string::String>,
155    /// Title of this section or step.
156    #[prost(string, tag = "1")]
157    pub title: ::prost::alloc::string::String,
158    /// Optional long-form description for this section or step.
159    #[prost(string, optional, tag = "2")]
160    pub description: ::core::option::Option<::prost::alloc::string::String>,
161    /// If this node is a section, then it can contain other sections and steps.
162    #[prost(message, repeated, tag = "3")]
163    pub steps: ::prost::alloc::vec::Vec<NestedProcedureNode>,
164    /// If this node is a step, then this field contains the step definition.
165    #[prost(message, optional, tag = "4")]
166    pub step: ::core::option::Option<nested_procedure_node::NestedStepNode>,
167}
168/// Nested message and enum types in `NestedProcedureNode`.
169pub mod nested_procedure_node {
170    /// These fields' docs are identical to those of ProcedureStepNode.
171    #[derive(Clone, PartialEq, ::prost::Message)]
172    pub struct NestedStepNode {
173        #[prost(string, optional, tag = "1")]
174        pub output_id: ::core::option::Option<::prost::alloc::string::String>,
175        #[prost(bool, optional, tag = "2")]
176        pub is_required: ::core::option::Option<bool>,
177        #[prost(message, optional, tag = "3")]
178        pub auto_start: ::core::option::Option<super::AutoStartConfig>,
179        #[prost(message, optional, tag = "4")]
180        pub initial_auto_proceed_config: ::core::option::Option<
181            super::AutoProceedConfig,
182        >,
183        #[prost(message, optional, tag = "5")]
184        pub success_condition: ::core::option::Option<super::SuccessCondition>,
185        #[prost(message, repeated, tag = "6")]
186        pub completion_action_configs: ::prost::alloc::vec::Vec<
187            super::CompletionActionConfig,
188        >,
189        #[prost(oneof = "nested_step_node::Content", tags = "7, 8")]
190        pub content: ::core::option::Option<nested_step_node::Content>,
191    }
192    /// Nested message and enum types in `NestedStepNode`.
193    pub mod nested_step_node {
194        #[derive(Clone, PartialEq, ::prost::Oneof)]
195        pub enum Content {
196            #[prost(message, tag = "7")]
197            Form(super::super::FormStep),
198            #[prost(message, tag = "8")]
199            StartIngest(super::super::StartIngestStep),
200        }
201    }
202}
203/// AutoStartConfig is a configuration that determines whether a step should be
204/// automatically moved from NOT_STARTED to IN_PROGRESS when some set of criteria are met.
205/// By default this will be `all_parents`
206#[derive(Clone, Copy, PartialEq, ::prost::Message)]
207pub struct AutoStartConfig {
208    #[prost(oneof = "auto_start_config::Config", tags = "1, 2")]
209    pub config: ::core::option::Option<auto_start_config::Config>,
210}
211/// Nested message and enum types in `AutoStartConfig`.
212pub mod auto_start_config {
213    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
214    pub struct AllParents {}
215    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
216    pub struct Disabled {}
217    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
218    pub enum Config {
219        /// The step will start automatically when all parent steps have passed.
220        #[prost(message, tag = "1")]
221        AllParents(AllParents),
222        /// The step will not start automatically.
223        #[prost(message, tag = "2")]
224        Disabled(Disabled),
225    }
226}
227/// AutoProceedConfig is a configuration that determines whether a step should
228/// automatically proceed (submit the contents and check success_conditions)
229/// when some set of criteria are met. By default this will be `disabled`.
230#[derive(Clone, Copy, PartialEq, ::prost::Message)]
231pub struct AutoProceedConfig {
232    #[prost(oneof = "auto_proceed_config::Config", tags = "1, 2")]
233    pub config: ::core::option::Option<auto_proceed_config::Config>,
234}
235/// Nested message and enum types in `AutoProceedConfig`.
236pub mod auto_proceed_config {
237    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
238    pub struct Disabled {}
239    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
240    pub struct Enabled {}
241    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
242    pub enum Config {
243        /// The step will not be automatically completed
244        #[prost(message, tag = "1")]
245        Disabled(Disabled),
246        /// The step will automatically submit the step contents once the requirements are met and
247        /// begin the transition to either PASSED or ERRORED.
248        #[prost(message, tag = "2")]
249        Enabled(Enabled),
250    }
251}
252/// The condition that must be met for a step to succeed after submitting its contents.
253#[derive(Clone, PartialEq, ::prost::Message)]
254pub struct SuccessCondition {
255    #[prost(oneof = "success_condition::Condition", tags = "1, 2")]
256    pub condition: ::core::option::Option<success_condition::Condition>,
257}
258/// Nested message and enum types in `SuccessCondition`.
259pub mod success_condition {
260    #[derive(Clone, PartialEq, ::prost::Oneof)]
261    pub enum Condition {
262        #[prost(message, tag = "1")]
263        And(super::AndSuccessCondition),
264        /// DataIngestCompletionCondition = 3;
265        /// ChannelValidationCompletionCondition = 4;
266        /// OrCompletionCondition or = 5;
267        #[prost(message, tag = "2")]
268        Timer(super::TimerSuccessCondition),
269    }
270}
271/// All conditions within must be met for the step to be succeeded.
272#[derive(Clone, PartialEq, ::prost::Message)]
273pub struct AndSuccessCondition {
274    #[prost(message, repeated, tag = "1")]
275    pub conditions: ::prost::alloc::vec::Vec<SuccessCondition>,
276}
277/// A timer condition that will succeed the step after a specified duration.
278#[derive(Clone, Copy, PartialEq, ::prost::Message)]
279pub struct TimerSuccessCondition {
280    /// Duration in seconds to wait before succeeding the step. This value must be non-negative.
281    /// This duration is a minimum bound; the actual duration may be longer.
282    #[prost(int32, tag = "1")]
283    pub duration_seconds: i32,
284}
285/// An action that will be taken when a step transitions to a completed state
286/// (succeeded, errored, or skipped). These actions are executed after the step
287/// contents are submitted and the PassCondition (if any) is satisfied. These
288/// actions are executed synchronously with the state transition and generally
289/// should be quick to complete.
290#[derive(Clone, PartialEq, ::prost::Message)]
291pub struct CompletionActionConfig {
292    #[prost(oneof = "completion_action_config::Config", tags = "1")]
293    pub config: ::core::option::Option<completion_action_config::Config>,
294}
295/// Nested message and enum types in `CompletionActionConfig`.
296pub mod completion_action_config {
297    #[derive(Clone, PartialEq, ::prost::Oneof)]
298    pub enum Config {
299        /// SendNotificationConfig send_notification = 2;
300        /// CreateRun create_run = 3;
301        /// ...
302        #[prost(message, tag = "1")]
303        CreateEvent(super::CreateEventConfig),
304    }
305}
306/// An action to create an event when a step is completed.
307#[derive(Clone, PartialEq, ::prost::Message)]
308pub struct CreateEventConfig {
309    #[prost(string, tag = "1")]
310    pub name: ::prost::alloc::string::String,
311    #[prost(string, optional, tag = "2")]
312    pub description: ::core::option::Option<::prost::alloc::string::String>,
313    #[prost(string, repeated, tag = "3")]
314    pub labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
315    #[prost(map = "string, string", tag = "4")]
316    pub properties: ::std::collections::HashMap<
317        ::prost::alloc::string::String,
318        ::prost::alloc::string::String,
319    >,
320    /// TODO(pchen): do we want to change this to use AssetFieldOption?
321    /// Each asset_field_id will be resolved and added as an AssetRid to the created event
322    #[prost(string, repeated, tag = "5")]
323    pub asset_field_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
324}
325/// The content of a procedure step. This typically involves some form of user interaction/input.
326#[derive(Clone, PartialEq, ::prost::Message)]
327pub struct ProcedureStepContent {
328    #[prost(oneof = "procedure_step_content::Content", tags = "1, 2")]
329    pub content: ::core::option::Option<procedure_step_content::Content>,
330}
331/// Nested message and enum types in `ProcedureStepContent`.
332pub mod procedure_step_content {
333    #[derive(Clone, PartialEq, ::prost::Oneof)]
334    pub enum Content {
335        #[prost(message, tag = "1")]
336        Form(super::FormStep),
337        /// ...
338        #[prost(message, tag = "2")]
339        StartIngest(super::StartIngestStep),
340    }
341}
342/// A form step consists of a set of fields to be filled out by the user.
343#[derive(Clone, PartialEq, ::prost::Message)]
344pub struct FormStep {
345    #[prost(message, repeated, tag = "1")]
346    pub fields: ::prost::alloc::vec::Vec<FormField>,
347}
348/// The user will be prompted to start an ingest job in the frontend
349/// and the output of the step will be the rid of the created ingest job.
350#[derive(Clone, PartialEq, ::prost::Message)]
351pub struct StartIngestStep {
352    /// The asset that the ingest job will ingest data into.
353    #[prost(message, optional, tag = "1")]
354    pub asset: ::core::option::Option<AssetReference>,
355    /// The data scope within the asset that the ingest job will ingest data into.
356    #[prost(message, optional, tag = "2")]
357    pub data_scope: ::core::option::Option<start_ingest_step::DataScopeReference>,
358    /// If present, will restrict and pre-configure the type of ingest job that can be started.
359    #[prost(message, optional, tag = "3")]
360    pub ingest_type_config: ::core::option::Option<start_ingest_step::IngestTypeConfig>,
361    /// If present, the ingest job RID for this step will be available in outputs under this field ID.
362    #[prost(string, optional, tag = "4")]
363    pub output_field_id: ::core::option::Option<::prost::alloc::string::String>,
364}
365/// Nested message and enum types in `StartIngestStep`.
366pub mod start_ingest_step {
367    /// A reference to a data scope
368    #[derive(Clone, PartialEq, ::prost::Message)]
369    pub struct DataScopeReference {
370        #[prost(oneof = "data_scope_reference::Option", tags = "1")]
371        pub option: ::core::option::Option<data_scope_reference::Option>,
372    }
373    /// Nested message and enum types in `DataScopeReference`.
374    pub mod data_scope_reference {
375        #[derive(Clone, PartialEq, ::prost::Oneof)]
376        pub enum Option {
377            /// The data scope as a constant string
378            #[prost(string, tag = "1")]
379            Constant(::prost::alloc::string::String),
380        }
381    }
382    #[derive(Clone, PartialEq, ::prost::Message)]
383    pub struct IngestTypeConfig {
384        #[prost(oneof = "ingest_type_config::Config", tags = "1")]
385        pub config: ::core::option::Option<ingest_type_config::Config>,
386    }
387    /// Nested message and enum types in `IngestTypeConfig`.
388    pub mod ingest_type_config {
389        #[derive(Clone, PartialEq, ::prost::Message)]
390        pub struct ContainerizedExtractorIngestConfig {
391            /// If set, the ingest job must use this specific containerized extractor.
392            #[prost(string, optional, tag = "1")]
393            pub rid: ::core::option::Option<::prost::alloc::string::String>,
394        }
395        #[derive(Clone, PartialEq, ::prost::Oneof)]
396        pub enum Config {
397            /// The ingest job must be a containerized extractor ingest.
398            #[prost(message, tag = "1")]
399            ContainerizedExtractor(ContainerizedExtractorIngestConfig),
400        }
401    }
402}
403/// A field to be filled out by the user.
404#[derive(Clone, PartialEq, ::prost::Message)]
405pub struct FormField {
406    /// If id is set, it can be used during the procedure execution by descendant steps.
407    #[prost(string, optional, tag = "1")]
408    pub id: ::core::option::Option<::prost::alloc::string::String>,
409    #[prost(oneof = "form_field::Field", tags = "2, 3, 4, 5, 6, 7, 8")]
410    pub field: ::core::option::Option<form_field::Field>,
411}
412/// Nested message and enum types in `FormField`.
413pub mod form_field {
414    #[derive(Clone, PartialEq, ::prost::Oneof)]
415    pub enum Field {
416        #[prost(message, tag = "2")]
417        Asset(super::AssetField),
418        #[prost(message, tag = "3")]
419        Checkbox(super::CheckboxField),
420        #[prost(message, tag = "4")]
421        Text(super::TextField),
422        #[prost(message, tag = "5")]
423        Int(super::IntField),
424        #[prost(message, tag = "6")]
425        Double(super::DoubleField),
426        #[prost(message, tag = "7")]
427        SingleEnum(super::SingleEnumField),
428        #[prost(message, tag = "8")]
429        MultiEnum(super::MultiEnumField),
430    }
431}
432/// A reference to an asset, either by rid or by a field in the current or previous steps.
433#[derive(Clone, PartialEq, ::prost::Message)]
434pub struct AssetReference {
435    #[prost(oneof = "asset_reference::Option", tags = "1, 2")]
436    pub option: ::core::option::Option<asset_reference::Option>,
437}
438/// Nested message and enum types in `AssetReference`.
439pub mod asset_reference {
440    #[derive(Clone, PartialEq, ::prost::Oneof)]
441    pub enum Option {
442        /// The rid of the asset
443        #[prost(string, tag = "1")]
444        Rid(::prost::alloc::string::String),
445        /// The field id that will contain the selected asset. The execution will fail if the field is not set properly.
446        #[prost(string, tag = "2")]
447        FieldId(::prost::alloc::string::String),
448    }
449}
450/// A limited set of options to choose from, with an optional default option.
451#[derive(Clone, PartialEq, ::prost::Message)]
452pub struct PresetAssetFieldOptions {
453    /// The list of options to choose from.
454    #[prost(message, repeated, tag = "1")]
455    pub options: ::prost::alloc::vec::Vec<AssetReference>,
456    /// If set, this option will be selected by default, if it is present in the options.
457    /// The user can still select a different option.
458    #[prost(message, optional, tag = "2")]
459    pub default_option: ::core::option::Option<AssetReference>,
460}
461/// A field to select a single asset.
462#[derive(Clone, PartialEq, ::prost::Message)]
463pub struct AssetField {
464    /// Helper text to guide selection of the asset
465    #[prost(string, tag = "1")]
466    pub label: ::prost::alloc::string::String,
467    /// Whether this field is required to be set complete the step.
468    #[prost(bool, tag = "2")]
469    pub is_required: bool,
470    /// The asset options for this field.
471    /// This can be omitted, in which case the asset can be chosen freely from all assets.
472    #[prost(oneof = "asset_field::Options", tags = "3")]
473    pub options: ::core::option::Option<asset_field::Options>,
474}
475/// Nested message and enum types in `AssetField`.
476pub mod asset_field {
477    /// The asset options for this field.
478    /// This can be omitted, in which case the asset can be chosen freely from all assets.
479    #[derive(Clone, PartialEq, ::prost::Oneof)]
480    pub enum Options {
481        /// The asset must be chosen from a saved view.
482        /// SavedViewRid saved_view = 5;
483        /// TODO(pchen): do we want to provide single string types from AssetFieldOption to simplify the Nested
484        /// or do we want to explicitly modify the types Nested spec uses?
485        #[prost(message, tag = "3")]
486        PresetOptions(super::PresetAssetFieldOptions),
487    }
488}
489/// A field to capture a boolean value.
490#[derive(Clone, PartialEq, ::prost::Message)]
491pub struct CheckboxField {
492    /// Label to show for this checkbox field
493    #[prost(string, tag = "1")]
494    pub label: ::prost::alloc::string::String,
495    /// If set, the checkbox value must be checked (`true`) to complete the step.
496    #[prost(bool, tag = "2")]
497    pub is_required: bool,
498}
499#[derive(Clone, Copy, PartialEq, ::prost::Message)]
500pub struct TextFieldSimpleInputType {}
501#[derive(Clone, Copy, PartialEq, ::prost::Message)]
502pub struct TextFieldMarkdownInputType {}
503/// A field to capture a string value.
504#[derive(Clone, PartialEq, ::prost::Message)]
505pub struct TextField {
506    /// Label to show for this text field
507    #[prost(string, tag = "1")]
508    pub label: ::prost::alloc::string::String,
509    /// if set, validate that input is at least this many characters
510    /// `is_required` can be achieved by setting `min_length >= 1`
511    #[prost(uint32, optional, tag = "4")]
512    pub min_length: ::core::option::Option<u32>,
513    /// if set, validate that input is at most this many characters
514    #[prost(uint32, optional, tag = "5")]
515    pub max_length: ::core::option::Option<u32>,
516    /// type of form input to render. Defaults to SIMPLE.
517    #[prost(oneof = "text_field::InputType", tags = "2, 3")]
518    pub input_type: ::core::option::Option<text_field::InputType>,
519}
520/// Nested message and enum types in `TextField`.
521pub mod text_field {
522    /// type of form input to render. Defaults to SIMPLE.
523    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
524    pub enum InputType {
525        /// renders a simple html text input field
526        #[prost(message, tag = "2")]
527        Simple(super::TextFieldSimpleInputType),
528        /// renders a Markdown editor for longer inputs with formatting capabilities
529        #[prost(message, tag = "3")]
530        Markdown(super::TextFieldMarkdownInputType),
531    }
532}
533/// A field to capture an int value.
534#[derive(Clone, PartialEq, ::prost::Message)]
535pub struct IntField {
536    /// Label to show for this int field
537    #[prost(string, tag = "1")]
538    pub label: ::prost::alloc::string::String,
539    /// Whether this field is required to be set complete the step.
540    #[prost(bool, tag = "2")]
541    pub is_required: bool,
542    /// if set, validate that input is at least this value
543    #[prost(int64, optional, tag = "3")]
544    pub gte_value: ::core::option::Option<i64>,
545    /// if set, validate that input is at most this value
546    #[prost(int64, optional, tag = "4")]
547    pub lte_value: ::core::option::Option<i64>,
548}
549/// A field to capture a double value.
550#[derive(Clone, PartialEq, ::prost::Message)]
551pub struct DoubleField {
552    /// Label to show for this double field
553    #[prost(string, tag = "1")]
554    pub label: ::prost::alloc::string::String,
555    /// Whether this field is required to be set complete the step.
556    #[prost(bool, tag = "2")]
557    pub is_required: bool,
558    /// if set, a validation on the lower bound of the input value
559    #[prost(oneof = "double_field::LowerBound", tags = "3, 4")]
560    pub lower_bound: ::core::option::Option<double_field::LowerBound>,
561    /// if set, a validation on the upper bound of the input value
562    #[prost(oneof = "double_field::UpperBound", tags = "5, 6")]
563    pub upper_bound: ::core::option::Option<double_field::UpperBound>,
564}
565/// Nested message and enum types in `DoubleField`.
566pub mod double_field {
567    /// if set, a validation on the lower bound of the input value
568    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
569    pub enum LowerBound {
570        /// greater than
571        #[prost(double, tag = "3")]
572        GtValue(f64),
573        /// greater than or equal to
574        #[prost(double, tag = "4")]
575        GteValue(f64),
576    }
577    /// if set, a validation on the upper bound of the input value
578    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
579    pub enum UpperBound {
580        /// less than
581        #[prost(double, tag = "5")]
582        LtValue(f64),
583        /// less than or equal to
584        #[prost(double, tag = "6")]
585        LteValue(f64),
586    }
587}
588#[derive(Clone, Copy, PartialEq, ::prost::Message)]
589pub struct EnumFieldButtonsInputType {}
590#[derive(Clone, Copy, PartialEq, ::prost::Message)]
591pub struct EnumFieldMenuInputType {}
592/// A field to capture one of several options.
593#[derive(Clone, PartialEq, ::prost::Message)]
594pub struct SingleEnumField {
595    /// Label to show for this options field
596    #[prost(string, tag = "1")]
597    pub label: ::prost::alloc::string::String,
598    /// List of predefined options that can be selected by the user
599    #[prost(string, repeated, tag = "2")]
600    pub options: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
601    /// Whether a user can create and specify a new custom option not in the list of options.
602    #[prost(bool, tag = "5")]
603    pub allow_custom: bool,
604    /// Whether a selection is required
605    #[prost(bool, tag = "6")]
606    pub is_required: bool,
607    /// type of form input to render.
608    #[prost(oneof = "single_enum_field::InputType", tags = "3, 4")]
609    pub input_type: ::core::option::Option<single_enum_field::InputType>,
610}
611/// Nested message and enum types in `SingleEnumField`.
612pub mod single_enum_field {
613    /// type of form input to render.
614    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
615    pub enum InputType {
616        /// renders a radio button component
617        #[prost(message, tag = "3")]
618        Buttons(super::EnumFieldButtonsInputType),
619        /// renders a typical drop down menu
620        #[prost(message, tag = "4")]
621        Dropdown(super::EnumFieldMenuInputType),
622    }
623}
624/// A field to capture one or more of several options.
625#[derive(Clone, PartialEq, ::prost::Message)]
626pub struct MultiEnumField {
627    /// Label to show for this options field
628    #[prost(string, tag = "1")]
629    pub label: ::prost::alloc::string::String,
630    /// List of predefined options that can be selected by the user
631    #[prost(string, repeated, tag = "2")]
632    pub options: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
633    /// Whether a user can create and specify a new custom option not in the list of options.
634    #[prost(bool, tag = "6")]
635    pub allow_custom: bool,
636    /// If set, the user must select at least this many options
637    /// `is_required` behavior can be achieved by setting `min_count` = 1
638    #[prost(uint32, optional, tag = "7")]
639    pub min_count: ::core::option::Option<u32>,
640    /// If set, the user can select at most this many options
641    #[prost(uint32, optional, tag = "8")]
642    pub max_count: ::core::option::Option<u32>,
643    /// type of form input to render.
644    #[prost(oneof = "multi_enum_field::InputType", tags = "3, 4")]
645    pub input_type: ::core::option::Option<multi_enum_field::InputType>,
646}
647/// Nested message and enum types in `MultiEnumField`.
648pub mod multi_enum_field {
649    /// type of form input to render.
650    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
651    pub enum InputType {
652        /// renders a collection of checkboxes
653        #[prost(message, tag = "3")]
654        Buttons(super::EnumFieldButtonsInputType),
655        /// renders a typical drop down menu
656        #[prost(message, tag = "4")]
657        Dropdown(super::EnumFieldMenuInputType),
658    }
659}
660/// Metadata about a procedure that is not part of the versioned state.
661#[derive(Clone, PartialEq, ::prost::Message)]
662pub struct ProcedureMetadata {
663    #[prost(string, tag = "1")]
664    pub rid: ::prost::alloc::string::String,
665    #[prost(string, tag = "2")]
666    pub title: ::prost::alloc::string::String,
667    #[prost(string, optional, tag = "3")]
668    pub description: ::core::option::Option<::prost::alloc::string::String>,
669    #[prost(string, repeated, tag = "4")]
670    pub labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
671    #[prost(map = "string, string", tag = "5")]
672    pub properties: ::std::collections::HashMap<
673        ::prost::alloc::string::String,
674        ::prost::alloc::string::String,
675    >,
676    #[prost(bool, tag = "6")]
677    pub is_archived: bool,
678    #[prost(bool, tag = "7")]
679    pub is_published: bool,
680    #[prost(message, optional, tag = "8")]
681    pub created_at: ::core::option::Option<
682        super::super::super::google::protobuf::Timestamp,
683    >,
684    #[prost(string, tag = "9")]
685    pub created_by: ::prost::alloc::string::String,
686    #[prost(message, optional, tag = "10")]
687    pub updated_at: ::core::option::Option<
688        super::super::super::google::protobuf::Timestamp,
689    >,
690    #[prost(string, tag = "11")]
691    pub updated_by: ::prost::alloc::string::String,
692    #[prost(string, tag = "12")]
693    pub workspace: ::prost::alloc::string::String,
694}
695/// A procedure describes a series of steps to be performed, typically in a specific order,
696#[derive(Clone, PartialEq, ::prost::Message)]
697pub struct Procedure {
698    /// The RID of the procedure.
699    #[prost(string, tag = "1")]
700    pub rid: ::prost::alloc::string::String,
701    /// The commit ID of this version of the procedure.
702    #[prost(string, tag = "2")]
703    pub commit: ::prost::alloc::string::String,
704    /// Metadata about the procedure.
705    #[prost(message, optional, tag = "3")]
706    pub metadata: ::core::option::Option<ProcedureMetadata>,
707    /// The versioned state of the procedure.
708    #[prost(message, optional, tag = "4")]
709    pub state: ::core::option::Option<ProcedureState>,
710}
711#[derive(Clone, PartialEq, ::prost::Message)]
712pub struct CreateProcedureRequest {
713    #[prost(string, tag = "1")]
714    pub title: ::prost::alloc::string::String,
715    #[prost(string, optional, tag = "2")]
716    pub description: ::core::option::Option<::prost::alloc::string::String>,
717    #[prost(string, repeated, tag = "3")]
718    pub labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
719    #[prost(map = "string, string", tag = "4")]
720    pub properties: ::std::collections::HashMap<
721        ::prost::alloc::string::String,
722        ::prost::alloc::string::String,
723    >,
724    #[prost(message, optional, tag = "5")]
725    pub state: ::core::option::Option<ProcedureState>,
726    #[prost(bool, optional, tag = "6")]
727    pub is_published: ::core::option::Option<bool>,
728    #[prost(string, tag = "7")]
729    pub workspace: ::prost::alloc::string::String,
730    #[prost(string, tag = "8")]
731    pub commit_message: ::prost::alloc::string::String,
732    #[prost(string, optional, tag = "9")]
733    pub initial_branch_name: ::core::option::Option<::prost::alloc::string::String>,
734}
735#[derive(Clone, PartialEq, ::prost::Message)]
736pub struct CreateProcedureResponse {
737    #[prost(message, optional, tag = "1")]
738    pub procedure: ::core::option::Option<Procedure>,
739    #[prost(string, optional, tag = "2")]
740    pub branch_name: ::core::option::Option<::prost::alloc::string::String>,
741}
742#[derive(Clone, PartialEq, ::prost::Message)]
743pub struct GetProcedureRequest {
744    #[prost(string, tag = "1")]
745    pub rid: ::prost::alloc::string::String,
746    #[prost(message, optional, tag = "2")]
747    pub branch_or_commit: ::core::option::Option<
748        super::super::versioning::v1::BranchOrCommit,
749    >,
750    /// If true, the display graph will be included in the response.
751    /// Default is false.
752    #[prost(bool, tag = "3")]
753    pub include_display_graph: bool,
754}
755#[derive(Clone, PartialEq, ::prost::Message)]
756pub struct GetProcedureResponse {
757    #[prost(message, optional, tag = "1")]
758    pub procedure: ::core::option::Option<Procedure>,
759    /// Included if include_display_graph was set to true
760    #[prost(message, optional, tag = "2")]
761    pub display_graph: ::core::option::Option<ProcedureDisplayGraph>,
762}
763#[derive(Clone, PartialEq, ::prost::Message)]
764pub struct UpdateProcedureMetadataRequest {
765    #[prost(string, tag = "1")]
766    pub rid: ::prost::alloc::string::String,
767    #[prost(string, optional, tag = "2")]
768    pub title: ::core::option::Option<::prost::alloc::string::String>,
769    #[prost(string, optional, tag = "3")]
770    pub description: ::core::option::Option<::prost::alloc::string::String>,
771    #[prost(message, optional, tag = "4")]
772    pub labels: ::core::option::Option<super::super::types::LabelUpdateWrapper>,
773    #[prost(message, optional, tag = "5")]
774    pub properties: ::core::option::Option<super::super::types::PropertyUpdateWrapper>,
775    #[prost(bool, optional, tag = "6")]
776    pub is_archived: ::core::option::Option<bool>,
777    #[prost(bool, optional, tag = "7")]
778    pub is_published: ::core::option::Option<bool>,
779}
780#[derive(Clone, PartialEq, ::prost::Message)]
781pub struct UpdateProcedureMetadataResponse {
782    #[prost(message, optional, tag = "1")]
783    pub procedure_metadata: ::core::option::Option<ProcedureMetadata>,
784}
785#[derive(Clone, PartialEq, ::prost::Message)]
786pub struct ParseNestedProcedureRequest {
787    #[prost(message, optional, tag = "1")]
788    pub nested_procedure: ::core::option::Option<NestedProcedure>,
789    /// If true, the display graph will be included in the response.
790    /// Default is false.
791    #[prost(bool, tag = "3")]
792    pub include_display_graph: bool,
793}
794#[derive(Clone, PartialEq, ::prost::Message)]
795pub struct ParseNestedProcedureResponse {
796    #[prost(message, optional, tag = "1")]
797    pub procedure: ::core::option::Option<Procedure>,
798    /// Included if include_display_graph was set to true
799    #[prost(message, optional, tag = "2")]
800    pub display_graph: ::core::option::Option<ProcedureDisplayGraph>,
801}
802#[derive(Clone, PartialEq, ::prost::Message)]
803pub struct GetProcedureAsNestedRequest {
804    #[prost(string, tag = "1")]
805    pub rid: ::prost::alloc::string::String,
806    #[prost(message, optional, tag = "2")]
807    pub branch_or_commit: ::core::option::Option<
808        super::super::versioning::v1::BranchOrCommit,
809    >,
810}
811#[derive(Clone, PartialEq, ::prost::Message)]
812pub struct GetProcedureAsNestedResponse {
813    #[prost(message, optional, tag = "1")]
814    pub nested_procedure: ::core::option::Option<NestedProcedure>,
815}
816#[derive(Clone, PartialEq, ::prost::Message)]
817pub struct MergeToMainRequest {
818    #[prost(string, tag = "1")]
819    pub rid: ::prost::alloc::string::String,
820    #[prost(string, tag = "2")]
821    pub branch: ::prost::alloc::string::String,
822    /// If present, this commit ID must match the latest commit on main for the merge to succeed.
823    #[prost(string, optional, tag = "3")]
824    pub latest_commit_on_main: ::core::option::Option<::prost::alloc::string::String>,
825    #[prost(string, tag = "4")]
826    pub message: ::prost::alloc::string::String,
827}
828#[derive(Clone, PartialEq, ::prost::Message)]
829pub struct MergeToMainResponse {
830    #[prost(message, optional, tag = "1")]
831    pub procedure: ::core::option::Option<Procedure>,
832}
833#[derive(Clone, PartialEq, ::prost::Message)]
834pub struct SaveWorkingStateRequest {
835    #[prost(string, tag = "1")]
836    pub rid: ::prost::alloc::string::String,
837    #[prost(string, optional, tag = "2")]
838    pub branch: ::core::option::Option<::prost::alloc::string::String>,
839    #[prost(string, tag = "3")]
840    pub message: ::prost::alloc::string::String,
841    /// If present, this commit ID must match the latest commit on the branch for the save to succeed.
842    #[prost(string, optional, tag = "4")]
843    pub latest_commit_on_branch: ::core::option::Option<::prost::alloc::string::String>,
844    #[prost(message, optional, tag = "5")]
845    pub state: ::core::option::Option<ProcedureState>,
846}
847#[derive(Clone, PartialEq, ::prost::Message)]
848pub struct SaveWorkingStateResponse {
849    #[prost(message, optional, tag = "1")]
850    pub procedure: ::core::option::Option<Procedure>,
851}
852#[derive(Clone, PartialEq, ::prost::Message)]
853pub struct CommitRequest {
854    #[prost(string, tag = "1")]
855    pub rid: ::prost::alloc::string::String,
856    #[prost(string, optional, tag = "2")]
857    pub branch: ::core::option::Option<::prost::alloc::string::String>,
858    /// If present, this commit ID must match the latest commit on the branch for the commit to succeed.
859    #[prost(string, optional, tag = "3")]
860    pub latest_commit_on_branch: ::core::option::Option<::prost::alloc::string::String>,
861    #[prost(string, tag = "4")]
862    pub message: ::prost::alloc::string::String,
863    #[prost(message, optional, tag = "5")]
864    pub state: ::core::option::Option<ProcedureState>,
865}
866#[derive(Clone, PartialEq, ::prost::Message)]
867pub struct CommitResponse {
868    #[prost(message, optional, tag = "1")]
869    pub procedure: ::core::option::Option<Procedure>,
870}
871#[derive(Clone, PartialEq, ::prost::Message)]
872pub struct ProcedureSearchQuery {
873    #[prost(oneof = "procedure_search_query::Query", tags = "1, 2, 3, 4, 5, 6, 7, 8")]
874    pub query: ::core::option::Option<procedure_search_query::Query>,
875}
876/// Nested message and enum types in `ProcedureSearchQuery`.
877pub mod procedure_search_query {
878    #[derive(Clone, PartialEq, ::prost::Message)]
879    pub struct ProcedureSearchAndQuery {
880        #[prost(message, repeated, tag = "1")]
881        pub queries: ::prost::alloc::vec::Vec<super::ProcedureSearchQuery>,
882    }
883    #[derive(Clone, PartialEq, ::prost::Message)]
884    pub struct ProcedureSearchOrQuery {
885        #[prost(message, repeated, tag = "1")]
886        pub queries: ::prost::alloc::vec::Vec<super::ProcedureSearchQuery>,
887    }
888    #[derive(Clone, PartialEq, ::prost::Oneof)]
889    pub enum Query {
890        #[prost(string, tag = "1")]
891        SearchText(::prost::alloc::string::String),
892        #[prost(string, tag = "2")]
893        Label(::prost::alloc::string::String),
894        #[prost(message, tag = "3")]
895        Property(super::super::super::types::Property),
896        #[prost(message, tag = "4")]
897        And(ProcedureSearchAndQuery),
898        #[prost(message, tag = "5")]
899        Or(ProcedureSearchOrQuery),
900        #[prost(string, tag = "6")]
901        Workspace(::prost::alloc::string::String),
902        #[prost(string, tag = "7")]
903        CreatedBy(::prost::alloc::string::String),
904        #[prost(bool, tag = "8")]
905        IsArchived(bool),
906    }
907}
908#[derive(Clone, Copy, PartialEq, ::prost::Message)]
909pub struct SearchProceduresSortOptions {
910    /// Defaults to true (descending)
911    #[prost(bool, optional, tag = "1")]
912    pub is_descending: ::core::option::Option<bool>,
913    /// Defaults to CREATED_AT
914    #[prost(enumeration = "SearchProceduresSortField", optional, tag = "2")]
915    pub sort_field: ::core::option::Option<i32>,
916}
917#[derive(Clone, PartialEq, ::prost::Message)]
918pub struct SearchProceduresRequest {
919    #[prost(message, optional, tag = "1")]
920    pub query: ::core::option::Option<ProcedureSearchQuery>,
921    /// If not set, default is to sort by created_at descending
922    #[prost(message, optional, tag = "2")]
923    pub sort_options: ::core::option::Option<SearchProceduresSortOptions>,
924    /// Page sizes greater than 1_000 will be rejected. Default pageSize is 100.
925    #[prost(int32, optional, tag = "3")]
926    pub page_size: ::core::option::Option<i32>,
927    #[prost(string, optional, tag = "4")]
928    pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
929}
930#[derive(Clone, PartialEq, ::prost::Message)]
931pub struct SearchProceduresResponse {
932    #[prost(message, repeated, tag = "1")]
933    pub procedure_metadata: ::prost::alloc::vec::Vec<ProcedureMetadata>,
934    #[prost(string, optional, tag = "2")]
935    pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
936}
937#[derive(Clone, PartialEq, ::prost::Message)]
938pub struct ArchiveProceduresRequest {
939    #[prost(string, repeated, tag = "1")]
940    pub procedure_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
941}
942#[derive(Clone, PartialEq, ::prost::Message)]
943pub struct ArchiveProceduresResponse {
944    #[prost(string, repeated, tag = "1")]
945    pub procedure_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
946}
947#[derive(Clone, PartialEq, ::prost::Message)]
948pub struct UnarchiveProceduresRequest {
949    #[prost(string, repeated, tag = "1")]
950    pub procedure_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
951}
952#[derive(Clone, PartialEq, ::prost::Message)]
953pub struct UnarchiveProceduresResponse {
954    #[prost(string, repeated, tag = "1")]
955    pub procedure_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
956}
957#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
958#[repr(i32)]
959pub enum SearchProceduresSortField {
960    Unspecified = 0,
961    Name = 1,
962    CreatedAt = 2,
963    UpdatedAt = 3,
964}
965impl SearchProceduresSortField {
966    /// String value of the enum field names used in the ProtoBuf definition.
967    ///
968    /// The values are not transformed in any way and thus are considered stable
969    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
970    pub fn as_str_name(&self) -> &'static str {
971        match self {
972            Self::Unspecified => "SEARCH_PROCEDURES_SORT_FIELD_UNSPECIFIED",
973            Self::Name => "SEARCH_PROCEDURES_SORT_FIELD_NAME",
974            Self::CreatedAt => "SEARCH_PROCEDURES_SORT_FIELD_CREATED_AT",
975            Self::UpdatedAt => "SEARCH_PROCEDURES_SORT_FIELD_UPDATED_AT",
976        }
977    }
978    /// Creates an enum from field names used in the ProtoBuf definition.
979    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
980        match value {
981            "SEARCH_PROCEDURES_SORT_FIELD_UNSPECIFIED" => Some(Self::Unspecified),
982            "SEARCH_PROCEDURES_SORT_FIELD_NAME" => Some(Self::Name),
983            "SEARCH_PROCEDURES_SORT_FIELD_CREATED_AT" => Some(Self::CreatedAt),
984            "SEARCH_PROCEDURES_SORT_FIELD_UPDATED_AT" => Some(Self::UpdatedAt),
985            _ => None,
986        }
987    }
988}
989#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
990#[repr(i32)]
991pub enum ProceduresServiceError {
992    Unspecified = 0,
993    NotFound = 1,
994    CommitNotFound = 2,
995    CannotMergeMain = 3,
996    CannotCommitToArchivedProcedure = 4,
997    InvalidGraph = 5,
998    InvalidSearchToken = 6,
999}
1000impl ProceduresServiceError {
1001    /// String value of the enum field names used in the ProtoBuf definition.
1002    ///
1003    /// The values are not transformed in any way and thus are considered stable
1004    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1005    pub fn as_str_name(&self) -> &'static str {
1006        match self {
1007            Self::Unspecified => "PROCEDURES_SERVICE_ERROR_UNSPECIFIED",
1008            Self::NotFound => "PROCEDURES_SERVICE_ERROR_NOT_FOUND",
1009            Self::CommitNotFound => "PROCEDURES_SERVICE_ERROR_COMMIT_NOT_FOUND",
1010            Self::CannotMergeMain => "PROCEDURES_SERVICE_ERROR_CANNOT_MERGE_MAIN",
1011            Self::CannotCommitToArchivedProcedure => {
1012                "PROCEDURES_SERVICE_ERROR_CANNOT_COMMIT_TO_ARCHIVED_PROCEDURE"
1013            }
1014            Self::InvalidGraph => "PROCEDURES_SERVICE_ERROR_INVALID_GRAPH",
1015            Self::InvalidSearchToken => "PROCEDURES_SERVICE_ERROR_INVALID_SEARCH_TOKEN",
1016        }
1017    }
1018    /// Creates an enum from field names used in the ProtoBuf definition.
1019    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1020        match value {
1021            "PROCEDURES_SERVICE_ERROR_UNSPECIFIED" => Some(Self::Unspecified),
1022            "PROCEDURES_SERVICE_ERROR_NOT_FOUND" => Some(Self::NotFound),
1023            "PROCEDURES_SERVICE_ERROR_COMMIT_NOT_FOUND" => Some(Self::CommitNotFound),
1024            "PROCEDURES_SERVICE_ERROR_CANNOT_MERGE_MAIN" => Some(Self::CannotMergeMain),
1025            "PROCEDURES_SERVICE_ERROR_CANNOT_COMMIT_TO_ARCHIVED_PROCEDURE" => {
1026                Some(Self::CannotCommitToArchivedProcedure)
1027            }
1028            "PROCEDURES_SERVICE_ERROR_INVALID_GRAPH" => Some(Self::InvalidGraph),
1029            "PROCEDURES_SERVICE_ERROR_INVALID_SEARCH_TOKEN" => {
1030                Some(Self::InvalidSearchToken)
1031            }
1032            _ => None,
1033        }
1034    }
1035}
1036/// Generated client implementations.
1037pub mod procedures_service_client {
1038    #![allow(
1039        unused_variables,
1040        dead_code,
1041        missing_docs,
1042        clippy::wildcard_imports,
1043        clippy::let_unit_value,
1044    )]
1045    use tonic::codegen::*;
1046    use tonic::codegen::http::Uri;
1047    /// Service for creating and managing procedure templates, which are versioned collections
1048    /// of steps to be performed, typically in a specific order.
1049    #[derive(Debug, Clone)]
1050    pub struct ProceduresServiceClient<T> {
1051        inner: tonic::client::Grpc<T>,
1052    }
1053    impl ProceduresServiceClient<tonic::transport::Channel> {
1054        /// Attempt to create a new client by connecting to a given endpoint.
1055        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1056        where
1057            D: TryInto<tonic::transport::Endpoint>,
1058            D::Error: Into<StdError>,
1059        {
1060            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1061            Ok(Self::new(conn))
1062        }
1063    }
1064    impl<T> ProceduresServiceClient<T>
1065    where
1066        T: tonic::client::GrpcService<tonic::body::Body>,
1067        T::Error: Into<StdError>,
1068        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1069        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1070    {
1071        pub fn new(inner: T) -> Self {
1072            let inner = tonic::client::Grpc::new(inner);
1073            Self { inner }
1074        }
1075        pub fn with_origin(inner: T, origin: Uri) -> Self {
1076            let inner = tonic::client::Grpc::with_origin(inner, origin);
1077            Self { inner }
1078        }
1079        pub fn with_interceptor<F>(
1080            inner: T,
1081            interceptor: F,
1082        ) -> ProceduresServiceClient<InterceptedService<T, F>>
1083        where
1084            F: tonic::service::Interceptor,
1085            T::ResponseBody: Default,
1086            T: tonic::codegen::Service<
1087                http::Request<tonic::body::Body>,
1088                Response = http::Response<
1089                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
1090                >,
1091            >,
1092            <T as tonic::codegen::Service<
1093                http::Request<tonic::body::Body>,
1094            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1095        {
1096            ProceduresServiceClient::new(InterceptedService::new(inner, interceptor))
1097        }
1098        /// Compress requests with the given encoding.
1099        ///
1100        /// This requires the server to support it otherwise it might respond with an
1101        /// error.
1102        #[must_use]
1103        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1104            self.inner = self.inner.send_compressed(encoding);
1105            self
1106        }
1107        /// Enable decompressing responses.
1108        #[must_use]
1109        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1110            self.inner = self.inner.accept_compressed(encoding);
1111            self
1112        }
1113        /// Limits the maximum size of a decoded message.
1114        ///
1115        /// Default: `4MB`
1116        #[must_use]
1117        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1118            self.inner = self.inner.max_decoding_message_size(limit);
1119            self
1120        }
1121        /// Limits the maximum size of an encoded message.
1122        ///
1123        /// Default: `usize::MAX`
1124        #[must_use]
1125        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1126            self.inner = self.inner.max_encoding_message_size(limit);
1127            self
1128        }
1129        /// Create a new procedure
1130        pub async fn create_procedure(
1131            &mut self,
1132            request: impl tonic::IntoRequest<super::CreateProcedureRequest>,
1133        ) -> std::result::Result<
1134            tonic::Response<super::CreateProcedureResponse>,
1135            tonic::Status,
1136        > {
1137            self.inner
1138                .ready()
1139                .await
1140                .map_err(|e| {
1141                    tonic::Status::unknown(
1142                        format!("Service was not ready: {}", e.into()),
1143                    )
1144                })?;
1145            let codec = tonic::codec::ProstCodec::default();
1146            let path = http::uri::PathAndQuery::from_static(
1147                "/nominal.procedures.v1.ProceduresService/CreateProcedure",
1148            );
1149            let mut req = request.into_request();
1150            req.extensions_mut()
1151                .insert(
1152                    GrpcMethod::new(
1153                        "nominal.procedures.v1.ProceduresService",
1154                        "CreateProcedure",
1155                    ),
1156                );
1157            self.inner.unary(req, path, codec).await
1158        }
1159        /// Get a procedure by its RID
1160        pub async fn get_procedure(
1161            &mut self,
1162            request: impl tonic::IntoRequest<super::GetProcedureRequest>,
1163        ) -> std::result::Result<
1164            tonic::Response<super::GetProcedureResponse>,
1165            tonic::Status,
1166        > {
1167            self.inner
1168                .ready()
1169                .await
1170                .map_err(|e| {
1171                    tonic::Status::unknown(
1172                        format!("Service was not ready: {}", e.into()),
1173                    )
1174                })?;
1175            let codec = tonic::codec::ProstCodec::default();
1176            let path = http::uri::PathAndQuery::from_static(
1177                "/nominal.procedures.v1.ProceduresService/GetProcedure",
1178            );
1179            let mut req = request.into_request();
1180            req.extensions_mut()
1181                .insert(
1182                    GrpcMethod::new(
1183                        "nominal.procedures.v1.ProceduresService",
1184                        "GetProcedure",
1185                    ),
1186                );
1187            self.inner.unary(req, path, codec).await
1188        }
1189        /// Update the metadata of a procedure
1190        pub async fn update_procedure_metadata(
1191            &mut self,
1192            request: impl tonic::IntoRequest<super::UpdateProcedureMetadataRequest>,
1193        ) -> std::result::Result<
1194            tonic::Response<super::UpdateProcedureMetadataResponse>,
1195            tonic::Status,
1196        > {
1197            self.inner
1198                .ready()
1199                .await
1200                .map_err(|e| {
1201                    tonic::Status::unknown(
1202                        format!("Service was not ready: {}", e.into()),
1203                    )
1204                })?;
1205            let codec = tonic::codec::ProstCodec::default();
1206            let path = http::uri::PathAndQuery::from_static(
1207                "/nominal.procedures.v1.ProceduresService/UpdateProcedureMetadata",
1208            );
1209            let mut req = request.into_request();
1210            req.extensions_mut()
1211                .insert(
1212                    GrpcMethod::new(
1213                        "nominal.procedures.v1.ProceduresService",
1214                        "UpdateProcedureMetadata",
1215                    ),
1216                );
1217            self.inner.unary(req, path, codec).await
1218        }
1219        /// Parse a procedure from a nested procedure structure
1220        pub async fn parse_nested_procedure(
1221            &mut self,
1222            request: impl tonic::IntoRequest<super::ParseNestedProcedureRequest>,
1223        ) -> std::result::Result<
1224            tonic::Response<super::ParseNestedProcedureResponse>,
1225            tonic::Status,
1226        > {
1227            self.inner
1228                .ready()
1229                .await
1230                .map_err(|e| {
1231                    tonic::Status::unknown(
1232                        format!("Service was not ready: {}", e.into()),
1233                    )
1234                })?;
1235            let codec = tonic::codec::ProstCodec::default();
1236            let path = http::uri::PathAndQuery::from_static(
1237                "/nominal.procedures.v1.ProceduresService/ParseNestedProcedure",
1238            );
1239            let mut req = request.into_request();
1240            req.extensions_mut()
1241                .insert(
1242                    GrpcMethod::new(
1243                        "nominal.procedures.v1.ProceduresService",
1244                        "ParseNestedProcedure",
1245                    ),
1246                );
1247            self.inner.unary(req, path, codec).await
1248        }
1249        /// Get procedure as nested procedure
1250        /// TODO(pchen): in the future, not all graphs will be representable as nested procedures
1251        pub async fn get_procedure_as_nested(
1252            &mut self,
1253            request: impl tonic::IntoRequest<super::GetProcedureAsNestedRequest>,
1254        ) -> std::result::Result<
1255            tonic::Response<super::GetProcedureAsNestedResponse>,
1256            tonic::Status,
1257        > {
1258            self.inner
1259                .ready()
1260                .await
1261                .map_err(|e| {
1262                    tonic::Status::unknown(
1263                        format!("Service was not ready: {}", e.into()),
1264                    )
1265                })?;
1266            let codec = tonic::codec::ProstCodec::default();
1267            let path = http::uri::PathAndQuery::from_static(
1268                "/nominal.procedures.v1.ProceduresService/GetProcedureAsNested",
1269            );
1270            let mut req = request.into_request();
1271            req.extensions_mut()
1272                .insert(
1273                    GrpcMethod::new(
1274                        "nominal.procedures.v1.ProceduresService",
1275                        "GetProcedureAsNested",
1276                    ),
1277                );
1278            self.inner.unary(req, path, codec).await
1279        }
1280        /// Merge a branch of a procedure to main
1281        pub async fn merge_to_main(
1282            &mut self,
1283            request: impl tonic::IntoRequest<super::MergeToMainRequest>,
1284        ) -> std::result::Result<
1285            tonic::Response<super::MergeToMainResponse>,
1286            tonic::Status,
1287        > {
1288            self.inner
1289                .ready()
1290                .await
1291                .map_err(|e| {
1292                    tonic::Status::unknown(
1293                        format!("Service was not ready: {}", e.into()),
1294                    )
1295                })?;
1296            let codec = tonic::codec::ProstCodec::default();
1297            let path = http::uri::PathAndQuery::from_static(
1298                "/nominal.procedures.v1.ProceduresService/MergeToMain",
1299            );
1300            let mut req = request.into_request();
1301            req.extensions_mut()
1302                .insert(
1303                    GrpcMethod::new(
1304                        "nominal.procedures.v1.ProceduresService",
1305                        "MergeToMain",
1306                    ),
1307                );
1308            self.inner.unary(req, path, codec).await
1309        }
1310        /// Save the working state of a procedure
1311        pub async fn save_working_state(
1312            &mut self,
1313            request: impl tonic::IntoRequest<super::SaveWorkingStateRequest>,
1314        ) -> std::result::Result<
1315            tonic::Response<super::SaveWorkingStateResponse>,
1316            tonic::Status,
1317        > {
1318            self.inner
1319                .ready()
1320                .await
1321                .map_err(|e| {
1322                    tonic::Status::unknown(
1323                        format!("Service was not ready: {}", e.into()),
1324                    )
1325                })?;
1326            let codec = tonic::codec::ProstCodec::default();
1327            let path = http::uri::PathAndQuery::from_static(
1328                "/nominal.procedures.v1.ProceduresService/SaveWorkingState",
1329            );
1330            let mut req = request.into_request();
1331            req.extensions_mut()
1332                .insert(
1333                    GrpcMethod::new(
1334                        "nominal.procedures.v1.ProceduresService",
1335                        "SaveWorkingState",
1336                    ),
1337                );
1338            self.inner.unary(req, path, codec).await
1339        }
1340        /// Commit a procedure to a branch
1341        pub async fn commit(
1342            &mut self,
1343            request: impl tonic::IntoRequest<super::CommitRequest>,
1344        ) -> std::result::Result<tonic::Response<super::CommitResponse>, tonic::Status> {
1345            self.inner
1346                .ready()
1347                .await
1348                .map_err(|e| {
1349                    tonic::Status::unknown(
1350                        format!("Service was not ready: {}", e.into()),
1351                    )
1352                })?;
1353            let codec = tonic::codec::ProstCodec::default();
1354            let path = http::uri::PathAndQuery::from_static(
1355                "/nominal.procedures.v1.ProceduresService/Commit",
1356            );
1357            let mut req = request.into_request();
1358            req.extensions_mut()
1359                .insert(
1360                    GrpcMethod::new("nominal.procedures.v1.ProceduresService", "Commit"),
1361                );
1362            self.inner.unary(req, path, codec).await
1363        }
1364        /// Searches all procedures, returning paged results
1365        pub async fn search_procedures(
1366            &mut self,
1367            request: impl tonic::IntoRequest<super::SearchProceduresRequest>,
1368        ) -> std::result::Result<
1369            tonic::Response<super::SearchProceduresResponse>,
1370            tonic::Status,
1371        > {
1372            self.inner
1373                .ready()
1374                .await
1375                .map_err(|e| {
1376                    tonic::Status::unknown(
1377                        format!("Service was not ready: {}", e.into()),
1378                    )
1379                })?;
1380            let codec = tonic::codec::ProstCodec::default();
1381            let path = http::uri::PathAndQuery::from_static(
1382                "/nominal.procedures.v1.ProceduresService/SearchProcedures",
1383            );
1384            let mut req = request.into_request();
1385            req.extensions_mut()
1386                .insert(
1387                    GrpcMethod::new(
1388                        "nominal.procedures.v1.ProceduresService",
1389                        "SearchProcedures",
1390                    ),
1391                );
1392            self.inner.unary(req, path, codec).await
1393        }
1394        /// Archive procedures
1395        pub async fn archive_procedures(
1396            &mut self,
1397            request: impl tonic::IntoRequest<super::ArchiveProceduresRequest>,
1398        ) -> std::result::Result<
1399            tonic::Response<super::ArchiveProceduresResponse>,
1400            tonic::Status,
1401        > {
1402            self.inner
1403                .ready()
1404                .await
1405                .map_err(|e| {
1406                    tonic::Status::unknown(
1407                        format!("Service was not ready: {}", e.into()),
1408                    )
1409                })?;
1410            let codec = tonic::codec::ProstCodec::default();
1411            let path = http::uri::PathAndQuery::from_static(
1412                "/nominal.procedures.v1.ProceduresService/ArchiveProcedures",
1413            );
1414            let mut req = request.into_request();
1415            req.extensions_mut()
1416                .insert(
1417                    GrpcMethod::new(
1418                        "nominal.procedures.v1.ProceduresService",
1419                        "ArchiveProcedures",
1420                    ),
1421                );
1422            self.inner.unary(req, path, codec).await
1423        }
1424        /// Unarchive procedures
1425        pub async fn unarchive_procedures(
1426            &mut self,
1427            request: impl tonic::IntoRequest<super::UnarchiveProceduresRequest>,
1428        ) -> std::result::Result<
1429            tonic::Response<super::UnarchiveProceduresResponse>,
1430            tonic::Status,
1431        > {
1432            self.inner
1433                .ready()
1434                .await
1435                .map_err(|e| {
1436                    tonic::Status::unknown(
1437                        format!("Service was not ready: {}", e.into()),
1438                    )
1439                })?;
1440            let codec = tonic::codec::ProstCodec::default();
1441            let path = http::uri::PathAndQuery::from_static(
1442                "/nominal.procedures.v1.ProceduresService/UnarchiveProcedures",
1443            );
1444            let mut req = request.into_request();
1445            req.extensions_mut()
1446                .insert(
1447                    GrpcMethod::new(
1448                        "nominal.procedures.v1.ProceduresService",
1449                        "UnarchiveProcedures",
1450                    ),
1451                );
1452            self.inner.unary(req, path, codec).await
1453        }
1454    }
1455}