Skip to main content

statsig_rust/specs_response/
statsig_config_specs.rs

1// This file is @generated by prost-build.
2#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3pub struct SpecsEnvelope {
4    #[prost(enumeration = "SpecsEnvelopeKind", tag = "1")]
5    pub kind: i32,
6    #[prost(string, tag = "2")]
7    pub name: ::prost::alloc::string::String,
8    #[prost(string, tag = "3")]
9    pub checksum: ::prost::alloc::string::String,
10    #[prost(bytes = "vec", optional, tag = "4")]
11    pub data: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
12}
13#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
14pub struct SpecsTopLevel {
15    #[prost(bool, tag = "1")]
16    pub has_updates: bool,
17    #[prost(uint64, tag = "2")]
18    pub time: u64,
19    #[prost(string, tag = "3")]
20    pub company_id: ::prost::alloc::string::String,
21    #[prost(string, tag = "4")]
22    pub response_format: ::prost::alloc::string::String,
23    #[prost(string, tag = "5")]
24    pub checksum: ::prost::alloc::string::String,
25    #[prost(bytes = "vec", tag = "7")]
26    pub rest: ::prost::alloc::vec::Vec<u8>,
27}
28#[derive(Clone, PartialEq, ::prost::Message)]
29pub struct Spec {
30    #[prost(string, tag = "1")]
31    pub salt: ::prost::alloc::string::String,
32    #[prost(bool, tag = "2")]
33    pub enabled: bool,
34    #[prost(message, optional, tag = "3")]
35    pub default_value: ::core::option::Option<ReturnValue>,
36    #[prost(enumeration = "EntityType", tag = "4")]
37    pub entity: i32,
38    #[prost(message, optional, tag = "5")]
39    pub id_type: ::core::option::Option<IdType>,
40    #[prost(uint32, tag = "6")]
41    pub version: u32,
42    #[prost(message, repeated, tag = "7")]
43    pub rules: ::prost::alloc::vec::Vec<Rule>,
44    #[prost(bool, optional, tag = "8")]
45    pub is_active: ::core::option::Option<bool>,
46    #[prost(string, repeated, tag = "9")]
47    pub explicit_parameters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
48    #[prost(bool, optional, tag = "10")]
49    pub has_shared_params: ::core::option::Option<bool>,
50    #[prost(string, repeated, tag = "11")]
51    pub target_app_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
52    #[prost(bool, optional, tag = "12")]
53    pub use_new_layer_eval: ::core::option::Option<bool>,
54    #[prost(bool, optional, tag = "13")]
55    pub forward_all_exposures: ::core::option::Option<bool>,
56    #[prost(string, repeated, tag = "14")]
57    pub fields_used: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
58}
59#[derive(Clone, PartialEq, ::prost::Message)]
60pub struct Rule {
61    #[prost(string, tag = "1")]
62    pub name: ::prost::alloc::string::String,
63    /// Legacy (See pass_percentage_float)
64    #[prost(uint32, tag = "2")]
65    pub pass_percentage: u32,
66    #[prost(string, tag = "3")]
67    pub id: ::prost::alloc::string::String,
68    #[prost(string, optional, tag = "4")]
69    pub salt: ::core::option::Option<::prost::alloc::string::String>,
70    #[prost(string, repeated, tag = "5")]
71    pub conditions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
72    #[prost(message, optional, tag = "6")]
73    pub id_type: ::core::option::Option<IdType>,
74    #[prost(message, optional, tag = "7")]
75    pub return_value: ::core::option::Option<ReturnValue>,
76    #[prost(string, optional, tag = "8")]
77    pub group_name: ::core::option::Option<::prost::alloc::string::String>,
78    #[prost(string, optional, tag = "9")]
79    pub config_delegate: ::core::option::Option<::prost::alloc::string::String>,
80    #[prost(bool, optional, tag = "10")]
81    pub is_experiment_group: ::core::option::Option<bool>,
82    #[prost(bool, optional, tag = "11")]
83    pub is_control_group: ::core::option::Option<bool>,
84    #[prost(float, optional, tag = "12")]
85    pub sampling_rate: ::core::option::Option<f32>,
86    #[prost(double, optional, tag = "13")]
87    pub pass_percentage_float: ::core::option::Option<f64>,
88}
89#[derive(Clone, PartialEq, ::prost::Message)]
90pub struct Condition {
91    #[prost(enumeration = "ConditionType", tag = "1")]
92    pub condition_type: i32,
93    #[prost(message, optional, tag = "2")]
94    pub id_type: ::core::option::Option<IdType>,
95    #[prost(message, optional, tag = "3")]
96    pub target_value: ::core::option::Option<AnyValue>,
97    #[prost(enumeration = "Operator", optional, tag = "4")]
98    pub operator: ::core::option::Option<i32>,
99    #[prost(string, optional, tag = "5")]
100    pub field: ::core::option::Option<::prost::alloc::string::String>,
101    #[prost(bytes = "vec", optional, tag = "6")]
102    pub additional_values: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
103}
104#[derive(Clone, PartialEq, ::prost::Message)]
105pub struct AnyValue {
106    #[prost(oneof = "any_value::Value", tags = "1, 2, 3, 4, 5, 6")]
107    pub value: ::core::option::Option<any_value::Value>,
108}
109/// Nested message and enum types in `AnyValue`.
110pub mod any_value {
111    #[derive(Clone, PartialEq, ::prost::Oneof)]
112    pub enum Value {
113        #[prost(string, tag = "1")]
114        StringValue(::prost::alloc::string::String),
115        #[prost(bool, tag = "2")]
116        BoolValue(bool),
117        #[prost(int64, tag = "3")]
118        Int64Value(i64),
119        #[prost(uint64, tag = "4")]
120        Uint64Value(u64),
121        #[prost(double, tag = "5")]
122        DoubleValue(f64),
123        #[prost(bytes, tag = "6")]
124        RawValue(::prost::alloc::vec::Vec<u8>),
125    }
126}
127#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
128pub struct ReturnValue {
129    #[prost(oneof = "return_value::Value", tags = "1, 2")]
130    pub value: ::core::option::Option<return_value::Value>,
131}
132/// Nested message and enum types in `ReturnValue`.
133pub mod return_value {
134    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
135    pub enum Value {
136        #[prost(bool, tag = "1")]
137        BoolValue(bool),
138        #[prost(bytes, tag = "2")]
139        RawValue(::prost::alloc::vec::Vec<u8>),
140    }
141}
142#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
143pub struct IdType {
144    #[prost(oneof = "id_type::IdType", tags = "1, 2")]
145    pub id_type: ::core::option::Option<id_type::IdType>,
146}
147/// Nested message and enum types in `IdType`.
148pub mod id_type {
149    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
150    pub enum IdType {
151        #[prost(enumeration = "super::KnownIdType", tag = "1")]
152        KnownIdType(i32),
153        #[prost(string, tag = "2")]
154        CustomIdType(::prost::alloc::string::String),
155    }
156}
157/// *
158///
159/// Key names to be deleted from the DCS' top-level fields.
160#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
161pub struct RulesetsResponseDeletions {
162    #[prost(string, repeated, tag = "1")]
163    pub dynamic_configs: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
164    #[prost(string, repeated, tag = "2")]
165    pub feature_gates: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
166    #[prost(string, repeated, tag = "3")]
167    pub layer_configs: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
168    #[prost(string, repeated, tag = "4")]
169    pub experiment_to_layer: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
170    #[prost(string, repeated, tag = "5")]
171    pub condition_map: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
172    #[prost(string, repeated, tag = "6")]
173    pub sdk_configs: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
174    #[prost(string, repeated, tag = "7")]
175    pub param_stores: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
176    #[prost(string, repeated, tag = "8")]
177    pub cmab_configs: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
178    #[prost(string, repeated, tag = "9")]
179    pub override_rules: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
180    #[prost(string, repeated, tag = "10")]
181    pub overrides: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
182}
183#[derive(Clone, PartialEq, ::prost::Message)]
184pub struct RulesetsChecksums {
185    /// Map of checksums, representing all of the entity checksums combined
186    /// e.g.
187    /// {
188    /// "dynamic_configs": 1234,
189    /// "layer_configs": 4567,
190    /// ...
191    /// }
192    #[prost(map = "string, uint64", tag = "1")]
193    pub field_checksums: ::std::collections::HashMap<
194        ::prost::alloc::string::String,
195        u64,
196    >,
197}
198#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
199#[repr(i32)]
200pub enum SpecsEnvelopeKind {
201    Unknown = 0,
202    Done = 1,
203    /// SpecsTopLevel
204    TopLevel = 2,
205    /// Spec
206    FeatureGate = 3,
207    /// Spec
208    DynamicConfig = 4,
209    /// Spec
210    LayerConfig = 5,
211    /// ParamStore
212    ParamStore = 6,
213    /// Condition
214    Condition = 7,
215    /// RulesetsResponseDeletions
216    Deletions = 8,
217    /// RulesetsChecksums
218    Checksums = 9,
219    CopyPrev = 10,
220}
221impl SpecsEnvelopeKind {
222    /// String value of the enum field names used in the ProtoBuf definition.
223    ///
224    /// The values are not transformed in any way and thus are considered stable
225    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
226    pub fn as_str_name(&self) -> &'static str {
227        match self {
228            Self::Unknown => "SPECS_ENVELOPE_KIND_UNKNOWN",
229            Self::Done => "SPECS_ENVELOPE_KIND_DONE",
230            Self::TopLevel => "SPECS_ENVELOPE_KIND_TOP_LEVEL",
231            Self::FeatureGate => "SPECS_ENVELOPE_KIND_FEATURE_GATE",
232            Self::DynamicConfig => "SPECS_ENVELOPE_KIND_DYNAMIC_CONFIG",
233            Self::LayerConfig => "SPECS_ENVELOPE_KIND_LAYER_CONFIG",
234            Self::ParamStore => "SPECS_ENVELOPE_KIND_PARAM_STORE",
235            Self::Condition => "SPECS_ENVELOPE_KIND_CONDITION",
236            Self::Deletions => "SPECS_ENVELOPE_KIND_DELETIONS",
237            Self::Checksums => "SPECS_ENVELOPE_KIND_CHECKSUMS",
238            Self::CopyPrev => "SPECS_ENVELOPE_KIND_COPY_PREV",
239        }
240    }
241    /// Creates an enum from field names used in the ProtoBuf definition.
242    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
243        match value {
244            "SPECS_ENVELOPE_KIND_UNKNOWN" => Some(Self::Unknown),
245            "SPECS_ENVELOPE_KIND_DONE" => Some(Self::Done),
246            "SPECS_ENVELOPE_KIND_TOP_LEVEL" => Some(Self::TopLevel),
247            "SPECS_ENVELOPE_KIND_FEATURE_GATE" => Some(Self::FeatureGate),
248            "SPECS_ENVELOPE_KIND_DYNAMIC_CONFIG" => Some(Self::DynamicConfig),
249            "SPECS_ENVELOPE_KIND_LAYER_CONFIG" => Some(Self::LayerConfig),
250            "SPECS_ENVELOPE_KIND_PARAM_STORE" => Some(Self::ParamStore),
251            "SPECS_ENVELOPE_KIND_CONDITION" => Some(Self::Condition),
252            "SPECS_ENVELOPE_KIND_DELETIONS" => Some(Self::Deletions),
253            "SPECS_ENVELOPE_KIND_CHECKSUMS" => Some(Self::Checksums),
254            "SPECS_ENVELOPE_KIND_COPY_PREV" => Some(Self::CopyPrev),
255            _ => None,
256        }
257    }
258}
259#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
260#[repr(i32)]
261pub enum ConditionType {
262    Unknown = 0,
263    Public = 1,
264    FailGate = 2,
265    PassGate = 3,
266    UaBased = 4,
267    IpBased = 5,
268    UserField = 6,
269    EnvironmentField = 7,
270    CurrentTime = 8,
271    UserBucket = 9,
272    TargetApp = 10,
273    UnitId = 11,
274}
275impl ConditionType {
276    /// String value of the enum field names used in the ProtoBuf definition.
277    ///
278    /// The values are not transformed in any way and thus are considered stable
279    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
280    pub fn as_str_name(&self) -> &'static str {
281        match self {
282            Self::Unknown => "CONDITION_TYPE_UNKNOWN",
283            Self::Public => "CONDITION_TYPE_PUBLIC",
284            Self::FailGate => "CONDITION_TYPE_FAIL_GATE",
285            Self::PassGate => "CONDITION_TYPE_PASS_GATE",
286            Self::UaBased => "CONDITION_TYPE_UA_BASED",
287            Self::IpBased => "CONDITION_TYPE_IP_BASED",
288            Self::UserField => "CONDITION_TYPE_USER_FIELD",
289            Self::EnvironmentField => "CONDITION_TYPE_ENVIRONMENT_FIELD",
290            Self::CurrentTime => "CONDITION_TYPE_CURRENT_TIME",
291            Self::UserBucket => "CONDITION_TYPE_USER_BUCKET",
292            Self::TargetApp => "CONDITION_TYPE_TARGET_APP",
293            Self::UnitId => "CONDITION_TYPE_UNIT_ID",
294        }
295    }
296    /// Creates an enum from field names used in the ProtoBuf definition.
297    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
298        match value {
299            "CONDITION_TYPE_UNKNOWN" => Some(Self::Unknown),
300            "CONDITION_TYPE_PUBLIC" => Some(Self::Public),
301            "CONDITION_TYPE_FAIL_GATE" => Some(Self::FailGate),
302            "CONDITION_TYPE_PASS_GATE" => Some(Self::PassGate),
303            "CONDITION_TYPE_UA_BASED" => Some(Self::UaBased),
304            "CONDITION_TYPE_IP_BASED" => Some(Self::IpBased),
305            "CONDITION_TYPE_USER_FIELD" => Some(Self::UserField),
306            "CONDITION_TYPE_ENVIRONMENT_FIELD" => Some(Self::EnvironmentField),
307            "CONDITION_TYPE_CURRENT_TIME" => Some(Self::CurrentTime),
308            "CONDITION_TYPE_USER_BUCKET" => Some(Self::UserBucket),
309            "CONDITION_TYPE_TARGET_APP" => Some(Self::TargetApp),
310            "CONDITION_TYPE_UNIT_ID" => Some(Self::UnitId),
311            _ => None,
312        }
313    }
314}
315#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
316#[repr(i32)]
317pub enum Operator {
318    Unknown = 0,
319    Gt = 1,
320    Gte = 2,
321    Lt = 3,
322    Lte = 4,
323    VersionGt = 5,
324    VersionGte = 6,
325    VersionLt = 7,
326    VersionLte = 8,
327    VersionEq = 9,
328    VersionNeq = 10,
329    Any = 11,
330    None = 12,
331    StrStartsWithAny = 13,
332    StrEndsWithAny = 14,
333    StrContainsAny = 15,
334    StrContainsNone = 16,
335    AnyCaseSensitive = 17,
336    NoneCaseSensitive = 18,
337    StrMatches = 19,
338    Before = 20,
339    After = 21,
340    On = 22,
341    Eq = 23,
342    Neq = 24,
343    InSegmentList = 25,
344    NotInSegmentList = 26,
345    ArrayContainsAny = 27,
346    ArrayContainsNone = 28,
347    ArrayContainsAll = 29,
348    NotArrayContainsAll = 30,
349    EncodedAny = 31,
350}
351impl Operator {
352    /// String value of the enum field names used in the ProtoBuf definition.
353    ///
354    /// The values are not transformed in any way and thus are considered stable
355    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
356    pub fn as_str_name(&self) -> &'static str {
357        match self {
358            Self::Unknown => "OPERATOR_UNKNOWN",
359            Self::Gt => "OPERATOR_GT",
360            Self::Gte => "OPERATOR_GTE",
361            Self::Lt => "OPERATOR_LT",
362            Self::Lte => "OPERATOR_LTE",
363            Self::VersionGt => "OPERATOR_VERSION_GT",
364            Self::VersionGte => "OPERATOR_VERSION_GTE",
365            Self::VersionLt => "OPERATOR_VERSION_LT",
366            Self::VersionLte => "OPERATOR_VERSION_LTE",
367            Self::VersionEq => "OPERATOR_VERSION_EQ",
368            Self::VersionNeq => "OPERATOR_VERSION_NEQ",
369            Self::Any => "OPERATOR_ANY",
370            Self::None => "OPERATOR_NONE",
371            Self::StrStartsWithAny => "OPERATOR_STR_STARTS_WITH_ANY",
372            Self::StrEndsWithAny => "OPERATOR_STR_ENDS_WITH_ANY",
373            Self::StrContainsAny => "OPERATOR_STR_CONTAINS_ANY",
374            Self::StrContainsNone => "OPERATOR_STR_CONTAINS_NONE",
375            Self::AnyCaseSensitive => "OPERATOR_ANY_CASE_SENSITIVE",
376            Self::NoneCaseSensitive => "OPERATOR_NONE_CASE_SENSITIVE",
377            Self::StrMatches => "OPERATOR_STR_MATCHES",
378            Self::Before => "OPERATOR_BEFORE",
379            Self::After => "OPERATOR_AFTER",
380            Self::On => "OPERATOR_ON",
381            Self::Eq => "OPERATOR_EQ",
382            Self::Neq => "OPERATOR_NEQ",
383            Self::InSegmentList => "OPERATOR_IN_SEGMENT_LIST",
384            Self::NotInSegmentList => "OPERATOR_NOT_IN_SEGMENT_LIST",
385            Self::ArrayContainsAny => "OPERATOR_ARRAY_CONTAINS_ANY",
386            Self::ArrayContainsNone => "OPERATOR_ARRAY_CONTAINS_NONE",
387            Self::ArrayContainsAll => "OPERATOR_ARRAY_CONTAINS_ALL",
388            Self::NotArrayContainsAll => "OPERATOR_NOT_ARRAY_CONTAINS_ALL",
389            Self::EncodedAny => "OPERATOR_ENCODED_ANY",
390        }
391    }
392    /// Creates an enum from field names used in the ProtoBuf definition.
393    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
394        match value {
395            "OPERATOR_UNKNOWN" => Some(Self::Unknown),
396            "OPERATOR_GT" => Some(Self::Gt),
397            "OPERATOR_GTE" => Some(Self::Gte),
398            "OPERATOR_LT" => Some(Self::Lt),
399            "OPERATOR_LTE" => Some(Self::Lte),
400            "OPERATOR_VERSION_GT" => Some(Self::VersionGt),
401            "OPERATOR_VERSION_GTE" => Some(Self::VersionGte),
402            "OPERATOR_VERSION_LT" => Some(Self::VersionLt),
403            "OPERATOR_VERSION_LTE" => Some(Self::VersionLte),
404            "OPERATOR_VERSION_EQ" => Some(Self::VersionEq),
405            "OPERATOR_VERSION_NEQ" => Some(Self::VersionNeq),
406            "OPERATOR_ANY" => Some(Self::Any),
407            "OPERATOR_NONE" => Some(Self::None),
408            "OPERATOR_STR_STARTS_WITH_ANY" => Some(Self::StrStartsWithAny),
409            "OPERATOR_STR_ENDS_WITH_ANY" => Some(Self::StrEndsWithAny),
410            "OPERATOR_STR_CONTAINS_ANY" => Some(Self::StrContainsAny),
411            "OPERATOR_STR_CONTAINS_NONE" => Some(Self::StrContainsNone),
412            "OPERATOR_ANY_CASE_SENSITIVE" => Some(Self::AnyCaseSensitive),
413            "OPERATOR_NONE_CASE_SENSITIVE" => Some(Self::NoneCaseSensitive),
414            "OPERATOR_STR_MATCHES" => Some(Self::StrMatches),
415            "OPERATOR_BEFORE" => Some(Self::Before),
416            "OPERATOR_AFTER" => Some(Self::After),
417            "OPERATOR_ON" => Some(Self::On),
418            "OPERATOR_EQ" => Some(Self::Eq),
419            "OPERATOR_NEQ" => Some(Self::Neq),
420            "OPERATOR_IN_SEGMENT_LIST" => Some(Self::InSegmentList),
421            "OPERATOR_NOT_IN_SEGMENT_LIST" => Some(Self::NotInSegmentList),
422            "OPERATOR_ARRAY_CONTAINS_ANY" => Some(Self::ArrayContainsAny),
423            "OPERATOR_ARRAY_CONTAINS_NONE" => Some(Self::ArrayContainsNone),
424            "OPERATOR_ARRAY_CONTAINS_ALL" => Some(Self::ArrayContainsAll),
425            "OPERATOR_NOT_ARRAY_CONTAINS_ALL" => Some(Self::NotArrayContainsAll),
426            "OPERATOR_ENCODED_ANY" => Some(Self::EncodedAny),
427            _ => None,
428        }
429    }
430}
431#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
432#[repr(i32)]
433pub enum KnownIdType {
434    Unknown = 0,
435    UserId = 1,
436    StableId = 2,
437}
438impl KnownIdType {
439    /// String value of the enum field names used in the ProtoBuf definition.
440    ///
441    /// The values are not transformed in any way and thus are considered stable
442    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
443    pub fn as_str_name(&self) -> &'static str {
444        match self {
445            Self::Unknown => "KNOWN_ID_TYPE_UNKNOWN",
446            Self::UserId => "KNOWN_ID_TYPE_USER_ID",
447            Self::StableId => "KNOWN_ID_TYPE_STABLE_ID",
448        }
449    }
450    /// Creates an enum from field names used in the ProtoBuf definition.
451    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
452        match value {
453            "KNOWN_ID_TYPE_UNKNOWN" => Some(Self::Unknown),
454            "KNOWN_ID_TYPE_USER_ID" => Some(Self::UserId),
455            "KNOWN_ID_TYPE_STABLE_ID" => Some(Self::StableId),
456            _ => None,
457        }
458    }
459}
460#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
461#[repr(i32)]
462pub enum EntityType {
463    EntityUnknown = 0,
464    EntityFeatureGate = 1,
465    EntityDynamicConfig = 2,
466    EntityAutotune = 3,
467    EntityExperiment = 4,
468    EntityLayer = 5,
469    EntitySegment = 6,
470    EntityHoldout = 7,
471}
472impl EntityType {
473    /// String value of the enum field names used in the ProtoBuf definition.
474    ///
475    /// The values are not transformed in any way and thus are considered stable
476    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
477    pub fn as_str_name(&self) -> &'static str {
478        match self {
479            Self::EntityUnknown => "ENTITY_UNKNOWN",
480            Self::EntityFeatureGate => "ENTITY_FEATURE_GATE",
481            Self::EntityDynamicConfig => "ENTITY_DYNAMIC_CONFIG",
482            Self::EntityAutotune => "ENTITY_AUTOTUNE",
483            Self::EntityExperiment => "ENTITY_EXPERIMENT",
484            Self::EntityLayer => "ENTITY_LAYER",
485            Self::EntitySegment => "ENTITY_SEGMENT",
486            Self::EntityHoldout => "ENTITY_HOLDOUT",
487        }
488    }
489    /// Creates an enum from field names used in the ProtoBuf definition.
490    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
491        match value {
492            "ENTITY_UNKNOWN" => Some(Self::EntityUnknown),
493            "ENTITY_FEATURE_GATE" => Some(Self::EntityFeatureGate),
494            "ENTITY_DYNAMIC_CONFIG" => Some(Self::EntityDynamicConfig),
495            "ENTITY_AUTOTUNE" => Some(Self::EntityAutotune),
496            "ENTITY_EXPERIMENT" => Some(Self::EntityExperiment),
497            "ENTITY_LAYER" => Some(Self::EntityLayer),
498            "ENTITY_SEGMENT" => Some(Self::EntitySegment),
499            "ENTITY_HOLDOUT" => Some(Self::EntityHoldout),
500            _ => None,
501        }
502    }
503}