Skip to main content

webui_protocol/
gen_webui.rs

1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT license.
3
4// This file is @generated by prost-build from proto/webui.proto.
5// Do not edit manually. Regenerate with: cargo xtask proto
6// This file is @generated by prost-build.
7/// Per-component metadata keyed by tag name.
8#[derive(serde::Serialize, serde::Deserialize)]
9#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
10pub struct ComponentData {
11    /// Non-WebUI client-side template payload.
12    /// FAST plugins store complete <f-template> HTML here.
13    #[prost(string, tag = "1")]
14    pub template: ::prost::alloc::string::String,
15    /// Component CSS content for the Module strategy.
16    /// Contains the full CSS content when CssStrategy::Module is active.
17    /// Empty for Link and Style strategies (CSS is handled via <link> tags
18    /// or inline <style> tags baked into raw fragments by the parser).
19    #[prost(string, tag = "2")]
20    pub css: ::prost::alloc::string::String,
21    /// External stylesheet href for the Link CSS strategy.
22    /// Set to e.g. "/my-card.css" when the component has a CSS file and the
23    /// build used CssStrategy::Link. Empty for Style/Module strategies and
24    /// for components without CSS.
25    /// The handler uses css_strategy and dom_strategy on WebUIProtocol to
26    /// decide what to emit in <head>:
27    ///    Link + Shadow → <link rel="preload"> (shadow root has the stylesheet)
28    ///    Link + Light  → <link rel="stylesheet"> (no shadow root to host it)
29    #[prost(string, tag = "3")]
30    pub css_href: ::prost::alloc::string::String,
31    /// WebUI plugin JSON-safe component metadata.
32    /// Stored separately from executable condition closures so handlers can emit
33    /// the static metadata in application/json data blocks.
34    #[prost(string, tag = "4")]
35    pub template_json: ::prost::alloc::string::String,
36    /// WebUI plugin component-local JavaScript condition closure array.
37    /// Empty when the component has no conditions or boolean attributes.
38    #[prost(string, tag = "5")]
39    pub template_functions: ::prost::alloc::string::String,
40    /// Exact @observable + @attr property keys when hydration_mode is KEYS.
41    /// Existing SSR host attributes take precedence; bootstrap state fills
42    /// attribute-backed properties that were not materialized on the host.
43    /// Template roots already exist in the trusted SSR DOM and do not enter
44    /// initial state solely because a component has authored browser code.
45    /// Sorted and deduplicated; empty for NONE and ALL.
46    #[prost(string, repeated, tag = "6")]
47    pub hydration_keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
48    /// Exact partial-navigation keys when navigation_mode is KEYS. Authored
49    /// components use @observable + @attr property keys plus template roots.
50    /// Scriptless compiled templates include only their template roots.
51    /// Sorted and deduplicated; empty for NONE and ALL.
52    #[prost(string, repeated, tag = "7")]
53    pub navigation_keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
54    /// How initial hydration state is selected for this component.
55    #[prost(enumeration = "StateProjectionMode", tag = "8")]
56    pub hydration_mode: i32,
57    /// How partial-navigation state is selected for this component. Presence is
58    /// significant: protocols produced before projection metadata leave this
59    /// absent, so handlers preserve full state instead of treating it as NONE.
60    #[prost(enumeration = "StateProjectionMode", optional, tag = "9")]
61    pub navigation_mode: ::core::option::Option<i32>,
62}
63/// Root protocol containing all fragment records and build metadata.
64#[derive(serde::Serialize, serde::Deserialize)]
65#[derive(Clone, PartialEq, ::prost::Message)]
66pub struct WebUiProtocol {
67    #[prost(map = "string, message", tag = "1")]
68    pub fragments: ::std::collections::HashMap<
69        ::prost::alloc::string::String,
70        FragmentList,
71    >,
72    /// Sorted, deduplicated CSS custom property names used across all components
73    /// and entry page styles (e.g., "colorBrandBackground", "spacingMedium").
74    /// Only usage via var(--name) is included; local definitions are excluded.
75    #[prost(string, repeated, tag = "2")]
76    pub tokens: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
77    /// Per-component data keyed by tag name (f-template + CSS).
78    #[prost(map = "string, message", tag = "3")]
79    pub components: ::std::collections::HashMap<
80        ::prost::alloc::string::String,
81        ComponentData,
82    >,
83    /// Build-wide CSS delivery strategy. Determines how the handler emits
84    /// CSS-related tags in <head> for components with css_href.
85    #[prost(enumeration = "CssStrategy", tag = "4")]
86    pub css_strategy: i32,
87    /// Build-wide DOM encapsulation strategy. Combined with css_strategy to
88    /// decide preload vs stylesheet emission.
89    #[prost(enumeration = "DomStrategy", tag = "5")]
90    pub dom_strategy: i32,
91    /// Whether initial SSR metadata contains full state or WebUI component
92    /// projection. Partial-navigation state remains component-driven.
93    #[prost(enumeration = "InitialStateStrategy", tag = "6")]
94    pub initial_state_strategy: i32,
95    /// Ready-to-write `<link rel="modulepreload">` hrefs for the shared chunks
96    /// that the page's critical module entries statically import, in the exact
97    /// order they must be emitted (largest chunk first).
98    ///
99    /// These chunks are named only inside the entry's own bytes, so the browser's
100    /// preload scanner cannot discover them until it has downloaded and parsed
101    /// the entry. Emitting them as hints removes that serialization.
102    ///
103    /// Order is load-bearing: preloads are issued in document order over one
104    /// connection, so a small chunk ahead of a large one delays the long pole.
105    /// The compiler resolves and sorts these at build time so the handler writes
106    /// them verbatim with no per-request work.
107    #[prost(string, repeated, tag = "7")]
108    pub module_preloads: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
109    /// Free-form <boundary name> values keyed by entry fragment and stored in
110    /// declaration order. Hosts resolve a name once to its zero-based BoundaryId;
111    /// names never reach the rendered HTML response.
112    #[prost(map = "string, message", tag = "8")]
113    pub streaming_boundaries: ::std::collections::HashMap<
114        ::prost::alloc::string::String,
115        StreamingBoundaryList,
116    >,
117    /// Build-generated document-level rules for component rendering policies.
118    /// Empty when no component opts into lazy rendering.
119    #[prost(string, tag = "9")]
120    pub component_render_css: ::prost::alloc::string::String,
121}
122/// Ordered compile-time boundary names for one entry fragment.
123#[derive(serde::Serialize, serde::Deserialize)]
124#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
125pub struct StreamingBoundaryList {
126    #[prost(string, repeated, tag = "1")]
127    pub names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
128}
129/// A list of fragments (needed because protobuf maps cannot have repeated values directly).
130#[derive(serde::Serialize, serde::Deserialize)]
131#[derive(Clone, PartialEq, ::prost::Message)]
132pub struct FragmentList {
133    #[prost(message, repeated, tag = "1")]
134    pub fragments: ::prost::alloc::vec::Vec<WebUiFragment>,
135}
136/// A single fragment — one of several types.
137#[derive(serde::Serialize, serde::Deserialize)]
138#[derive(Clone, PartialEq, ::prost::Message)]
139pub struct WebUiFragment {
140    #[prost(oneof = "web_ui_fragment::Fragment", tags = "1, 2, 3, 4, 5, 6, 7, 8, 9")]
141    pub fragment: ::core::option::Option<web_ui_fragment::Fragment>,
142}
143/// Nested message and enum types in `WebUIFragment`.
144pub mod web_ui_fragment {
145    #[derive(serde::Serialize, serde::Deserialize)]
146    #[derive(Clone, PartialEq, ::prost::Oneof)]
147    pub enum Fragment {
148        #[prost(message, tag = "1")]
149        Raw(super::WebUiFragmentRaw),
150        #[prost(message, tag = "2")]
151        Component(super::WebUiFragmentComponent),
152        #[prost(message, tag = "3")]
153        ForLoop(super::WebUiFragmentFor),
154        #[prost(message, tag = "4")]
155        Signal(super::WebUiFragmentSignal),
156        #[prost(message, tag = "5")]
157        IfCond(super::WebUiFragmentIf),
158        #[prost(message, tag = "6")]
159        Attribute(super::WebUiFragmentAttribute),
160        #[prost(message, tag = "7")]
161        Plugin(super::WebUiFragmentPlugin),
162        #[prost(message, tag = "8")]
163        Route(super::WebUiFragmentRoute),
164        #[prost(message, tag = "9")]
165        Outlet(super::WebUiFragmentOutlet),
166    }
167}
168/// Declarative route definition linking a URL path template to a component.
169/// Nested routes are expressed via repeated children.
170#[derive(serde::Serialize, serde::Deserialize)]
171#[derive(Clone, PartialEq, ::prost::Message)]
172pub struct WebUiFragmentRoute {
173    #[prost(string, tag = "1")]
174    pub path: ::prost::alloc::string::String,
175    #[prost(string, tag = "2")]
176    pub fragment_id: ::prost::alloc::string::String,
177    #[prost(bool, tag = "3")]
178    pub exact: bool,
179    /// Nested child routes rendered at the component's <outlet />.
180    #[prost(message, repeated, tag = "4")]
181    pub children: ::prost::alloc::vec::Vec<WebUiFragmentRoute>,
182    /// Comma-separated allowlist of query parameters forwarded as attributes.
183    /// Empty string means no query params are forwarded (deny-by-default).
184    #[prost(string, tag = "5")]
185    pub allowed_query: ::prost::alloc::string::String,
186    /// When true, the router preserves the mounted component instance across
187    /// navigations instead of destroying and recreating it. Opt-in per route.
188    #[prost(bool, tag = "6")]
189    pub keep_alive: bool,
190    /// Cache tag templates for this route (e.g. "thread:{threadId}", "inbox").
191    /// Placeholders like {param} are resolved at render time with actual param values.
192    #[prost(string, repeated, tag = "7")]
193    pub cache_tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
194    /// Invalidation tag templates (e.g. "inbox", "thread:{threadId}").
195    /// After a mutation action on this route, these tags are auto-invalidated.
196    /// Supports {param} placeholders resolved at render time.
197    #[prost(string, repeated, tag = "8")]
198    pub invalidates: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
199    /// Component tag name for the pending/loading UI (e.g. "mail-skeleton").
200    /// Validated at build time — build fails if the component does not exist.
201    #[prost(string, tag = "9")]
202    pub pending_component: ::prost::alloc::string::String,
203    /// Component tag name for the error boundary UI (e.g. "error-page").
204    /// Validated at build time — build fails if the component does not exist.
205    #[prost(string, tag = "10")]
206    pub error_component: ::prost::alloc::string::String,
207}
208/// Outlet placeholder — marks where matched child route content renders.
209/// Components use this to indicate where nested route children are rendered.
210#[derive(serde::Serialize, serde::Deserialize)]
211#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
212pub struct WebUiFragmentOutlet {}
213/// Opaque plugin-specific data passed from parser plugin to handler plugin.
214/// WebUI framework does not interpret this data — it is a pass-through conduit.
215/// Each parser/handler plugin pair defines its own binary contract for the data field.
216#[derive(serde::Serialize, serde::Deserialize)]
217#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
218pub struct WebUiFragmentPlugin {
219    #[prost(bytes = "vec", tag = "1")]
220    pub data: ::prost::alloc::vec::Vec<u8>,
221}
222/// Static text or HTML content.
223#[derive(serde::Serialize, serde::Deserialize)]
224#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
225pub struct WebUiFragmentRaw {
226    #[prost(string, tag = "1")]
227    pub value: ::prost::alloc::string::String,
228}
229/// Reference to a reusable component fragment.
230#[derive(serde::Serialize, serde::Deserialize)]
231#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
232pub struct WebUiFragmentComponent {
233    #[prost(string, tag = "1")]
234    pub fragment_id: ::prost::alloc::string::String,
235}
236/// Loop directive iterating over a collection.
237#[derive(serde::Serialize, serde::Deserialize)]
238#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
239pub struct WebUiFragmentFor {
240    #[prost(string, tag = "1")]
241    pub item: ::prost::alloc::string::String,
242    #[prost(string, tag = "2")]
243    pub collection: ::prost::alloc::string::String,
244    #[prost(string, tag = "3")]
245    pub fragment_id: ::prost::alloc::string::String,
246}
247/// Dynamic data binding via signal.
248#[derive(serde::Serialize, serde::Deserialize)]
249#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
250pub struct WebUiFragmentSignal {
251    #[prost(string, tag = "1")]
252    pub value: ::prost::alloc::string::String,
253    #[prost(bool, tag = "2")]
254    pub raw: bool,
255}
256/// Conditional rendering fragment.
257#[derive(serde::Serialize, serde::Deserialize)]
258#[derive(Clone, PartialEq, ::prost::Message)]
259pub struct WebUiFragmentIf {
260    #[prost(message, optional, tag = "1")]
261    pub condition: ::core::option::Option<ConditionExpr>,
262    #[prost(string, tag = "2")]
263    pub fragment_id: ::prost::alloc::string::String,
264}
265/// Dynamic attribute binding.
266#[derive(serde::Serialize, serde::Deserialize)]
267#[derive(Clone, PartialEq, ::prost::Message)]
268pub struct WebUiFragmentAttribute {
269    #[prost(string, tag = "1")]
270    pub name: ::prost::alloc::string::String,
271    /// For simple dynamic attrs, the signal name.
272    #[prost(string, tag = "2")]
273    pub value: ::prost::alloc::string::String,
274    /// For mixed (template) attrs, the sub-stream ID.
275    #[prost(string, tag = "3")]
276    pub template: ::prost::alloc::string::String,
277    /// True for :-prefixed complex attributes.
278    #[prost(bool, tag = "4")]
279    pub complex: bool,
280    /// True for the first dynamic attribute on a component element.
281    #[prost(bool, tag = "5")]
282    pub attr_start: bool,
283    /// True for skipped attributes (class, style, role, data-*, aria-*).
284    #[prost(bool, tag = "6")]
285    pub attr_skip: bool,
286    /// True for static attribute values on components.
287    #[prost(bool, tag = "7")]
288    pub raw_value: bool,
289    /// For ?-prefixed boolean attributes, the condition tree.
290    #[prost(message, optional, tag = "8")]
291    pub condition_tree: ::core::option::Option<ConditionExpr>,
292}
293/// A condition expression tree.
294#[derive(serde::Serialize, serde::Deserialize)]
295#[derive(Clone, PartialEq, ::prost::Message)]
296pub struct ConditionExpr {
297    #[prost(oneof = "condition_expr::Expr", tags = "1, 2, 3, 4")]
298    pub expr: ::core::option::Option<condition_expr::Expr>,
299}
300/// Nested message and enum types in `ConditionExpr`.
301pub mod condition_expr {
302    #[derive(serde::Serialize, serde::Deserialize)]
303    #[derive(Clone, PartialEq, ::prost::Oneof)]
304    pub enum Expr {
305        #[prost(message, tag = "1")]
306        Predicate(super::Predicate),
307        #[prost(message, tag = "2")]
308        Not(::prost::alloc::boxed::Box<super::NotCondition>),
309        #[prost(message, tag = "3")]
310        Compound(::prost::alloc::boxed::Box<super::CompoundCondition>),
311        #[prost(message, tag = "4")]
312        Identifier(super::IdentifierCondition),
313    }
314}
315/// Simple comparison predicate.
316#[derive(serde::Serialize, serde::Deserialize)]
317#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
318pub struct Predicate {
319    #[prost(string, tag = "1")]
320    pub left: ::prost::alloc::string::String,
321    #[prost(enumeration = "ComparisonOperator", tag = "2")]
322    pub operator: i32,
323    #[prost(string, tag = "3")]
324    pub right: ::prost::alloc::string::String,
325}
326/// Negation wrapper.
327#[derive(serde::Serialize, serde::Deserialize)]
328#[derive(Clone, PartialEq, ::prost::Message)]
329pub struct NotCondition {
330    #[prost(message, optional, boxed, tag = "1")]
331    pub condition: ::core::option::Option<::prost::alloc::boxed::Box<ConditionExpr>>,
332}
333/// Two conditions joined by a logical operator.
334#[derive(serde::Serialize, serde::Deserialize)]
335#[derive(Clone, PartialEq, ::prost::Message)]
336pub struct CompoundCondition {
337    #[prost(message, optional, boxed, tag = "1")]
338    pub left: ::core::option::Option<::prost::alloc::boxed::Box<ConditionExpr>>,
339    #[prost(enumeration = "LogicalOperator", tag = "2")]
340    pub op: i32,
341    #[prost(message, optional, boxed, tag = "3")]
342    pub right: ::core::option::Option<::prost::alloc::boxed::Box<ConditionExpr>>,
343}
344/// Single identifier (variable name).
345#[derive(serde::Serialize, serde::Deserialize)]
346#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
347pub struct IdentifierCondition {
348    #[prost(string, tag = "1")]
349    pub value: ::prost::alloc::string::String,
350}
351/// Build-wide initial-state behavior.
352#[derive(serde::Serialize, serde::Deserialize)]
353#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
354#[repr(i32)]
355pub enum InitialStateStrategy {
356    /// Emit the complete state object. Used by default and non-WebUI plugins.
357    Full = 0,
358    /// Select state from reachable WebUI component surfaces.
359    Components = 1,
360}
361impl InitialStateStrategy {
362    /// String value of the enum field names used in the ProtoBuf definition.
363    ///
364    /// The values are not transformed in any way and thus are considered stable
365    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
366    pub fn as_str_name(&self) -> &'static str {
367        match self {
368            Self::Full => "INITIAL_STATE_STRATEGY_FULL",
369            Self::Components => "INITIAL_STATE_STRATEGY_COMPONENTS",
370        }
371    }
372    /// Creates an enum from field names used in the ProtoBuf definition.
373    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
374        match value {
375            "INITIAL_STATE_STRATEGY_FULL" => Some(Self::Full),
376            "INITIAL_STATE_STRATEGY_COMPONENTS" => Some(Self::Components),
377            _ => None,
378        }
379    }
380}
381/// Per-component state selection.
382#[derive(serde::Serialize, serde::Deserialize)]
383#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
384#[repr(i32)]
385pub enum StateProjectionMode {
386    /// The component is known not to consume state through this channel.
387    None = 0,
388    /// Select the component's explicit sorted key list.
389    Keys = 1,
390    /// The complete surface is unknown, so preserve correctness with full state.
391    All = 2,
392}
393impl StateProjectionMode {
394    /// String value of the enum field names used in the ProtoBuf definition.
395    ///
396    /// The values are not transformed in any way and thus are considered stable
397    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
398    pub fn as_str_name(&self) -> &'static str {
399        match self {
400            Self::None => "STATE_PROJECTION_MODE_NONE",
401            Self::Keys => "STATE_PROJECTION_MODE_KEYS",
402            Self::All => "STATE_PROJECTION_MODE_ALL",
403        }
404    }
405    /// Creates an enum from field names used in the ProtoBuf definition.
406    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
407        match value {
408            "STATE_PROJECTION_MODE_NONE" => Some(Self::None),
409            "STATE_PROJECTION_MODE_KEYS" => Some(Self::Keys),
410            "STATE_PROJECTION_MODE_ALL" => Some(Self::All),
411            _ => None,
412        }
413    }
414}
415/// CSS delivery strategy chosen at build time.
416#[derive(serde::Serialize, serde::Deserialize)]
417#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
418#[repr(i32)]
419pub enum CssStrategy {
420    Link = 0,
421    Style = 1,
422    Module = 2,
423}
424impl CssStrategy {
425    /// String value of the enum field names used in the ProtoBuf definition.
426    ///
427    /// The values are not transformed in any way and thus are considered stable
428    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
429    pub fn as_str_name(&self) -> &'static str {
430        match self {
431            Self::Link => "CSS_STRATEGY_LINK",
432            Self::Style => "CSS_STRATEGY_STYLE",
433            Self::Module => "CSS_STRATEGY_MODULE",
434        }
435    }
436    /// Creates an enum from field names used in the ProtoBuf definition.
437    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
438        match value {
439            "CSS_STRATEGY_LINK" => Some(Self::Link),
440            "CSS_STRATEGY_STYLE" => Some(Self::Style),
441            "CSS_STRATEGY_MODULE" => Some(Self::Module),
442            _ => None,
443        }
444    }
445}
446/// DOM encapsulation strategy chosen at build time.
447#[derive(serde::Serialize, serde::Deserialize)]
448#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
449#[repr(i32)]
450pub enum DomStrategy {
451    Shadow = 0,
452    Light = 1,
453}
454impl DomStrategy {
455    /// String value of the enum field names used in the ProtoBuf definition.
456    ///
457    /// The values are not transformed in any way and thus are considered stable
458    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
459    pub fn as_str_name(&self) -> &'static str {
460        match self {
461            Self::Shadow => "DOM_STRATEGY_SHADOW",
462            Self::Light => "DOM_STRATEGY_LIGHT",
463        }
464    }
465    /// Creates an enum from field names used in the ProtoBuf definition.
466    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
467        match value {
468            "DOM_STRATEGY_SHADOW" => Some(Self::Shadow),
469            "DOM_STRATEGY_LIGHT" => Some(Self::Light),
470            _ => None,
471        }
472    }
473}
474#[derive(serde::Serialize, serde::Deserialize)]
475#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
476#[repr(i32)]
477pub enum LogicalOperator {
478    Unspecified = 0,
479    And = 1,
480    Or = 2,
481}
482impl LogicalOperator {
483    /// String value of the enum field names used in the ProtoBuf definition.
484    ///
485    /// The values are not transformed in any way and thus are considered stable
486    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
487    pub fn as_str_name(&self) -> &'static str {
488        match self {
489            Self::Unspecified => "LOGICAL_OPERATOR_UNSPECIFIED",
490            Self::And => "AND",
491            Self::Or => "OR",
492        }
493    }
494    /// Creates an enum from field names used in the ProtoBuf definition.
495    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
496        match value {
497            "LOGICAL_OPERATOR_UNSPECIFIED" => Some(Self::Unspecified),
498            "AND" => Some(Self::And),
499            "OR" => Some(Self::Or),
500            _ => None,
501        }
502    }
503}
504#[derive(serde::Serialize, serde::Deserialize)]
505#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
506#[repr(i32)]
507pub enum ComparisonOperator {
508    Unspecified = 0,
509    GreaterThan = 1,
510    LessThan = 2,
511    Equal = 3,
512    NotEqual = 4,
513    GreaterThanOrEqual = 5,
514    LessThanOrEqual = 6,
515}
516impl ComparisonOperator {
517    /// String value of the enum field names used in the ProtoBuf definition.
518    ///
519    /// The values are not transformed in any way and thus are considered stable
520    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
521    pub fn as_str_name(&self) -> &'static str {
522        match self {
523            Self::Unspecified => "COMPARISON_OPERATOR_UNSPECIFIED",
524            Self::GreaterThan => "GREATER_THAN",
525            Self::LessThan => "LESS_THAN",
526            Self::Equal => "EQUAL",
527            Self::NotEqual => "NOT_EQUAL",
528            Self::GreaterThanOrEqual => "GREATER_THAN_OR_EQUAL",
529            Self::LessThanOrEqual => "LESS_THAN_OR_EQUAL",
530        }
531    }
532    /// Creates an enum from field names used in the ProtoBuf definition.
533    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
534        match value {
535            "COMPARISON_OPERATOR_UNSPECIFIED" => Some(Self::Unspecified),
536            "GREATER_THAN" => Some(Self::GreaterThan),
537            "LESS_THAN" => Some(Self::LessThan),
538            "EQUAL" => Some(Self::Equal),
539            "NOT_EQUAL" => Some(Self::NotEqual),
540            "GREATER_THAN_OR_EQUAL" => Some(Self::GreaterThanOrEqual),
541            "LESS_THAN_OR_EQUAL" => Some(Self::LessThanOrEqual),
542            _ => None,
543        }
544    }
545}