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}
118/// Ordered compile-time boundary names for one entry fragment.
119#[derive(serde::Serialize, serde::Deserialize)]
120#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
121pub struct StreamingBoundaryList {
122    #[prost(string, repeated, tag = "1")]
123    pub names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
124}
125/// A list of fragments (needed because protobuf maps cannot have repeated values directly).
126#[derive(serde::Serialize, serde::Deserialize)]
127#[derive(Clone, PartialEq, ::prost::Message)]
128pub struct FragmentList {
129    #[prost(message, repeated, tag = "1")]
130    pub fragments: ::prost::alloc::vec::Vec<WebUiFragment>,
131}
132/// A single fragment — one of several types.
133#[derive(serde::Serialize, serde::Deserialize)]
134#[derive(Clone, PartialEq, ::prost::Message)]
135pub struct WebUiFragment {
136    #[prost(oneof = "web_ui_fragment::Fragment", tags = "1, 2, 3, 4, 5, 6, 7, 8, 9")]
137    pub fragment: ::core::option::Option<web_ui_fragment::Fragment>,
138}
139/// Nested message and enum types in `WebUIFragment`.
140pub mod web_ui_fragment {
141    #[derive(serde::Serialize, serde::Deserialize)]
142    #[derive(Clone, PartialEq, ::prost::Oneof)]
143    pub enum Fragment {
144        #[prost(message, tag = "1")]
145        Raw(super::WebUiFragmentRaw),
146        #[prost(message, tag = "2")]
147        Component(super::WebUiFragmentComponent),
148        #[prost(message, tag = "3")]
149        ForLoop(super::WebUiFragmentFor),
150        #[prost(message, tag = "4")]
151        Signal(super::WebUiFragmentSignal),
152        #[prost(message, tag = "5")]
153        IfCond(super::WebUiFragmentIf),
154        #[prost(message, tag = "6")]
155        Attribute(super::WebUiFragmentAttribute),
156        #[prost(message, tag = "7")]
157        Plugin(super::WebUiFragmentPlugin),
158        #[prost(message, tag = "8")]
159        Route(super::WebUiFragmentRoute),
160        #[prost(message, tag = "9")]
161        Outlet(super::WebUiFragmentOutlet),
162    }
163}
164/// Declarative route definition linking a URL path template to a component.
165/// Nested routes are expressed via repeated children.
166#[derive(serde::Serialize, serde::Deserialize)]
167#[derive(Clone, PartialEq, ::prost::Message)]
168pub struct WebUiFragmentRoute {
169    #[prost(string, tag = "1")]
170    pub path: ::prost::alloc::string::String,
171    #[prost(string, tag = "2")]
172    pub fragment_id: ::prost::alloc::string::String,
173    #[prost(bool, tag = "3")]
174    pub exact: bool,
175    /// Nested child routes rendered at the component's <outlet />.
176    #[prost(message, repeated, tag = "4")]
177    pub children: ::prost::alloc::vec::Vec<WebUiFragmentRoute>,
178    /// Comma-separated allowlist of query parameters forwarded as attributes.
179    /// Empty string means no query params are forwarded (deny-by-default).
180    #[prost(string, tag = "5")]
181    pub allowed_query: ::prost::alloc::string::String,
182    /// When true, the router preserves the mounted component instance across
183    /// navigations instead of destroying and recreating it. Opt-in per route.
184    #[prost(bool, tag = "6")]
185    pub keep_alive: bool,
186    /// Cache tag templates for this route (e.g. "thread:{threadId}", "inbox").
187    /// Placeholders like {param} are resolved at render time with actual param values.
188    #[prost(string, repeated, tag = "7")]
189    pub cache_tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
190    /// Invalidation tag templates (e.g. "inbox", "thread:{threadId}").
191    /// After a mutation action on this route, these tags are auto-invalidated.
192    /// Supports {param} placeholders resolved at render time.
193    #[prost(string, repeated, tag = "8")]
194    pub invalidates: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
195    /// Component tag name for the pending/loading UI (e.g. "mail-skeleton").
196    /// Validated at build time — build fails if the component does not exist.
197    #[prost(string, tag = "9")]
198    pub pending_component: ::prost::alloc::string::String,
199    /// Component tag name for the error boundary UI (e.g. "error-page").
200    /// Validated at build time — build fails if the component does not exist.
201    #[prost(string, tag = "10")]
202    pub error_component: ::prost::alloc::string::String,
203}
204/// Outlet placeholder — marks where matched child route content renders.
205/// Components use this to indicate where nested route children are rendered.
206#[derive(serde::Serialize, serde::Deserialize)]
207#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
208pub struct WebUiFragmentOutlet {}
209/// Opaque plugin-specific data passed from parser plugin to handler plugin.
210/// WebUI framework does not interpret this data — it is a pass-through conduit.
211/// Each parser/handler plugin pair defines its own binary contract for the data field.
212#[derive(serde::Serialize, serde::Deserialize)]
213#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
214pub struct WebUiFragmentPlugin {
215    #[prost(bytes = "vec", tag = "1")]
216    pub data: ::prost::alloc::vec::Vec<u8>,
217}
218/// Static text or HTML content.
219#[derive(serde::Serialize, serde::Deserialize)]
220#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
221pub struct WebUiFragmentRaw {
222    #[prost(string, tag = "1")]
223    pub value: ::prost::alloc::string::String,
224}
225/// Reference to a reusable component fragment.
226#[derive(serde::Serialize, serde::Deserialize)]
227#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
228pub struct WebUiFragmentComponent {
229    #[prost(string, tag = "1")]
230    pub fragment_id: ::prost::alloc::string::String,
231}
232/// Loop directive iterating over a collection.
233#[derive(serde::Serialize, serde::Deserialize)]
234#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
235pub struct WebUiFragmentFor {
236    #[prost(string, tag = "1")]
237    pub item: ::prost::alloc::string::String,
238    #[prost(string, tag = "2")]
239    pub collection: ::prost::alloc::string::String,
240    #[prost(string, tag = "3")]
241    pub fragment_id: ::prost::alloc::string::String,
242}
243/// Dynamic data binding via signal.
244#[derive(serde::Serialize, serde::Deserialize)]
245#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
246pub struct WebUiFragmentSignal {
247    #[prost(string, tag = "1")]
248    pub value: ::prost::alloc::string::String,
249    #[prost(bool, tag = "2")]
250    pub raw: bool,
251}
252/// Conditional rendering fragment.
253#[derive(serde::Serialize, serde::Deserialize)]
254#[derive(Clone, PartialEq, ::prost::Message)]
255pub struct WebUiFragmentIf {
256    #[prost(message, optional, tag = "1")]
257    pub condition: ::core::option::Option<ConditionExpr>,
258    #[prost(string, tag = "2")]
259    pub fragment_id: ::prost::alloc::string::String,
260}
261/// Dynamic attribute binding.
262#[derive(serde::Serialize, serde::Deserialize)]
263#[derive(Clone, PartialEq, ::prost::Message)]
264pub struct WebUiFragmentAttribute {
265    #[prost(string, tag = "1")]
266    pub name: ::prost::alloc::string::String,
267    /// For simple dynamic attrs, the signal name.
268    #[prost(string, tag = "2")]
269    pub value: ::prost::alloc::string::String,
270    /// For mixed (template) attrs, the sub-stream ID.
271    #[prost(string, tag = "3")]
272    pub template: ::prost::alloc::string::String,
273    /// True for :-prefixed complex attributes.
274    #[prost(bool, tag = "4")]
275    pub complex: bool,
276    /// True for the first dynamic attribute on a component element.
277    #[prost(bool, tag = "5")]
278    pub attr_start: bool,
279    /// True for skipped attributes (class, style, role, data-*, aria-*).
280    #[prost(bool, tag = "6")]
281    pub attr_skip: bool,
282    /// True for static attribute values on components.
283    #[prost(bool, tag = "7")]
284    pub raw_value: bool,
285    /// For ?-prefixed boolean attributes, the condition tree.
286    #[prost(message, optional, tag = "8")]
287    pub condition_tree: ::core::option::Option<ConditionExpr>,
288}
289/// A condition expression tree.
290#[derive(serde::Serialize, serde::Deserialize)]
291#[derive(Clone, PartialEq, ::prost::Message)]
292pub struct ConditionExpr {
293    #[prost(oneof = "condition_expr::Expr", tags = "1, 2, 3, 4")]
294    pub expr: ::core::option::Option<condition_expr::Expr>,
295}
296/// Nested message and enum types in `ConditionExpr`.
297pub mod condition_expr {
298    #[derive(serde::Serialize, serde::Deserialize)]
299    #[derive(Clone, PartialEq, ::prost::Oneof)]
300    pub enum Expr {
301        #[prost(message, tag = "1")]
302        Predicate(super::Predicate),
303        #[prost(message, tag = "2")]
304        Not(::prost::alloc::boxed::Box<super::NotCondition>),
305        #[prost(message, tag = "3")]
306        Compound(::prost::alloc::boxed::Box<super::CompoundCondition>),
307        #[prost(message, tag = "4")]
308        Identifier(super::IdentifierCondition),
309    }
310}
311/// Simple comparison predicate.
312#[derive(serde::Serialize, serde::Deserialize)]
313#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
314pub struct Predicate {
315    #[prost(string, tag = "1")]
316    pub left: ::prost::alloc::string::String,
317    #[prost(enumeration = "ComparisonOperator", tag = "2")]
318    pub operator: i32,
319    #[prost(string, tag = "3")]
320    pub right: ::prost::alloc::string::String,
321}
322/// Negation wrapper.
323#[derive(serde::Serialize, serde::Deserialize)]
324#[derive(Clone, PartialEq, ::prost::Message)]
325pub struct NotCondition {
326    #[prost(message, optional, boxed, tag = "1")]
327    pub condition: ::core::option::Option<::prost::alloc::boxed::Box<ConditionExpr>>,
328}
329/// Two conditions joined by a logical operator.
330#[derive(serde::Serialize, serde::Deserialize)]
331#[derive(Clone, PartialEq, ::prost::Message)]
332pub struct CompoundCondition {
333    #[prost(message, optional, boxed, tag = "1")]
334    pub left: ::core::option::Option<::prost::alloc::boxed::Box<ConditionExpr>>,
335    #[prost(enumeration = "LogicalOperator", tag = "2")]
336    pub op: i32,
337    #[prost(message, optional, boxed, tag = "3")]
338    pub right: ::core::option::Option<::prost::alloc::boxed::Box<ConditionExpr>>,
339}
340/// Single identifier (variable name).
341#[derive(serde::Serialize, serde::Deserialize)]
342#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
343pub struct IdentifierCondition {
344    #[prost(string, tag = "1")]
345    pub value: ::prost::alloc::string::String,
346}
347/// Build-wide initial-state behavior.
348#[derive(serde::Serialize, serde::Deserialize)]
349#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
350#[repr(i32)]
351pub enum InitialStateStrategy {
352    /// Emit the complete state object. Used by default and non-WebUI plugins.
353    Full = 0,
354    /// Select state from reachable WebUI component surfaces.
355    Components = 1,
356}
357impl InitialStateStrategy {
358    /// String value of the enum field names used in the ProtoBuf definition.
359    ///
360    /// The values are not transformed in any way and thus are considered stable
361    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
362    pub fn as_str_name(&self) -> &'static str {
363        match self {
364            Self::Full => "INITIAL_STATE_STRATEGY_FULL",
365            Self::Components => "INITIAL_STATE_STRATEGY_COMPONENTS",
366        }
367    }
368    /// Creates an enum from field names used in the ProtoBuf definition.
369    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
370        match value {
371            "INITIAL_STATE_STRATEGY_FULL" => Some(Self::Full),
372            "INITIAL_STATE_STRATEGY_COMPONENTS" => Some(Self::Components),
373            _ => None,
374        }
375    }
376}
377/// Per-component state selection.
378#[derive(serde::Serialize, serde::Deserialize)]
379#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
380#[repr(i32)]
381pub enum StateProjectionMode {
382    /// The component is known not to consume state through this channel.
383    None = 0,
384    /// Select the component's explicit sorted key list.
385    Keys = 1,
386    /// The complete surface is unknown, so preserve correctness with full state.
387    All = 2,
388}
389impl StateProjectionMode {
390    /// String value of the enum field names used in the ProtoBuf definition.
391    ///
392    /// The values are not transformed in any way and thus are considered stable
393    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
394    pub fn as_str_name(&self) -> &'static str {
395        match self {
396            Self::None => "STATE_PROJECTION_MODE_NONE",
397            Self::Keys => "STATE_PROJECTION_MODE_KEYS",
398            Self::All => "STATE_PROJECTION_MODE_ALL",
399        }
400    }
401    /// Creates an enum from field names used in the ProtoBuf definition.
402    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
403        match value {
404            "STATE_PROJECTION_MODE_NONE" => Some(Self::None),
405            "STATE_PROJECTION_MODE_KEYS" => Some(Self::Keys),
406            "STATE_PROJECTION_MODE_ALL" => Some(Self::All),
407            _ => None,
408        }
409    }
410}
411/// CSS delivery strategy chosen at build time.
412#[derive(serde::Serialize, serde::Deserialize)]
413#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
414#[repr(i32)]
415pub enum CssStrategy {
416    Link = 0,
417    Style = 1,
418    Module = 2,
419}
420impl CssStrategy {
421    /// String value of the enum field names used in the ProtoBuf definition.
422    ///
423    /// The values are not transformed in any way and thus are considered stable
424    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
425    pub fn as_str_name(&self) -> &'static str {
426        match self {
427            Self::Link => "CSS_STRATEGY_LINK",
428            Self::Style => "CSS_STRATEGY_STYLE",
429            Self::Module => "CSS_STRATEGY_MODULE",
430        }
431    }
432    /// Creates an enum from field names used in the ProtoBuf definition.
433    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
434        match value {
435            "CSS_STRATEGY_LINK" => Some(Self::Link),
436            "CSS_STRATEGY_STYLE" => Some(Self::Style),
437            "CSS_STRATEGY_MODULE" => Some(Self::Module),
438            _ => None,
439        }
440    }
441}
442/// DOM encapsulation strategy chosen at build time.
443#[derive(serde::Serialize, serde::Deserialize)]
444#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
445#[repr(i32)]
446pub enum DomStrategy {
447    Shadow = 0,
448    Light = 1,
449}
450impl DomStrategy {
451    /// String value of the enum field names used in the ProtoBuf definition.
452    ///
453    /// The values are not transformed in any way and thus are considered stable
454    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
455    pub fn as_str_name(&self) -> &'static str {
456        match self {
457            Self::Shadow => "DOM_STRATEGY_SHADOW",
458            Self::Light => "DOM_STRATEGY_LIGHT",
459        }
460    }
461    /// Creates an enum from field names used in the ProtoBuf definition.
462    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
463        match value {
464            "DOM_STRATEGY_SHADOW" => Some(Self::Shadow),
465            "DOM_STRATEGY_LIGHT" => Some(Self::Light),
466            _ => None,
467        }
468    }
469}
470#[derive(serde::Serialize, serde::Deserialize)]
471#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
472#[repr(i32)]
473pub enum LogicalOperator {
474    Unspecified = 0,
475    And = 1,
476    Or = 2,
477}
478impl LogicalOperator {
479    /// String value of the enum field names used in the ProtoBuf definition.
480    ///
481    /// The values are not transformed in any way and thus are considered stable
482    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
483    pub fn as_str_name(&self) -> &'static str {
484        match self {
485            Self::Unspecified => "LOGICAL_OPERATOR_UNSPECIFIED",
486            Self::And => "AND",
487            Self::Or => "OR",
488        }
489    }
490    /// Creates an enum from field names used in the ProtoBuf definition.
491    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
492        match value {
493            "LOGICAL_OPERATOR_UNSPECIFIED" => Some(Self::Unspecified),
494            "AND" => Some(Self::And),
495            "OR" => Some(Self::Or),
496            _ => None,
497        }
498    }
499}
500#[derive(serde::Serialize, serde::Deserialize)]
501#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
502#[repr(i32)]
503pub enum ComparisonOperator {
504    Unspecified = 0,
505    GreaterThan = 1,
506    LessThan = 2,
507    Equal = 3,
508    NotEqual = 4,
509    GreaterThanOrEqual = 5,
510    LessThanOrEqual = 6,
511}
512impl ComparisonOperator {
513    /// String value of the enum field names used in the ProtoBuf definition.
514    ///
515    /// The values are not transformed in any way and thus are considered stable
516    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
517    pub fn as_str_name(&self) -> &'static str {
518        match self {
519            Self::Unspecified => "COMPARISON_OPERATOR_UNSPECIFIED",
520            Self::GreaterThan => "GREATER_THAN",
521            Self::LessThan => "LESS_THAN",
522            Self::Equal => "EQUAL",
523            Self::NotEqual => "NOT_EQUAL",
524            Self::GreaterThanOrEqual => "GREATER_THAN_OR_EQUAL",
525            Self::LessThanOrEqual => "LESS_THAN_OR_EQUAL",
526        }
527    }
528    /// Creates an enum from field names used in the ProtoBuf definition.
529    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
530        match value {
531            "COMPARISON_OPERATOR_UNSPECIFIED" => Some(Self::Unspecified),
532            "GREATER_THAN" => Some(Self::GreaterThan),
533            "LESS_THAN" => Some(Self::LessThan),
534            "EQUAL" => Some(Self::Equal),
535            "NOT_EQUAL" => Some(Self::NotEqual),
536            "GREATER_THAN_OR_EQUAL" => Some(Self::GreaterThanOrEqual),
537            "LESS_THAN_OR_EQUAL" => Some(Self::LessThanOrEqual),
538            _ => None,
539        }
540    }
541}