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, PartialEq, Eq, Hash, ::prost::Message)]
158pub struct RulesetsResponseDeletions {
159 #[prost(string, repeated, tag = "1")]
160 pub dynamic_configs: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
161 #[prost(string, repeated, tag = "2")]
162 pub feature_gates: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
163 #[prost(string, repeated, tag = "3")]
164 pub layer_configs: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
165 #[prost(string, repeated, tag = "4")]
166 pub experiment_to_layer: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
167 #[prost(string, repeated, tag = "5")]
168 pub condition_map: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
169 #[prost(string, repeated, tag = "6")]
170 pub sdk_configs: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
171 #[prost(string, repeated, tag = "7")]
172 pub param_stores: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
173 #[prost(string, repeated, tag = "8")]
174 pub cmab_configs: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
175 #[prost(string, repeated, tag = "9")]
176 pub override_rules: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
177 #[prost(string, repeated, tag = "10")]
178 pub overrides: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
179}
180#[derive(Clone, PartialEq, ::prost::Message)]
181pub struct RulesetsChecksums {
182 #[prost(map = "string, uint64", tag = "1")]
190 pub field_checksums: ::std::collections::HashMap<
191 ::prost::alloc::string::String,
192 u64,
193 >,
194}
195#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
196#[repr(i32)]
197pub enum SpecsEnvelopeKind {
198 Unknown = 0,
199 Done = 1,
200 TopLevel = 2,
202 FeatureGate = 3,
204 DynamicConfig = 4,
206 LayerConfig = 5,
208 ParamStore = 6,
210 Condition = 7,
212 Deletions = 8,
214 Checksums = 9,
216 CopyPrev = 10,
217}
218impl SpecsEnvelopeKind {
219 pub fn as_str_name(&self) -> &'static str {
224 match self {
225 Self::Unknown => "SPECS_ENVELOPE_KIND_UNKNOWN",
226 Self::Done => "SPECS_ENVELOPE_KIND_DONE",
227 Self::TopLevel => "SPECS_ENVELOPE_KIND_TOP_LEVEL",
228 Self::FeatureGate => "SPECS_ENVELOPE_KIND_FEATURE_GATE",
229 Self::DynamicConfig => "SPECS_ENVELOPE_KIND_DYNAMIC_CONFIG",
230 Self::LayerConfig => "SPECS_ENVELOPE_KIND_LAYER_CONFIG",
231 Self::ParamStore => "SPECS_ENVELOPE_KIND_PARAM_STORE",
232 Self::Condition => "SPECS_ENVELOPE_KIND_CONDITION",
233 Self::Deletions => "SPECS_ENVELOPE_KIND_DELETIONS",
234 Self::Checksums => "SPECS_ENVELOPE_KIND_CHECKSUMS",
235 Self::CopyPrev => "SPECS_ENVELOPE_KIND_COPY_PREV",
236 }
237 }
238 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
240 match value {
241 "SPECS_ENVELOPE_KIND_UNKNOWN" => Some(Self::Unknown),
242 "SPECS_ENVELOPE_KIND_DONE" => Some(Self::Done),
243 "SPECS_ENVELOPE_KIND_TOP_LEVEL" => Some(Self::TopLevel),
244 "SPECS_ENVELOPE_KIND_FEATURE_GATE" => Some(Self::FeatureGate),
245 "SPECS_ENVELOPE_KIND_DYNAMIC_CONFIG" => Some(Self::DynamicConfig),
246 "SPECS_ENVELOPE_KIND_LAYER_CONFIG" => Some(Self::LayerConfig),
247 "SPECS_ENVELOPE_KIND_PARAM_STORE" => Some(Self::ParamStore),
248 "SPECS_ENVELOPE_KIND_CONDITION" => Some(Self::Condition),
249 "SPECS_ENVELOPE_KIND_DELETIONS" => Some(Self::Deletions),
250 "SPECS_ENVELOPE_KIND_CHECKSUMS" => Some(Self::Checksums),
251 "SPECS_ENVELOPE_KIND_COPY_PREV" => Some(Self::CopyPrev),
252 _ => None,
253 }
254 }
255}
256#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
257#[repr(i32)]
258pub enum ConditionType {
259 Unknown = 0,
260 Public = 1,
261 FailGate = 2,
262 PassGate = 3,
263 UaBased = 4,
264 IpBased = 5,
265 UserField = 6,
266 EnvironmentField = 7,
267 CurrentTime = 8,
268 UserBucket = 9,
269 TargetApp = 10,
270 UnitId = 11,
271}
272impl ConditionType {
273 pub fn as_str_name(&self) -> &'static str {
278 match self {
279 Self::Unknown => "CONDITION_TYPE_UNKNOWN",
280 Self::Public => "CONDITION_TYPE_PUBLIC",
281 Self::FailGate => "CONDITION_TYPE_FAIL_GATE",
282 Self::PassGate => "CONDITION_TYPE_PASS_GATE",
283 Self::UaBased => "CONDITION_TYPE_UA_BASED",
284 Self::IpBased => "CONDITION_TYPE_IP_BASED",
285 Self::UserField => "CONDITION_TYPE_USER_FIELD",
286 Self::EnvironmentField => "CONDITION_TYPE_ENVIRONMENT_FIELD",
287 Self::CurrentTime => "CONDITION_TYPE_CURRENT_TIME",
288 Self::UserBucket => "CONDITION_TYPE_USER_BUCKET",
289 Self::TargetApp => "CONDITION_TYPE_TARGET_APP",
290 Self::UnitId => "CONDITION_TYPE_UNIT_ID",
291 }
292 }
293 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
295 match value {
296 "CONDITION_TYPE_UNKNOWN" => Some(Self::Unknown),
297 "CONDITION_TYPE_PUBLIC" => Some(Self::Public),
298 "CONDITION_TYPE_FAIL_GATE" => Some(Self::FailGate),
299 "CONDITION_TYPE_PASS_GATE" => Some(Self::PassGate),
300 "CONDITION_TYPE_UA_BASED" => Some(Self::UaBased),
301 "CONDITION_TYPE_IP_BASED" => Some(Self::IpBased),
302 "CONDITION_TYPE_USER_FIELD" => Some(Self::UserField),
303 "CONDITION_TYPE_ENVIRONMENT_FIELD" => Some(Self::EnvironmentField),
304 "CONDITION_TYPE_CURRENT_TIME" => Some(Self::CurrentTime),
305 "CONDITION_TYPE_USER_BUCKET" => Some(Self::UserBucket),
306 "CONDITION_TYPE_TARGET_APP" => Some(Self::TargetApp),
307 "CONDITION_TYPE_UNIT_ID" => Some(Self::UnitId),
308 _ => None,
309 }
310 }
311}
312#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
313#[repr(i32)]
314pub enum Operator {
315 Unknown = 0,
316 Gt = 1,
317 Gte = 2,
318 Lt = 3,
319 Lte = 4,
320 VersionGt = 5,
321 VersionGte = 6,
322 VersionLt = 7,
323 VersionLte = 8,
324 VersionEq = 9,
325 VersionNeq = 10,
326 Any = 11,
327 None = 12,
328 StrStartsWithAny = 13,
329 StrEndsWithAny = 14,
330 StrContainsAny = 15,
331 StrContainsNone = 16,
332 AnyCaseSensitive = 17,
333 NoneCaseSensitive = 18,
334 StrMatches = 19,
335 Before = 20,
336 After = 21,
337 On = 22,
338 Eq = 23,
339 Neq = 24,
340 InSegmentList = 25,
341 NotInSegmentList = 26,
342 ArrayContainsAny = 27,
343 ArrayContainsNone = 28,
344 ArrayContainsAll = 29,
345 NotArrayContainsAll = 30,
346 EncodedAny = 31,
347}
348impl Operator {
349 pub fn as_str_name(&self) -> &'static str {
354 match self {
355 Self::Unknown => "OPERATOR_UNKNOWN",
356 Self::Gt => "OPERATOR_GT",
357 Self::Gte => "OPERATOR_GTE",
358 Self::Lt => "OPERATOR_LT",
359 Self::Lte => "OPERATOR_LTE",
360 Self::VersionGt => "OPERATOR_VERSION_GT",
361 Self::VersionGte => "OPERATOR_VERSION_GTE",
362 Self::VersionLt => "OPERATOR_VERSION_LT",
363 Self::VersionLte => "OPERATOR_VERSION_LTE",
364 Self::VersionEq => "OPERATOR_VERSION_EQ",
365 Self::VersionNeq => "OPERATOR_VERSION_NEQ",
366 Self::Any => "OPERATOR_ANY",
367 Self::None => "OPERATOR_NONE",
368 Self::StrStartsWithAny => "OPERATOR_STR_STARTS_WITH_ANY",
369 Self::StrEndsWithAny => "OPERATOR_STR_ENDS_WITH_ANY",
370 Self::StrContainsAny => "OPERATOR_STR_CONTAINS_ANY",
371 Self::StrContainsNone => "OPERATOR_STR_CONTAINS_NONE",
372 Self::AnyCaseSensitive => "OPERATOR_ANY_CASE_SENSITIVE",
373 Self::NoneCaseSensitive => "OPERATOR_NONE_CASE_SENSITIVE",
374 Self::StrMatches => "OPERATOR_STR_MATCHES",
375 Self::Before => "OPERATOR_BEFORE",
376 Self::After => "OPERATOR_AFTER",
377 Self::On => "OPERATOR_ON",
378 Self::Eq => "OPERATOR_EQ",
379 Self::Neq => "OPERATOR_NEQ",
380 Self::InSegmentList => "OPERATOR_IN_SEGMENT_LIST",
381 Self::NotInSegmentList => "OPERATOR_NOT_IN_SEGMENT_LIST",
382 Self::ArrayContainsAny => "OPERATOR_ARRAY_CONTAINS_ANY",
383 Self::ArrayContainsNone => "OPERATOR_ARRAY_CONTAINS_NONE",
384 Self::ArrayContainsAll => "OPERATOR_ARRAY_CONTAINS_ALL",
385 Self::NotArrayContainsAll => "OPERATOR_NOT_ARRAY_CONTAINS_ALL",
386 Self::EncodedAny => "OPERATOR_ENCODED_ANY",
387 }
388 }
389 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
391 match value {
392 "OPERATOR_UNKNOWN" => Some(Self::Unknown),
393 "OPERATOR_GT" => Some(Self::Gt),
394 "OPERATOR_GTE" => Some(Self::Gte),
395 "OPERATOR_LT" => Some(Self::Lt),
396 "OPERATOR_LTE" => Some(Self::Lte),
397 "OPERATOR_VERSION_GT" => Some(Self::VersionGt),
398 "OPERATOR_VERSION_GTE" => Some(Self::VersionGte),
399 "OPERATOR_VERSION_LT" => Some(Self::VersionLt),
400 "OPERATOR_VERSION_LTE" => Some(Self::VersionLte),
401 "OPERATOR_VERSION_EQ" => Some(Self::VersionEq),
402 "OPERATOR_VERSION_NEQ" => Some(Self::VersionNeq),
403 "OPERATOR_ANY" => Some(Self::Any),
404 "OPERATOR_NONE" => Some(Self::None),
405 "OPERATOR_STR_STARTS_WITH_ANY" => Some(Self::StrStartsWithAny),
406 "OPERATOR_STR_ENDS_WITH_ANY" => Some(Self::StrEndsWithAny),
407 "OPERATOR_STR_CONTAINS_ANY" => Some(Self::StrContainsAny),
408 "OPERATOR_STR_CONTAINS_NONE" => Some(Self::StrContainsNone),
409 "OPERATOR_ANY_CASE_SENSITIVE" => Some(Self::AnyCaseSensitive),
410 "OPERATOR_NONE_CASE_SENSITIVE" => Some(Self::NoneCaseSensitive),
411 "OPERATOR_STR_MATCHES" => Some(Self::StrMatches),
412 "OPERATOR_BEFORE" => Some(Self::Before),
413 "OPERATOR_AFTER" => Some(Self::After),
414 "OPERATOR_ON" => Some(Self::On),
415 "OPERATOR_EQ" => Some(Self::Eq),
416 "OPERATOR_NEQ" => Some(Self::Neq),
417 "OPERATOR_IN_SEGMENT_LIST" => Some(Self::InSegmentList),
418 "OPERATOR_NOT_IN_SEGMENT_LIST" => Some(Self::NotInSegmentList),
419 "OPERATOR_ARRAY_CONTAINS_ANY" => Some(Self::ArrayContainsAny),
420 "OPERATOR_ARRAY_CONTAINS_NONE" => Some(Self::ArrayContainsNone),
421 "OPERATOR_ARRAY_CONTAINS_ALL" => Some(Self::ArrayContainsAll),
422 "OPERATOR_NOT_ARRAY_CONTAINS_ALL" => Some(Self::NotArrayContainsAll),
423 "OPERATOR_ENCODED_ANY" => Some(Self::EncodedAny),
424 _ => None,
425 }
426 }
427}
428#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
429#[repr(i32)]
430pub enum KnownIdType {
431 Unknown = 0,
432 UserId = 1,
433 StableId = 2,
434}
435impl KnownIdType {
436 pub fn as_str_name(&self) -> &'static str {
441 match self {
442 Self::Unknown => "KNOWN_ID_TYPE_UNKNOWN",
443 Self::UserId => "KNOWN_ID_TYPE_USER_ID",
444 Self::StableId => "KNOWN_ID_TYPE_STABLE_ID",
445 }
446 }
447 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
449 match value {
450 "KNOWN_ID_TYPE_UNKNOWN" => Some(Self::Unknown),
451 "KNOWN_ID_TYPE_USER_ID" => Some(Self::UserId),
452 "KNOWN_ID_TYPE_STABLE_ID" => Some(Self::StableId),
453 _ => None,
454 }
455 }
456}
457#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
458#[repr(i32)]
459pub enum EntityType {
460 EntityUnknown = 0,
461 EntityFeatureGate = 1,
462 EntityDynamicConfig = 2,
463 EntityAutotune = 3,
464 EntityExperiment = 4,
465 EntityLayer = 5,
466 EntitySegment = 6,
467 EntityHoldout = 7,
468}
469impl EntityType {
470 pub fn as_str_name(&self) -> &'static str {
475 match self {
476 Self::EntityUnknown => "ENTITY_UNKNOWN",
477 Self::EntityFeatureGate => "ENTITY_FEATURE_GATE",
478 Self::EntityDynamicConfig => "ENTITY_DYNAMIC_CONFIG",
479 Self::EntityAutotune => "ENTITY_AUTOTUNE",
480 Self::EntityExperiment => "ENTITY_EXPERIMENT",
481 Self::EntityLayer => "ENTITY_LAYER",
482 Self::EntitySegment => "ENTITY_SEGMENT",
483 Self::EntityHoldout => "ENTITY_HOLDOUT",
484 }
485 }
486 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
488 match value {
489 "ENTITY_UNKNOWN" => Some(Self::EntityUnknown),
490 "ENTITY_FEATURE_GATE" => Some(Self::EntityFeatureGate),
491 "ENTITY_DYNAMIC_CONFIG" => Some(Self::EntityDynamicConfig),
492 "ENTITY_AUTOTUNE" => Some(Self::EntityAutotune),
493 "ENTITY_EXPERIMENT" => Some(Self::EntityExperiment),
494 "ENTITY_LAYER" => Some(Self::EntityLayer),
495 "ENTITY_SEGMENT" => Some(Self::EntitySegment),
496 "ENTITY_HOLDOUT" => Some(Self::EntityHoldout),
497 _ => None,
498 }
499 }
500}