1#[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 #[prost(uint32, tag = "2")]
64 pub pass_percentage: u32,
65 #[prost(string, tag = "3")]
66 pub id: ::prost::alloc::string::String,
67 #[prost(string, optional, tag = "4")]
68 pub salt: ::core::option::Option<::prost::alloc::string::String>,
69 #[prost(string, repeated, tag = "5")]
70 pub conditions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
71 #[prost(message, optional, tag = "6")]
72 pub id_type: ::core::option::Option<IdType>,
73 #[prost(message, optional, tag = "7")]
74 pub return_value: ::core::option::Option<ReturnValue>,
75 #[prost(string, optional, tag = "8")]
76 pub group_name: ::core::option::Option<::prost::alloc::string::String>,
77 #[prost(string, optional, tag = "9")]
78 pub config_delegate: ::core::option::Option<::prost::alloc::string::String>,
79 #[prost(bool, optional, tag = "10")]
80 pub is_experiment_group: ::core::option::Option<bool>,
81 #[prost(bool, optional, tag = "11")]
82 pub is_control_group: ::core::option::Option<bool>,
83 #[prost(float, optional, tag = "12")]
84 pub sampling_rate: ::core::option::Option<f32>,
85}
86#[derive(Clone, PartialEq, ::prost::Message)]
87pub struct Condition {
88 #[prost(enumeration = "ConditionType", tag = "1")]
89 pub condition_type: i32,
90 #[prost(message, optional, tag = "2")]
91 pub id_type: ::core::option::Option<IdType>,
92 #[prost(message, optional, tag = "3")]
93 pub target_value: ::core::option::Option<AnyValue>,
94 #[prost(enumeration = "Operator", optional, tag = "4")]
95 pub operator: ::core::option::Option<i32>,
96 #[prost(string, optional, tag = "5")]
97 pub field: ::core::option::Option<::prost::alloc::string::String>,
98 #[prost(bytes = "vec", optional, tag = "6")]
99 pub additional_values: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
100}
101#[derive(Clone, PartialEq, ::prost::Message)]
102pub struct AnyValue {
103 #[prost(oneof = "any_value::Value", tags = "1, 2, 3, 4, 5, 6")]
104 pub value: ::core::option::Option<any_value::Value>,
105}
106pub mod any_value {
108 #[derive(Clone, PartialEq, ::prost::Oneof)]
109 pub enum Value {
110 #[prost(string, tag = "1")]
111 StringValue(::prost::alloc::string::String),
112 #[prost(bool, tag = "2")]
113 BoolValue(bool),
114 #[prost(int64, tag = "3")]
115 Int64Value(i64),
116 #[prost(uint64, tag = "4")]
117 Uint64Value(u64),
118 #[prost(double, tag = "5")]
119 DoubleValue(f64),
120 #[prost(bytes, tag = "6")]
121 RawValue(::prost::alloc::vec::Vec<u8>),
122 }
123}
124#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
125pub struct ReturnValue {
126 #[prost(oneof = "return_value::Value", tags = "1, 2")]
127 pub value: ::core::option::Option<return_value::Value>,
128}
129pub mod return_value {
131 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
132 pub enum Value {
133 #[prost(bool, tag = "1")]
134 BoolValue(bool),
135 #[prost(bytes, tag = "2")]
136 RawValue(::prost::alloc::vec::Vec<u8>),
137 }
138}
139#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
140pub struct IdType {
141 #[prost(oneof = "id_type::IdType", tags = "1, 2")]
142 pub id_type: ::core::option::Option<id_type::IdType>,
143}
144pub mod id_type {
146 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
147 pub enum IdType {
148 #[prost(enumeration = "super::KnownIdType", tag = "1")]
149 KnownIdType(i32),
150 #[prost(string, tag = "2")]
151 CustomIdType(::prost::alloc::string::String),
152 }
153}
154#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
155#[repr(i32)]
156pub enum SpecsEnvelopeKind {
157 Unknown = 0,
158 Done = 1,
159 TopLevel = 2,
161 FeatureGate = 3,
163 DynamicConfig = 4,
165 LayerConfig = 5,
167 ParamStore = 6,
169 Condition = 7,
171}
172impl SpecsEnvelopeKind {
173 pub fn as_str_name(&self) -> &'static str {
178 match self {
179 Self::Unknown => "SPECS_ENVELOPE_KIND_UNKNOWN",
180 Self::Done => "SPECS_ENVELOPE_KIND_DONE",
181 Self::TopLevel => "SPECS_ENVELOPE_KIND_TOP_LEVEL",
182 Self::FeatureGate => "SPECS_ENVELOPE_KIND_FEATURE_GATE",
183 Self::DynamicConfig => "SPECS_ENVELOPE_KIND_DYNAMIC_CONFIG",
184 Self::LayerConfig => "SPECS_ENVELOPE_KIND_LAYER_CONFIG",
185 Self::ParamStore => "SPECS_ENVELOPE_KIND_PARAM_STORE",
186 Self::Condition => "SPECS_ENVELOPE_KIND_CONDITION",
187 }
188 }
189 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
191 match value {
192 "SPECS_ENVELOPE_KIND_UNKNOWN" => Some(Self::Unknown),
193 "SPECS_ENVELOPE_KIND_DONE" => Some(Self::Done),
194 "SPECS_ENVELOPE_KIND_TOP_LEVEL" => Some(Self::TopLevel),
195 "SPECS_ENVELOPE_KIND_FEATURE_GATE" => Some(Self::FeatureGate),
196 "SPECS_ENVELOPE_KIND_DYNAMIC_CONFIG" => Some(Self::DynamicConfig),
197 "SPECS_ENVELOPE_KIND_LAYER_CONFIG" => Some(Self::LayerConfig),
198 "SPECS_ENVELOPE_KIND_PARAM_STORE" => Some(Self::ParamStore),
199 "SPECS_ENVELOPE_KIND_CONDITION" => Some(Self::Condition),
200 _ => None,
201 }
202 }
203}
204#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
205#[repr(i32)]
206pub enum ConditionType {
207 Unknown = 0,
208 Public = 1,
209 FailGate = 2,
210 PassGate = 3,
211 UaBased = 4,
212 IpBased = 5,
213 UserField = 6,
214 EnvironmentField = 7,
215 CurrentTime = 8,
216 UserBucket = 9,
217 TargetApp = 10,
218 UnitId = 11,
219}
220impl ConditionType {
221 pub fn as_str_name(&self) -> &'static str {
226 match self {
227 Self::Unknown => "CONDITION_TYPE_UNKNOWN",
228 Self::Public => "CONDITION_TYPE_PUBLIC",
229 Self::FailGate => "CONDITION_TYPE_FAIL_GATE",
230 Self::PassGate => "CONDITION_TYPE_PASS_GATE",
231 Self::UaBased => "CONDITION_TYPE_UA_BASED",
232 Self::IpBased => "CONDITION_TYPE_IP_BASED",
233 Self::UserField => "CONDITION_TYPE_USER_FIELD",
234 Self::EnvironmentField => "CONDITION_TYPE_ENVIRONMENT_FIELD",
235 Self::CurrentTime => "CONDITION_TYPE_CURRENT_TIME",
236 Self::UserBucket => "CONDITION_TYPE_USER_BUCKET",
237 Self::TargetApp => "CONDITION_TYPE_TARGET_APP",
238 Self::UnitId => "CONDITION_TYPE_UNIT_ID",
239 }
240 }
241 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
243 match value {
244 "CONDITION_TYPE_UNKNOWN" => Some(Self::Unknown),
245 "CONDITION_TYPE_PUBLIC" => Some(Self::Public),
246 "CONDITION_TYPE_FAIL_GATE" => Some(Self::FailGate),
247 "CONDITION_TYPE_PASS_GATE" => Some(Self::PassGate),
248 "CONDITION_TYPE_UA_BASED" => Some(Self::UaBased),
249 "CONDITION_TYPE_IP_BASED" => Some(Self::IpBased),
250 "CONDITION_TYPE_USER_FIELD" => Some(Self::UserField),
251 "CONDITION_TYPE_ENVIRONMENT_FIELD" => Some(Self::EnvironmentField),
252 "CONDITION_TYPE_CURRENT_TIME" => Some(Self::CurrentTime),
253 "CONDITION_TYPE_USER_BUCKET" => Some(Self::UserBucket),
254 "CONDITION_TYPE_TARGET_APP" => Some(Self::TargetApp),
255 "CONDITION_TYPE_UNIT_ID" => Some(Self::UnitId),
256 _ => None,
257 }
258 }
259}
260#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
261#[repr(i32)]
262pub enum Operator {
263 Unknown = 0,
264 Gt = 1,
265 Gte = 2,
266 Lt = 3,
267 Lte = 4,
268 VersionGt = 5,
269 VersionGte = 6,
270 VersionLt = 7,
271 VersionLte = 8,
272 VersionEq = 9,
273 VersionNeq = 10,
274 Any = 11,
275 None = 12,
276 StrStartsWithAny = 13,
277 StrEndsWithAny = 14,
278 StrContainsAny = 15,
279 StrContainsNone = 16,
280 AnyCaseSensitive = 17,
281 NoneCaseSensitive = 18,
282 StrMatches = 19,
283 Before = 20,
284 After = 21,
285 On = 22,
286 Eq = 23,
287 Neq = 24,
288 InSegmentList = 25,
289 NotInSegmentList = 26,
290 ArrayContainsAny = 27,
291 ArrayContainsNone = 28,
292 ArrayContainsAll = 29,
293 NotArrayContainsAll = 30,
294 EncodedAny = 31,
295}
296impl Operator {
297 pub fn as_str_name(&self) -> &'static str {
302 match self {
303 Self::Unknown => "OPERATOR_UNKNOWN",
304 Self::Gt => "OPERATOR_GT",
305 Self::Gte => "OPERATOR_GTE",
306 Self::Lt => "OPERATOR_LT",
307 Self::Lte => "OPERATOR_LTE",
308 Self::VersionGt => "OPERATOR_VERSION_GT",
309 Self::VersionGte => "OPERATOR_VERSION_GTE",
310 Self::VersionLt => "OPERATOR_VERSION_LT",
311 Self::VersionLte => "OPERATOR_VERSION_LTE",
312 Self::VersionEq => "OPERATOR_VERSION_EQ",
313 Self::VersionNeq => "OPERATOR_VERSION_NEQ",
314 Self::Any => "OPERATOR_ANY",
315 Self::None => "OPERATOR_NONE",
316 Self::StrStartsWithAny => "OPERATOR_STR_STARTS_WITH_ANY",
317 Self::StrEndsWithAny => "OPERATOR_STR_ENDS_WITH_ANY",
318 Self::StrContainsAny => "OPERATOR_STR_CONTAINS_ANY",
319 Self::StrContainsNone => "OPERATOR_STR_CONTAINS_NONE",
320 Self::AnyCaseSensitive => "OPERATOR_ANY_CASE_SENSITIVE",
321 Self::NoneCaseSensitive => "OPERATOR_NONE_CASE_SENSITIVE",
322 Self::StrMatches => "OPERATOR_STR_MATCHES",
323 Self::Before => "OPERATOR_BEFORE",
324 Self::After => "OPERATOR_AFTER",
325 Self::On => "OPERATOR_ON",
326 Self::Eq => "OPERATOR_EQ",
327 Self::Neq => "OPERATOR_NEQ",
328 Self::InSegmentList => "OPERATOR_IN_SEGMENT_LIST",
329 Self::NotInSegmentList => "OPERATOR_NOT_IN_SEGMENT_LIST",
330 Self::ArrayContainsAny => "OPERATOR_ARRAY_CONTAINS_ANY",
331 Self::ArrayContainsNone => "OPERATOR_ARRAY_CONTAINS_NONE",
332 Self::ArrayContainsAll => "OPERATOR_ARRAY_CONTAINS_ALL",
333 Self::NotArrayContainsAll => "OPERATOR_NOT_ARRAY_CONTAINS_ALL",
334 Self::EncodedAny => "OPERATOR_ENCODED_ANY",
335 }
336 }
337 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
339 match value {
340 "OPERATOR_UNKNOWN" => Some(Self::Unknown),
341 "OPERATOR_GT" => Some(Self::Gt),
342 "OPERATOR_GTE" => Some(Self::Gte),
343 "OPERATOR_LT" => Some(Self::Lt),
344 "OPERATOR_LTE" => Some(Self::Lte),
345 "OPERATOR_VERSION_GT" => Some(Self::VersionGt),
346 "OPERATOR_VERSION_GTE" => Some(Self::VersionGte),
347 "OPERATOR_VERSION_LT" => Some(Self::VersionLt),
348 "OPERATOR_VERSION_LTE" => Some(Self::VersionLte),
349 "OPERATOR_VERSION_EQ" => Some(Self::VersionEq),
350 "OPERATOR_VERSION_NEQ" => Some(Self::VersionNeq),
351 "OPERATOR_ANY" => Some(Self::Any),
352 "OPERATOR_NONE" => Some(Self::None),
353 "OPERATOR_STR_STARTS_WITH_ANY" => Some(Self::StrStartsWithAny),
354 "OPERATOR_STR_ENDS_WITH_ANY" => Some(Self::StrEndsWithAny),
355 "OPERATOR_STR_CONTAINS_ANY" => Some(Self::StrContainsAny),
356 "OPERATOR_STR_CONTAINS_NONE" => Some(Self::StrContainsNone),
357 "OPERATOR_ANY_CASE_SENSITIVE" => Some(Self::AnyCaseSensitive),
358 "OPERATOR_NONE_CASE_SENSITIVE" => Some(Self::NoneCaseSensitive),
359 "OPERATOR_STR_MATCHES" => Some(Self::StrMatches),
360 "OPERATOR_BEFORE" => Some(Self::Before),
361 "OPERATOR_AFTER" => Some(Self::After),
362 "OPERATOR_ON" => Some(Self::On),
363 "OPERATOR_EQ" => Some(Self::Eq),
364 "OPERATOR_NEQ" => Some(Self::Neq),
365 "OPERATOR_IN_SEGMENT_LIST" => Some(Self::InSegmentList),
366 "OPERATOR_NOT_IN_SEGMENT_LIST" => Some(Self::NotInSegmentList),
367 "OPERATOR_ARRAY_CONTAINS_ANY" => Some(Self::ArrayContainsAny),
368 "OPERATOR_ARRAY_CONTAINS_NONE" => Some(Self::ArrayContainsNone),
369 "OPERATOR_ARRAY_CONTAINS_ALL" => Some(Self::ArrayContainsAll),
370 "OPERATOR_NOT_ARRAY_CONTAINS_ALL" => Some(Self::NotArrayContainsAll),
371 "OPERATOR_ENCODED_ANY" => Some(Self::EncodedAny),
372 _ => None,
373 }
374 }
375}
376#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
377#[repr(i32)]
378pub enum KnownIdType {
379 Unknown = 0,
380 UserId = 1,
381 StableId = 2,
382}
383impl KnownIdType {
384 pub fn as_str_name(&self) -> &'static str {
389 match self {
390 Self::Unknown => "KNOWN_ID_TYPE_UNKNOWN",
391 Self::UserId => "KNOWN_ID_TYPE_USER_ID",
392 Self::StableId => "KNOWN_ID_TYPE_STABLE_ID",
393 }
394 }
395 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
397 match value {
398 "KNOWN_ID_TYPE_UNKNOWN" => Some(Self::Unknown),
399 "KNOWN_ID_TYPE_USER_ID" => Some(Self::UserId),
400 "KNOWN_ID_TYPE_STABLE_ID" => Some(Self::StableId),
401 _ => None,
402 }
403 }
404}
405#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
406#[repr(i32)]
407pub enum EntityType {
408 EntityUnknown = 0,
409 EntityFeatureGate = 1,
410 EntityDynamicConfig = 2,
411 EntityAutotune = 3,
412 EntityExperiment = 4,
413 EntityLayer = 5,
414 EntitySegment = 6,
415 EntityHoldout = 7,
416}
417impl EntityType {
418 pub fn as_str_name(&self) -> &'static str {
423 match self {
424 Self::EntityUnknown => "ENTITY_UNKNOWN",
425 Self::EntityFeatureGate => "ENTITY_FEATURE_GATE",
426 Self::EntityDynamicConfig => "ENTITY_DYNAMIC_CONFIG",
427 Self::EntityAutotune => "ENTITY_AUTOTUNE",
428 Self::EntityExperiment => "ENTITY_EXPERIMENT",
429 Self::EntityLayer => "ENTITY_LAYER",
430 Self::EntitySegment => "ENTITY_SEGMENT",
431 Self::EntityHoldout => "ENTITY_HOLDOUT",
432 }
433 }
434 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
436 match value {
437 "ENTITY_UNKNOWN" => Some(Self::EntityUnknown),
438 "ENTITY_FEATURE_GATE" => Some(Self::EntityFeatureGate),
439 "ENTITY_DYNAMIC_CONFIG" => Some(Self::EntityDynamicConfig),
440 "ENTITY_AUTOTUNE" => Some(Self::EntityAutotune),
441 "ENTITY_EXPERIMENT" => Some(Self::EntityExperiment),
442 "ENTITY_LAYER" => Some(Self::EntityLayer),
443 "ENTITY_SEGMENT" => Some(Self::EntitySegment),
444 "ENTITY_HOLDOUT" => Some(Self::EntityHoldout),
445 _ => None,
446 }
447 }
448}