From 1b13415125f0f0a2977a2dbd5b80b9c350ae1903 Mon Sep 17 00:00:00 2001 From: Snow Pettersen Date: Mon, 1 Dec 2025 14:02:54 -0800 Subject: [PATCH 1/5] bring in shared-core changes --- api | 2 +- bd-log-matcher/src/builder.rs | 22 +- bd-log-matcher/src/matcher.rs | 109 +- bd-log-matcher/src/matcher_test.rs | 322 +++- bd-log-matcher/src/version.rs | 2 +- bd-proto/build.rs | 22 +- bd-proto/src/protos/bdtail/bdtail_config.rs | 6 +- bd-proto/src/protos/client/api.rs | 30 +- bd-proto/src/protos/client/artifact.rs | 10 +- bd-proto/src/protos/filter/filter.rs | 6 +- .../src/protos/log_matcher/log_matcher.rs | 1708 ++--------------- bd-proto/src/protos/log_matcher/mod.rs | 2 + bd-proto/src/protos/mod.rs | 1 + bd-proto/src/protos/state/matcher.rs | 493 +++++ bd-proto/src/protos/state/mod.rs | 5 + bd-proto/src/protos/state/payload.rs | 148 +- bd-proto/src/protos/state/scope.rs | 134 ++ bd-proto/src/protos/value_matcher/mod.rs | 3 + .../src/protos/value_matcher/value_matcher.rs | 1262 ++++++++++++ bd-proto/src/protos/workflow/mod.rs | 1 + bd-proto/src/protos/workflow/workflow.rs | 549 ++++-- bd-test-helpers/src/workflow/mod.rs | 12 +- bd-workflows/src/config.rs | 3 + 23 files changed, 2919 insertions(+), 1933 deletions(-) create mode 100644 bd-proto/src/protos/state/matcher.rs create mode 100644 bd-proto/src/protos/state/scope.rs create mode 100644 bd-proto/src/protos/value_matcher/mod.rs create mode 100644 bd-proto/src/protos/value_matcher/value_matcher.rs diff --git a/api b/api index 53334bc3b..f0ef57644 160000 --- a/api +++ b/api @@ -1 +1 @@ -Subproject commit 53334bc3b224c81d1e39bcb5c1dfced7a5302a4a +Subproject commit f0ef576445f8985c8928f2c58324d5461fda4f76 diff --git a/bd-log-matcher/src/builder.rs b/bd-log-matcher/src/builder.rs index cbe498392..1b84cc1bf 100644 --- a/bd-log-matcher/src/builder.rs +++ b/bd-log-matcher/src/builder.rs @@ -21,9 +21,7 @@ //! ]); //! ``` -use base_log_matcher::int_value_match::Int_value_match_type; -use base_log_matcher::string_value_match::String_value_match_type; -use base_log_matcher::{IsSetMatch, Operator, tag_match}; +use base_log_matcher::tag_match; use bd_proto::protos::log_matcher::log_matcher::LogMatcher; use bd_proto::protos::log_matcher::log_matcher::log_matcher::{ BaseLogMatcher, @@ -32,8 +30,12 @@ use bd_proto::protos::log_matcher::log_matcher::log_matcher::{ base_log_matcher, }; use bd_proto::protos::logging::payload::LogType; +use bd_proto::protos::value_matcher::value_matcher; use tag_match::Value_match; use tag_match::Value_match::IntValueMatch; +use value_matcher::int_value_match::Int_value_match_type; +use value_matcher::string_value_match::String_value_match_type; +use value_matcher::{IsSetMatch, Operator}; /// Creates a matcher that matches if all of the provided matchers match (logical AND). /// @@ -199,7 +201,7 @@ pub fn log_level_equals(level: i32) -> LogMatcher { matcher: Some(Matcher::BaseMatcher(BaseLogMatcher { match_type: Some(TagMatch(base_log_matcher::TagMatch { tag_key: "log_level".to_string(), - value_match: Some(IntValueMatch(base_log_matcher::IntValueMatch { + value_match: Some(IntValueMatch(value_matcher::IntValueMatch { operator: Operator::OPERATOR_EQUALS.into(), int_value_match_type: Some(Int_value_match_type::MatchValue(level)), ..Default::default() @@ -227,7 +229,7 @@ pub fn log_type_equals(log_type: LogType) -> LogMatcher { matcher: Some(Matcher::BaseMatcher(BaseLogMatcher { match_type: Some(TagMatch(base_log_matcher::TagMatch { tag_key: "log_type".to_string(), - value_match: Some(IntValueMatch(base_log_matcher::IntValueMatch { + value_match: Some(IntValueMatch(value_matcher::IntValueMatch { operator: Operator::OPERATOR_EQUALS.into(), int_value_match_type: Some(Int_value_match_type::MatchValue(log_type as i32)), ..Default::default() @@ -276,7 +278,7 @@ fn log_field_matcher(field: &str, value: &str, operator: Operator) -> LogMatcher match_type: Some(TagMatch(base_log_matcher::TagMatch { tag_key: field.to_string(), value_match: Some(Value_match::StringValueMatch( - base_log_matcher::StringValueMatch { + value_matcher::StringValueMatch { operator: operator.into(), string_value_match_type: Some(String_value_match_type::MatchValue(value.to_string())), ..Default::default() @@ -293,9 +295,9 @@ fn log_field_matcher(field: &str, value: &str, operator: Operator) -> LogMatcher /// Creates a log field matcher that matches when a field is equal to the provided double value. #[must_use] fn log_field_double_matcher(key: &str, value: f64, operator: Operator) -> LogMatcher { - use base_log_matcher::DoubleValueMatch; use base_log_matcher::Match_type::TagMatch; - use base_log_matcher::double_value_match::Double_value_match_type; + use value_matcher::DoubleValueMatch; + use value_matcher::double_value_match::Double_value_match_type; LogMatcher { matcher: Some(Matcher::BaseMatcher(BaseLogMatcher { @@ -322,7 +324,7 @@ fn make_log_message_matcher(value: &str, operator: Operator) -> LogMatcher { matcher: Some(Matcher::BaseMatcher(BaseLogMatcher { match_type: Some(MessageMatch(base_log_matcher::MessageMatch { string_value_match: protobuf::MessageField::from_option(Some( - base_log_matcher::StringValueMatch { + value_matcher::StringValueMatch { operator: operator.into(), string_value_match_type: Some(String_value_match_type::MatchValue(value.to_string())), ..Default::default() @@ -345,7 +347,7 @@ fn make_log_tag_matcher(name: &str, value: &str) -> LogMatcher { match_type: Some(TagMatch(base_log_matcher::TagMatch { tag_key: name.to_string(), value_match: Some(Value_match::StringValueMatch( - base_log_matcher::StringValueMatch { + value_matcher::StringValueMatch { operator: Operator::OPERATOR_EQUALS.into(), string_value_match_type: Some(String_value_match_type::MatchValue(value.to_string())), ..Default::default() diff --git a/bd-log-matcher/src/matcher.rs b/bd-log-matcher/src/matcher.rs index 6bf7a0567..270a002d7 100644 --- a/bd-log-matcher/src/matcher.rs +++ b/bd-log-matcher/src/matcher.rs @@ -15,8 +15,7 @@ mod legacy_matcher_test; use crate::version; use anyhow::{Result, anyhow}; -use base_log_matcher::Match_type::{FeatureFlagMatch, MessageMatch, TagMatch}; -use base_log_matcher::Operator; +use base_log_matcher::Match_type::{MessageMatch, StateMatch, TagMatch}; use base_log_matcher::tag_match::Value_match::{ DoubleValueMatch, IntValueMatch, @@ -24,6 +23,7 @@ use base_log_matcher::tag_match::Value_match::{ SemVerValueMatch, StringValueMatch, }; +use bd_proto::protos::value_matcher::value_matcher::Operator; use bd_log_primitives::tiny_set::TinyMap; use bd_log_primitives::{FieldsRef, LogLevel, LogMessage}; use bd_proto::protos::config::v1::config::log_matcher::base_log_matcher::StringMatchType; @@ -37,14 +37,14 @@ use bd_proto::protos::config::v1::config::{ }; use bd_proto::protos::log_matcher::log_matcher; use bd_proto::protos::logging::payload::LogType; -use log_matcher::LogMatcher; -use log_matcher::log_matcher::base_log_matcher::double_value_match::Double_value_match_type; -use log_matcher::log_matcher::base_log_matcher::int_value_match::Int_value_match_type; -use log_matcher::log_matcher::base_log_matcher::string_value_match::String_value_match_type; -use log_matcher::log_matcher::base_log_matcher::{ +use bd_proto::protos::value_matcher::value_matcher::double_value_match::Double_value_match_type; +use bd_proto::protos::value_matcher::value_matcher::int_value_match::Int_value_match_type; +use bd_proto::protos::value_matcher::value_matcher::string_value_match::String_value_match_type; +use bd_proto::protos::value_matcher::value_matcher::{ IntValueMatch as IntValueMatch_type, StringValueMatch as StringValueMatch_type, }; +use log_matcher::LogMatcher; use log_matcher::log_matcher::{BaseLogMatcher, Matcher, base_log_matcher}; use regex::Regex; use std::borrow::Cow; @@ -598,26 +598,81 @@ impl Leaf { transform_string_value_match(&message_match.string_value_match), )?, ), - FeatureFlagMatch(feature_flag_match) => match feature_flag_match - .value_match - .as_ref() - .ok_or_else(|| anyhow!("missing feature_flag_match value_match"))? - { - base_log_matcher::feature_flag_match::Value_match::StringValueMatch( - string_value_match, - ) => Self::StringValue( - InputType::FeatureFlag(feature_flag_match.flag_name.clone()), - StringMatch::new( - string_value_match - .operator - .enum_value() - .map_err(|_| anyhow!("unknown field or enum"))?, - transform_string_value_match(string_value_match), - )?, - ), - base_log_matcher::feature_flag_match::Value_match::IsSetMatch(_) => { - Self::IsSetValue(InputType::FeatureFlag(feature_flag_match.flag_name.clone())) - }, + StateMatch(state_match) => { + // Get the state key from the match + let state_key = state_match.state_key.clone(); + + // Handle state match based on the scope + let input_type = match state_match.scope.enum_value_or_default() { + bd_proto::protos::state::scope::StateScope::FEATURE_FLAG => { + InputType::FeatureFlag(state_key) + }, + _ => { + // For now, we only support feature flags. Other scopes would need additional handling. + return Err(anyhow!("Unsupported state scope")); + }, + }; + + // Handle the value match + match state_match + .state_value_match + .as_ref() + .ok_or_else(|| anyhow!("missing state_value_match"))? + .value_match + .as_ref() + .ok_or_else(|| anyhow!("missing state value_match"))? + { + bd_proto::protos::state::matcher::state_value_match::Value_match::StringValueMatch( + string_value_match, + ) => Self::StringValue( + input_type, + StringMatch::new( + string_value_match + .operator + .enum_value() + .map_err(|_| anyhow!("unknown field or enum"))?, + transform_string_value_match(string_value_match), + )?, + ), + bd_proto::protos::state::matcher::state_value_match::Value_match::IsSetMatch(_) => { + Self::IsSetValue(input_type) + }, + bd_proto::protos::state::matcher::state_value_match::Value_match::IntValueMatch( + int_value_match, + ) => Self::IntValue( + input_type, + IntMatch::new( + int_value_match + .operator + .enum_value() + .map_err(|_| anyhow!("unknown field or enum"))?, + transform_int_value_match(int_value_match), + )?, + ), + bd_proto::protos::state::matcher::state_value_match::Value_match::DoubleValueMatch( + double_value_match, + ) => Self::DoubleValue( + input_type, + DoubleMatch::new( + double_value_match + .operator + .enum_value() + .map_err(|_| anyhow!("unknown field or enum"))?, + match double_value_match + .double_value_match_type + .as_ref() + .unwrap_or(&Double_value_match_type::MatchValue(0.0)) + { + Double_value_match_type::MatchValue(d) => { + ValueOrSavedFieldId::Value(NanEqualFloat(*d)) + }, + Double_value_match_type::SaveFieldId(s) => { + ValueOrSavedFieldId::SaveFieldId(s.clone()) + }, + }, + )?, + ), + } }, TagMatch(tag_match) => match tag_match .value_match diff --git a/bd-log-matcher/src/matcher_test.rs b/bd-log-matcher/src/matcher_test.rs index 5fea4c262..24131400d 100644 --- a/bd-log-matcher/src/matcher_test.rs +++ b/bd-log-matcher/src/matcher_test.rs @@ -20,15 +20,16 @@ use bd_log_primitives::{ TypedLogLevel, log_level, }; -use bd_proto::protos::log_matcher::log_matcher::log_matcher::base_log_matcher::feature_flag_match; use bd_proto::protos::log_matcher::log_matcher::{LogMatcher, log_matcher}; use bd_proto::protos::logging::payload::LogType; +use bd_proto::protos::state::matcher::state_value_match; +use bd_proto::protos::state::scope::StateScope; +use bd_proto::protos::value_matcher::value_matcher::double_value_match::Double_value_match_type; +use bd_proto::protos::value_matcher::value_matcher::int_value_match::Int_value_match_type; +use bd_proto::protos::value_matcher::value_matcher::string_value_match::String_value_match_type; +use bd_proto::protos::value_matcher::value_matcher::Operator; use bd_state::StateReader; -use log_matcher::base_log_matcher::Match_type::{MessageMatch, TagMatch}; -use log_matcher::base_log_matcher::Operator; -use log_matcher::base_log_matcher::double_value_match::Double_value_match_type; -use log_matcher::base_log_matcher::int_value_match::Int_value_match_type; -use log_matcher::base_log_matcher::string_value_match::String_value_match_type; +use log_matcher::base_log_matcher::Match_type::{MessageMatch, StateMatch, TagMatch}; use log_matcher::base_log_matcher::tag_match::Value_match::{ IntValueMatch, IsSetMatch, @@ -213,11 +214,13 @@ fn test_message_string_invalid_regex_config() { fn test_extracted_string_matcher() { let config = simple_log_matcher(TagMatch(base_log_matcher::TagMatch { tag_key: "key".to_string(), - value_match: Some(StringValueMatch(base_log_matcher::StringValueMatch { - operator: Operator::OPERATOR_EQUALS.into(), - string_value_match_type: Some(String_value_match_type::SaveFieldId("id1".to_string())), - ..Default::default() - })), + value_match: Some(StringValueMatch( + bd_proto::protos::value_matcher::value_matcher::StringValueMatch { + operator: Operator::OPERATOR_EQUALS.into(), + string_value_match_type: Some(String_value_match_type::SaveFieldId("id1".to_string())), + ..Default::default() + }, + )), ..Default::default() })); @@ -277,7 +280,7 @@ fn test_tag_binary_string_eq_matcher() { fn test_extracted_double_matcher() { let config = simple_log_matcher(TagMatch(base_log_matcher::TagMatch { tag_key: "key".to_string(), - value_match: Some(DoubleValueMatch(base_log_matcher::DoubleValueMatch { + value_match: Some(DoubleValueMatch(bd_proto::protos::value_matcher::value_matcher::DoubleValueMatch { operator: Operator::OPERATOR_EQUALS.into(), double_value_match_type: Some(Double_value_match_type::SaveFieldId("id1".to_string())), ..Default::default() @@ -316,7 +319,7 @@ fn test_tag_double_matcher() { fn make_config(match_value: f64, operator: Operator) -> LogMatcher { simple_log_matcher(TagMatch(base_log_matcher::TagMatch { tag_key: "key".to_string(), - value_match: Some(DoubleValueMatch(base_log_matcher::DoubleValueMatch { + value_match: Some(DoubleValueMatch(bd_proto::protos::value_matcher::value_matcher::DoubleValueMatch { operator: operator.into(), double_value_match_type: Some(Double_value_match_type::MatchValue(match_value)), ..Default::default() @@ -390,7 +393,7 @@ fn test_tag_double_matcher() { fn test_extracted_int_matcher() { let config = simple_log_matcher(TagMatch(base_log_matcher::TagMatch { tag_key: "key".to_string(), - value_match: Some(IntValueMatch(base_log_matcher::IntValueMatch { + value_match: Some(IntValueMatch(bd_proto::protos::value_matcher::value_matcher::IntValueMatch { operator: Operator::OPERATOR_EQUALS.into(), int_value_match_type: Some(Int_value_match_type::SaveFieldId("id1".to_string())), ..Default::default() @@ -420,7 +423,7 @@ fn test_extracted_int_matcher() { fn test_tag_int_lte_matcher() { let config = simple_log_matcher(TagMatch(base_log_matcher::TagMatch { tag_key: "key".to_string(), - value_match: Some(IntValueMatch(base_log_matcher::IntValueMatch { + value_match: Some(IntValueMatch(bd_proto::protos::value_matcher::value_matcher::IntValueMatch { operator: Operator::OPERATOR_LESS_THAN_OR_EQUAL.into(), int_value_match_type: Some(Int_value_match_type::MatchValue(12)), ..Default::default() @@ -451,7 +454,7 @@ fn test_tag_int_lte_matcher() { fn test_tag_string_gt_matcher() { let config = simple_log_matcher(TagMatch(base_log_matcher::TagMatch { tag_key: "key".to_string(), - value_match: Some(StringValueMatch(base_log_matcher::StringValueMatch { + value_match: Some(StringValueMatch(bd_proto::protos::value_matcher::value_matcher::StringValueMatch { operator: Operator::OPERATOR_GREATER_THAN.into(), string_value_match_type: Some(String_value_match_type::MatchValue("40".to_string())), ..Default::default() @@ -479,7 +482,7 @@ fn test_tag_string_gt_matcher() { fn test_tag_int_invalid_regex_matcher() { let config = simple_log_matcher(TagMatch(base_log_matcher::TagMatch { tag_key: "key".to_string(), - value_match: Some(IntValueMatch(base_log_matcher::IntValueMatch { + value_match: Some(IntValueMatch(bd_proto::protos::value_matcher::value_matcher::IntValueMatch { operator: Operator::OPERATOR_REGEX.into(), int_value_match_type: Some(Int_value_match_type::MatchValue(12)), ..Default::default() @@ -497,7 +500,7 @@ fn test_tag_int_invalid_regex_matcher() { fn test_tag_log_type_invalid_config_value() { let config = simple_log_matcher(TagMatch(base_log_matcher::TagMatch { tag_key: "log_type".to_string(), - value_match: Some(IntValueMatch(base_log_matcher::IntValueMatch { + value_match: Some(IntValueMatch(bd_proto::protos::value_matcher::value_matcher::IntValueMatch { operator: Operator::OPERATOR_REGEX.into(), // this is ignored int_value_match_type: Some(Int_value_match_type::MatchValue(-1)), // invalid ..Default::default() @@ -515,7 +518,7 @@ fn test_tag_log_type_invalid_config_value() { fn test_tag_log_type() { let config = simple_log_matcher(TagMatch(base_log_matcher::TagMatch { tag_key: "log_type".to_string(), - value_match: Some(IntValueMatch(base_log_matcher::IntValueMatch { + value_match: Some(IntValueMatch(bd_proto::protos::value_matcher::value_matcher::IntValueMatch { operator: Operator::OPERATOR_REGEX.into(), // this is ignored int_value_match_type: Some(Int_value_match_type::MatchValue(3)), ..Default::default() @@ -540,7 +543,7 @@ fn test_tag_log_type() { fn test_tag_log_level() { let config = simple_log_matcher(TagMatch(base_log_matcher::TagMatch { tag_key: "log_level".to_string(), - value_match: Some(IntValueMatch(base_log_matcher::IntValueMatch { + value_match: Some(IntValueMatch(bd_proto::protos::value_matcher::value_matcher::IntValueMatch { operator: Operator::OPERATOR_GREATER_THAN_OR_EQUAL.into(), int_value_match_type: Some(Int_value_match_type::MatchValue(2)), // INFO ..Default::default() @@ -563,7 +566,7 @@ fn test_tag_log_level() { fn semver_tag_matcher_config(value: &str, operator: Operator) -> LogMatcher { simple_log_matcher(TagMatch(base_log_matcher::TagMatch { tag_key: "key".to_string(), - value_match: Some(SemVerValueMatch(base_log_matcher::SemVerValueMatch { + value_match: Some(SemVerValueMatch(bd_proto::protos::value_matcher::value_matcher::SemVerValueMatch { operator: operator.into(), match_value: value.to_string(), ..Default::default() @@ -698,7 +701,7 @@ fn tag_semver_neq_matcher() { fn mixed_segment_semver_matcher() { let config = simple_log_matcher(TagMatch(base_log_matcher::TagMatch { tag_key: "key".to_string(), - value_match: Some(SemVerValueMatch(base_log_matcher::SemVerValueMatch { + value_match: Some(SemVerValueMatch(bd_proto::protos::value_matcher::value_matcher::SemVerValueMatch { operator: Operator::OPERATOR_LESS_THAN_OR_EQUAL.into(), match_value: "1.5.foo.0".to_string(), ..Default::default() @@ -723,7 +726,7 @@ fn mixed_segment_semver_matcher() { fn test_tag_semver_eq_regex_matcher() { let config = simple_log_matcher(TagMatch(base_log_matcher::TagMatch { tag_key: "key".to_string(), - value_match: Some(SemVerValueMatch(base_log_matcher::SemVerValueMatch { + value_match: Some(SemVerValueMatch(bd_proto::protos::value_matcher::value_matcher::SemVerValueMatch { operator: Operator::OPERATOR_REGEX.into(), match_value: "1\\.5\\.*".to_string(), ..Default::default() @@ -808,7 +811,7 @@ fn test_not_matcher() { fn test_is_set_matcher() { let matcher = TagMatch(base_log_matcher::TagMatch { tag_key: "foo".to_string(), - value_match: Some(IsSetMatch(base_log_matcher::IsSetMatch::default())), + value_match: Some(IsSetMatch(bd_proto::protos::value_matcher::value_matcher::IsSetMatch::default())), ..Default::default() }); @@ -893,6 +896,159 @@ fn feature_flag_matcher() { } } +#[test] +fn state_match_int_values() { + struct Input { + state_values: Vec<(&'static str, &'static str)>, + matcher: LogMatcher, + matches: bool, + } + + for (idx, input) in [ + Input { + state_values: vec![("count", "42")], + matcher: make_int_state_matcher("count", Operator::OPERATOR_EQUALS, 42), + matches: true, + }, + Input { + state_values: vec![("count", "42")], + matcher: make_int_state_matcher("count", Operator::OPERATOR_EQUALS, 41), + matches: false, + }, + Input { + state_values: vec![("count", "42")], + matcher: make_int_state_matcher("count", Operator::OPERATOR_GREATER_THAN, 40), + matches: true, + }, + Input { + state_values: vec![("count", "42")], + matcher: make_int_state_matcher("count", Operator::OPERATOR_LESS_THAN, 50), + matches: true, + }, + Input { + state_values: vec![("count", "42")], + matcher: make_int_state_matcher("count", Operator::OPERATOR_NOT_EQUALS, 41), + matches: true, + }, + ] + .into_iter() + .enumerate() + { + let matcher = TestMatcher::new(&input.matcher).unwrap(); + + let mut state = bd_state::test::TestStateReader::default(); + for (key, value) in input.state_values { + state.insert(bd_state::Scope::FeatureFlag, key, value.to_string()); + } + + let actual = + matcher.match_log_with_state(TypedLogLevel::Debug, LogType::NORMAL, "foo", [], &state); + + assert_eq!( + input.matches, actual, + "Test case {} failed: expected {}, got {}", + idx, input.matches, actual + ); + } +} + +#[test] +fn state_match_double_values() { + struct Input { + state_values: Vec<(&'static str, &'static str)>, + matcher: LogMatcher, + matches: bool, + } + + for (idx, input) in [ + Input { + state_values: vec![("temperature", "98.6")], + matcher: make_double_state_matcher("temperature", Operator::OPERATOR_EQUALS, 98.6), + matches: true, + }, + Input { + state_values: vec![("temperature", "98.6")], + matcher: make_double_state_matcher("temperature", Operator::OPERATOR_GREATER_THAN, 98.0), + matches: true, + }, + Input { + state_values: vec![("temperature", "98.6")], + matcher: make_double_state_matcher("temperature", Operator::OPERATOR_LESS_THAN, 99.0), + matches: true, + }, + Input { + state_values: vec![("temperature", "98.6")], + matcher: make_double_state_matcher("temperature", Operator::OPERATOR_NOT_EQUALS, 97.0), + matches: true, + }, + ] + .into_iter() + .enumerate() + { + let matcher = TestMatcher::new(&input.matcher).unwrap(); + + let mut state = bd_state::test::TestStateReader::default(); + for (key, value) in input.state_values { + state.insert(bd_state::Scope::FeatureFlag, key, value.to_string()); + } + + let actual = + matcher.match_log_with_state(TypedLogLevel::Debug, LogType::NORMAL, "foo", [], &state); + + assert_eq!( + input.matches, actual, + "Test case {} failed: expected {}, got {}", + idx, input.matches, actual + ); + } +} + +#[test] +fn state_match_is_set() { + struct Input { + state_values: Vec<(&'static str, &'static str)>, + matcher: LogMatcher, + matches: bool, + } + + for (idx, input) in [ + Input { + state_values: vec![("flag1", "")], + matcher: make_state_is_set_matcher("flag1"), + matches: true, + }, + Input { + state_values: vec![("flag1", "value")], + matcher: make_state_is_set_matcher("flag1"), + matches: true, + }, + Input { + state_values: vec![], + matcher: make_state_is_set_matcher("flag2"), + matches: false, + }, + ] + .into_iter() + .enumerate() + { + let matcher = TestMatcher::new(&input.matcher).unwrap(); + + let mut state = bd_state::test::TestStateReader::default(); + for (key, value) in input.state_values { + state.insert(bd_state::Scope::FeatureFlag, key, value.to_string()); + } + + let actual = + matcher.match_log_with_state(TypedLogLevel::Debug, LogType::NORMAL, "foo", [], &state); + + assert_eq!( + input.matches, actual, + "Test case {} failed: expected {}, got {}", + idx, input.matches, actual + ); + } +} + fn simple_log_matcher(match_type: base_log_matcher::Match_type) -> LogMatcher { LogMatcher { matcher: Some(Matcher::BaseMatcher(BaseLogMatcher { @@ -905,7 +1061,7 @@ fn simple_log_matcher(match_type: base_log_matcher::Match_type) -> LogMatcher { fn make_message_match(operator: Operator, match_value: &str) -> base_log_matcher::Match_type { MessageMatch(base_log_matcher::MessageMatch { - string_value_match: MessageField::from_option(Some(base_log_matcher::StringValueMatch { + string_value_match: MessageField::from_option(Some(bd_proto::protos::value_matcher::value_matcher::StringValueMatch { operator: operator.into(), string_value_match_type: Some(String_value_match_type::MatchValue(match_value.to_string())), ..Default::default() @@ -919,35 +1075,101 @@ fn make_string_feature_flag_matcher( operator: Operator, match_value: &str, ) -> LogMatcher { - simple_log_matcher(log_matcher::base_log_matcher::Match_type::FeatureFlagMatch( - base_log_matcher::FeatureFlagMatch { - flag_name: flag_name.to_string(), - value_match: Some(feature_flag_match::Value_match::StringValueMatch( - base_log_matcher::StringValueMatch { - operator: operator.into(), - string_value_match_type: Some( - log_matcher::base_log_matcher::string_value_match::String_value_match_type::MatchValue( + simple_log_matcher(StateMatch(base_log_matcher::StateMatch { + scope: StateScope::FEATURE_FLAG.into(), + state_key: flag_name.to_string(), + state_value_match: MessageField::from_option(Some( + bd_proto::protos::state::matcher::StateValueMatch { + value_match: Some(state_value_match::Value_match::StringValueMatch( + bd_proto::protos::value_matcher::value_matcher::StringValueMatch { + operator: operator.into(), + string_value_match_type: Some(String_value_match_type::MatchValue( match_value.to_string(), - ), - ), - ..Default::default() - }, - )), - ..Default::default() - }, - )) + )), + ..Default::default() + }, + )), + ..Default::default() + }, + )), + ..Default::default() + })) } fn make_feature_flag_is_set_matcher(flag_name: &str) -> LogMatcher { - simple_log_matcher(log_matcher::base_log_matcher::Match_type::FeatureFlagMatch( - base_log_matcher::FeatureFlagMatch { - flag_name: flag_name.to_string(), - value_match: Some(feature_flag_match::Value_match::IsSetMatch( - base_log_matcher::IsSetMatch::default(), - )), - ..Default::default() - }, - )) + simple_log_matcher(StateMatch(base_log_matcher::StateMatch { + scope: StateScope::FEATURE_FLAG.into(), + state_key: flag_name.to_string(), + state_value_match: MessageField::from_option(Some( + bd_proto::protos::state::matcher::StateValueMatch { + value_match: Some(state_value_match::Value_match::IsSetMatch( + bd_proto::protos::value_matcher::value_matcher::IsSetMatch::default(), + )), + ..Default::default() + }, + )), + ..Default::default() + })) +} + +fn make_int_state_matcher(state_key: &str, operator: Operator, match_value: i32) -> LogMatcher { + simple_log_matcher(StateMatch(base_log_matcher::StateMatch { + scope: StateScope::FEATURE_FLAG.into(), + state_key: state_key.to_string(), + state_value_match: MessageField::from_option(Some( + bd_proto::protos::state::matcher::StateValueMatch { + value_match: Some(state_value_match::Value_match::IntValueMatch( + bd_proto::protos::value_matcher::value_matcher::IntValueMatch { + operator: operator.into(), + int_value_match_type: Some(Int_value_match_type::MatchValue(match_value)), + ..Default::default() + }, + )), + ..Default::default() + }, + )), + ..Default::default() + })) +} + +fn make_double_state_matcher( + state_key: &str, + operator: Operator, + match_value: f64, +) -> LogMatcher { + simple_log_matcher(StateMatch(base_log_matcher::StateMatch { + scope: StateScope::FEATURE_FLAG.into(), + state_key: state_key.to_string(), + state_value_match: MessageField::from_option(Some( + bd_proto::protos::state::matcher::StateValueMatch { + value_match: Some(state_value_match::Value_match::DoubleValueMatch( + bd_proto::protos::value_matcher::value_matcher::DoubleValueMatch { + operator: operator.into(), + double_value_match_type: Some(Double_value_match_type::MatchValue(match_value)), + ..Default::default() + }, + )), + ..Default::default() + }, + )), + ..Default::default() + })) +} + +fn make_state_is_set_matcher(state_key: &str) -> LogMatcher { + simple_log_matcher(StateMatch(base_log_matcher::StateMatch { + scope: StateScope::FEATURE_FLAG.into(), + state_key: state_key.to_string(), + state_value_match: MessageField::from_option(Some( + bd_proto::protos::state::matcher::StateValueMatch { + value_match: Some(state_value_match::Value_match::IsSetMatch( + bd_proto::protos::value_matcher::value_matcher::IsSetMatch::default(), + )), + ..Default::default() + }, + )), + ..Default::default() + })) } #[allow(clippy::needless_pass_by_value)] diff --git a/bd-log-matcher/src/version.rs b/bd-log-matcher/src/version.rs index ce2f09afd..85ead875f 100644 --- a/bd-log-matcher/src/version.rs +++ b/bd-log-matcher/src/version.rs @@ -10,7 +10,7 @@ mod test; use anyhow::{Result, anyhow}; -use bd_proto::protos::log_matcher::log_matcher::log_matcher::base_log_matcher::Operator; +use bd_proto::protos::value_matcher::value_matcher::Operator; use itertools::Itertools; use regex::Regex; use std::cmp::Ordering; diff --git a/bd-proto/build.rs b/bd-proto/build.rs index 70ee90bde..2d8c2d49c 100644 --- a/bd-proto/build.rs +++ b/bd-proto/build.rs @@ -117,7 +117,7 @@ fn main() { .out_dir("src/protos/logging/") .capture_stderr() .run_from_script(); - std::fs::create_dir_all("src/protos/state").unwrap(); + std::fs::create_dir_all("src/protos/value_matcher").unwrap(); protobuf_codegen::Codegen::new() .protoc() .customize( @@ -127,7 +127,25 @@ fn main() { .file_header(GENERATED_HEADER.to_string()), ) .includes(["../api/thirdparty", "../api/src"]) - .inputs(["../api/src/bitdrift_public/protobuf/state/v1/payload.proto"]) + .inputs(["../api/src/bitdrift_public/protobuf/value_matcher/v1/value_matcher.proto"]) + .out_dir("src/protos/value_matcher/") + .capture_stderr() + .run_from_script(); + std::fs::create_dir_all("src/protos/value_matcher").unwrap(); + protobuf_codegen::Codegen::new() + .protoc() + .customize( + Customize::default() + .gen_mod_rs(false) + .oneofs_non_exhaustive(false) + .file_header(GENERATED_HEADER.to_string()), + ) + .includes(["../api/thirdparty", "../api/src"]) + .inputs([ + "../api/src/bitdrift_public/protobuf/state/v1/payload.proto", + "../api/src/bitdrift_public/protobuf/state/v1/scope.proto", + "../api/src/bitdrift_public/protobuf/state/v1/matcher.proto", + ]) .out_dir("src/protos/state/") .capture_stderr() .run_from_script(); diff --git a/bd-proto/src/protos/bdtail/bdtail_config.rs b/bd-proto/src/protos/bdtail/bdtail_config.rs index 0bc134a84..51dce458f 100644 --- a/bd-proto/src/protos/bdtail/bdtail_config.rs +++ b/bd-proto/src/protos/bdtail/bdtail_config.rs @@ -297,8 +297,8 @@ impl ::protobuf::reflect::ProtobufValue for BdTailConfigurations { static file_descriptor_proto_data: &'static [u8] = b"\ \n6bitdrift_public/protobuf/bdtail/v1/bdtail_config.proto\x12\"bitdrift_\ - public.protobuf.bdtail.v1\x1a\x17validate/validate.proto\x1a5bitdrift_pu\ - blic/protobuf/matcher/v1/log_matcher.proto\"\x7f\n\x0cBdTailStream\x12$\ + public.protobuf.bdtail.v1\x1a5bitdrift_public/protobuf/matcher/v1/log_ma\ + tcher.proto\x1a\x17validate/validate.proto\"\x7f\n\x0cBdTailStream\x12$\ \n\tstream_id\x18\x01\x20\x01(\tR\x08streamIdB\x07\xfaB\x04r\x02\x10\x01\ \x12I\n\x07matcher\x18\x02\x20\x01(\x0b2/.bitdrift_public.protobuf.match\ er.v1.LogMatcherR\x07matcher\"o\n\x14BdTailConfigurations\x12W\n\x0eacti\ @@ -321,8 +321,8 @@ pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { file_descriptor.get(|| { let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { let mut deps = ::std::vec::Vec::with_capacity(2); - deps.push(super::validate::file_descriptor().clone()); deps.push(super::log_matcher::file_descriptor().clone()); + deps.push(super::validate::file_descriptor().clone()); let mut messages = ::std::vec::Vec::with_capacity(2); messages.push(BdTailStream::generated_message_descriptor_data()); messages.push(BdTailConfigurations::generated_message_descriptor_data()); diff --git a/bd-proto/src/protos/client/api.rs b/bd-proto/src/protos/client/api.rs index efcb1fab7..8314dc317 100644 --- a/bd-proto/src/protos/client/api.rs +++ b/bd-proto/src/protos/client/api.rs @@ -9397,14 +9397,14 @@ pub mod api_response { static file_descriptor_proto_data: &'static [u8] = b"\ \n,bitdrift_public/protobuf/client/v1/api.proto\x12\"bitdrift_public.pro\ - tobuf.client.v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/pro\ - tobuf/duration.proto\x1a0bitdrift_public/protobuf/client/v1/runtime.prot\ - o\x1a/bitdrift_public/protobuf/client/v1/metric.proto\x1a/bitdrift_publi\ - c/protobuf/filter/v1/filter.proto\x1a3bitdrift_public/protobuf/workflow/\ - v1/workflow.proto\x1a6bitdrift_public/protobuf/bdtail/v1/bdtail_config.p\ - roto\x1a/bitdrift_public/protobuf/config/v1/config.proto\x1a5bitdrift_pu\ - blic/protobuf/client/v1/feature_flag.proto\x1a1bitdrift_public/protobuf/\ - logging/v1/payload.proto\x1a\x17validate/validate.proto\"m\n\x0eClientKi\ + tobuf.client.v1\x1a6bitdrift_public/protobuf/bdtail/v1/bdtail_config.pro\ + to\x1a5bitdrift_public/protobuf/client/v1/feature_flag.proto\x1a/bitdrif\ + t_public/protobuf/client/v1/metric.proto\x1a0bitdrift_public/protobuf/cl\ + ient/v1/runtime.proto\x1a/bitdrift_public/protobuf/config/v1/config.prot\ + o\x1a/bitdrift_public/protobuf/filter/v1/filter.proto\x1a1bitdrift_publi\ + c/protobuf/logging/v1/payload.proto\x1a3bitdrift_public/protobuf/workflo\ + w/v1/workflow.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/\ + protobuf/timestamp.proto\x1a\x17validate/validate.proto\"m\n\x0eClientKi\ llFile\x12\x20\n\x0capi_key_hash\x18\x01\x20\x01(\x0cR\napiKeyHash\x129\ \n\nkill_until\x18\x02\x20\x01(\x0b2\x1a.google.protobuf.TimestampR\tkil\ lUntil\"\xcc\x04\n\x10HandshakeRequest\x12\x84\x01\n\x16static_device_me\ @@ -9645,16 +9645,16 @@ pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { file_descriptor.get(|| { let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { let mut deps = ::std::vec::Vec::with_capacity(11); - deps.push(::protobuf::well_known_types::timestamp::file_descriptor().clone()); - deps.push(::protobuf::well_known_types::duration::file_descriptor().clone()); - deps.push(super::runtime::file_descriptor().clone()); - deps.push(super::metric::file_descriptor().clone()); - deps.push(super::filter::file_descriptor().clone()); - deps.push(super::workflow::file_descriptor().clone()); deps.push(super::bdtail_config::file_descriptor().clone()); - deps.push(super::config::file_descriptor().clone()); deps.push(super::feature_flag::file_descriptor().clone()); + deps.push(super::metric::file_descriptor().clone()); + deps.push(super::runtime::file_descriptor().clone()); + deps.push(super::config::file_descriptor().clone()); + deps.push(super::filter::file_descriptor().clone()); deps.push(super::payload::file_descriptor().clone()); + deps.push(super::workflow::file_descriptor().clone()); + deps.push(::protobuf::well_known_types::duration::file_descriptor().clone()); + deps.push(::protobuf::well_known_types::timestamp::file_descriptor().clone()); deps.push(super::validate::file_descriptor().clone()); let mut messages = ::std::vec::Vec::with_capacity(45); messages.push(ClientKillFile::generated_message_descriptor_data()); diff --git a/bd-proto/src/protos/client/artifact.rs b/bd-proto/src/protos/client/artifact.rs index 3a756d3a0..a04d7ef2a 100644 --- a/bd-proto/src/protos/client/artifact.rs +++ b/bd-proto/src/protos/client/artifact.rs @@ -388,9 +388,9 @@ pub mod artifact_upload_index { static file_descriptor_proto_data: &'static [u8] = b"\ \n1bitdrift_public/protobuf/client/v1/artifact.proto\x12\"bitdrift_publi\ - c.protobuf.client.v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a1bitdrift\ - _public/protobuf/logging/v1/payload.proto\x1a5bitdrift_public/protobuf/c\ - lient/v1/feature_flag.proto\"\xe0\x04\n\x13ArtifactUploadIndex\x12\\\n\ + c.protobuf.client.v1\x1a5bitdrift_public/protobuf/client/v1/feature_flag\ + .proto\x1a1bitdrift_public/protobuf/logging/v1/payload.proto\x1a\x1fgoog\ + le/protobuf/timestamp.proto\"\xe0\x04\n\x13ArtifactUploadIndex\x12\\\n\ \x08artifact\x18\x01\x20\x03(\x0b2@.bitdrift_public.protobuf.client.v1.A\ rtifactUploadIndex.ArtifactR\x08artifact\x1a\xea\x03\n\x08Artifact\x12\ \x12\n\x04name\x18\x01\x20\x01(\tR\x04name\x12.\n\x04time\x18\x02\x20\ @@ -420,9 +420,9 @@ pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { file_descriptor.get(|| { let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { let mut deps = ::std::vec::Vec::with_capacity(3); - deps.push(::protobuf::well_known_types::timestamp::file_descriptor().clone()); - deps.push(super::payload::file_descriptor().clone()); deps.push(super::feature_flag::file_descriptor().clone()); + deps.push(super::payload::file_descriptor().clone()); + deps.push(::protobuf::well_known_types::timestamp::file_descriptor().clone()); let mut messages = ::std::vec::Vec::with_capacity(2); messages.push(ArtifactUploadIndex::generated_message_descriptor_data()); messages.push(artifact_upload_index::Artifact::generated_message_descriptor_data()); diff --git a/bd-proto/src/protos/filter/filter.rs b/bd-proto/src/protos/filter/filter.rs index 4fccac328..a33662298 100644 --- a/bd-proto/src/protos/filter/filter.rs +++ b/bd-proto/src/protos/filter/filter.rs @@ -1762,8 +1762,8 @@ pub mod filter { static file_descriptor_proto_data: &'static [u8] = b"\ \n/bitdrift_public/protobuf/filter/v1/filter.proto\x12\"bitdrift_public.\ - protobuf.filter.v1\x1a\x17validate/validate.proto\x1a5bitdrift_public/pr\ - otobuf/matcher/v1/log_matcher.proto\"\\\n\x14FiltersConfiguration\x12D\n\ + protobuf.filter.v1\x1a5bitdrift_public/protobuf/matcher/v1/log_matcher.p\ + roto\x1a\x17validate/validate.proto\"\\\n\x14FiltersConfiguration\x12D\n\ \x07filters\x18\x01\x20\x03(\x0b2*.bitdrift_public.protobuf.filter.v1.Fi\ lterR\x07filters\"\xf9\x0b\n\x06Filter\x12S\n\x07matcher\x18\x01\x20\x01\ (\x0b2/.bitdrift_public.protobuf.matcher.v1.LogMatcherR\x07matcherB\x08\ @@ -1816,8 +1816,8 @@ pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { file_descriptor.get(|| { let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { let mut deps = ::std::vec::Vec::with_capacity(2); - deps.push(super::validate::file_descriptor().clone()); deps.push(super::log_matcher::file_descriptor().clone()); + deps.push(super::validate::file_descriptor().clone()); let mut messages = ::std::vec::Vec::with_capacity(9); messages.push(FiltersConfiguration::generated_message_descriptor_data()); messages.push(Filter::generated_message_descriptor_data()); diff --git a/bd-proto/src/protos/log_matcher/log_matcher.rs b/bd-proto/src/protos/log_matcher/log_matcher.rs index 7e464726b..0168532a0 100644 --- a/bd-proto/src/protos/log_matcher/log_matcher.rs +++ b/bd-proto/src/protos/log_matcher/log_matcher.rs @@ -564,52 +564,52 @@ pub mod log_matcher { } } - // .bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.FeatureFlagMatch feature_flag_match = 3; + // .bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.StateMatch state_match = 4; - pub fn feature_flag_match(&self) -> &base_log_matcher::FeatureFlagMatch { + pub fn state_match(&self) -> &base_log_matcher::StateMatch { match self.match_type { - ::std::option::Option::Some(base_log_matcher::Match_type::FeatureFlagMatch(ref v)) => v, - _ => ::default_instance(), + ::std::option::Option::Some(base_log_matcher::Match_type::StateMatch(ref v)) => v, + _ => ::default_instance(), } } - pub fn clear_feature_flag_match(&mut self) { + pub fn clear_state_match(&mut self) { self.match_type = ::std::option::Option::None; } - pub fn has_feature_flag_match(&self) -> bool { + pub fn has_state_match(&self) -> bool { match self.match_type { - ::std::option::Option::Some(base_log_matcher::Match_type::FeatureFlagMatch(..)) => true, + ::std::option::Option::Some(base_log_matcher::Match_type::StateMatch(..)) => true, _ => false, } } // Param is passed by value, moved - pub fn set_feature_flag_match(&mut self, v: base_log_matcher::FeatureFlagMatch) { - self.match_type = ::std::option::Option::Some(base_log_matcher::Match_type::FeatureFlagMatch(v)) + pub fn set_state_match(&mut self, v: base_log_matcher::StateMatch) { + self.match_type = ::std::option::Option::Some(base_log_matcher::Match_type::StateMatch(v)) } // Mutable pointer to the field. - pub fn mut_feature_flag_match(&mut self) -> &mut base_log_matcher::FeatureFlagMatch { - if let ::std::option::Option::Some(base_log_matcher::Match_type::FeatureFlagMatch(_)) = self.match_type { + pub fn mut_state_match(&mut self) -> &mut base_log_matcher::StateMatch { + if let ::std::option::Option::Some(base_log_matcher::Match_type::StateMatch(_)) = self.match_type { } else { - self.match_type = ::std::option::Option::Some(base_log_matcher::Match_type::FeatureFlagMatch(base_log_matcher::FeatureFlagMatch::new())); + self.match_type = ::std::option::Option::Some(base_log_matcher::Match_type::StateMatch(base_log_matcher::StateMatch::new())); } match self.match_type { - ::std::option::Option::Some(base_log_matcher::Match_type::FeatureFlagMatch(ref mut v)) => v, + ::std::option::Option::Some(base_log_matcher::Match_type::StateMatch(ref mut v)) => v, _ => panic!(), } } // Take field - pub fn take_feature_flag_match(&mut self) -> base_log_matcher::FeatureFlagMatch { - if self.has_feature_flag_match() { + pub fn take_state_match(&mut self) -> base_log_matcher::StateMatch { + if self.has_state_match() { match self.match_type.take() { - ::std::option::Option::Some(base_log_matcher::Match_type::FeatureFlagMatch(v)) => v, + ::std::option::Option::Some(base_log_matcher::Match_type::StateMatch(v)) => v, _ => panic!(), } } else { - base_log_matcher::FeatureFlagMatch::new() + base_log_matcher::StateMatch::new() } } @@ -630,12 +630,12 @@ pub mod log_matcher { BaseLogMatcher::mut_tag_match, BaseLogMatcher::set_tag_match, )); - fields.push(::protobuf::reflect::rt::v2::make_oneof_message_has_get_mut_set_accessor::<_, base_log_matcher::FeatureFlagMatch>( - "feature_flag_match", - BaseLogMatcher::has_feature_flag_match, - BaseLogMatcher::feature_flag_match, - BaseLogMatcher::mut_feature_flag_match, - BaseLogMatcher::set_feature_flag_match, + fields.push(::protobuf::reflect::rt::v2::make_oneof_message_has_get_mut_set_accessor::<_, base_log_matcher::StateMatch>( + "state_match", + BaseLogMatcher::has_state_match, + BaseLogMatcher::state_match, + BaseLogMatcher::mut_state_match, + BaseLogMatcher::set_state_match, )); oneofs.push(base_log_matcher::Match_type::generated_oneof_descriptor_data()); ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( @@ -662,8 +662,8 @@ pub mod log_matcher { 18 => { self.match_type = ::std::option::Option::Some(base_log_matcher::Match_type::TagMatch(is.read_message()?)); }, - 26 => { - self.match_type = ::std::option::Option::Some(base_log_matcher::Match_type::FeatureFlagMatch(is.read_message()?)); + 34 => { + self.match_type = ::std::option::Option::Some(base_log_matcher::Match_type::StateMatch(is.read_message()?)); }, tag => { ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; @@ -687,7 +687,7 @@ pub mod log_matcher { let len = v.compute_size(); my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; }, - &base_log_matcher::Match_type::FeatureFlagMatch(ref v) => { + &base_log_matcher::Match_type::StateMatch(ref v) => { let len = v.compute_size(); my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; }, @@ -707,8 +707,8 @@ pub mod log_matcher { &base_log_matcher::Match_type::TagMatch(ref v) => { ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; }, - &base_log_matcher::Match_type::FeatureFlagMatch(ref v) => { - ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; + &base_log_matcher::Match_type::StateMatch(ref v) => { + ::protobuf::rt::write_message_field_with_cached_size(4, v, os)?; }, }; } @@ -771,8 +771,8 @@ pub mod log_matcher { MessageMatch(MessageMatch), // @@protoc_insertion_point(oneof_field:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.tag_match) TagMatch(TagMatch), - // @@protoc_insertion_point(oneof_field:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.feature_flag_match) - FeatureFlagMatch(FeatureFlagMatch), + // @@protoc_insertion_point(oneof_field:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.state_match) + StateMatch(StateMatch), } impl ::protobuf::Oneof for Match_type { @@ -790,983 +790,12 @@ pub mod log_matcher { ::protobuf::reflect::GeneratedOneofDescriptorData::new::("match_type") } } - // @@protoc_insertion_point(message:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.StringValueMatch) - #[derive(PartialEq,Clone,Default,Debug)] - pub struct StringValueMatch { - // message fields - // @@protoc_insertion_point(field:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.StringValueMatch.operator) - pub operator: ::protobuf::EnumOrUnknown, - // message oneof groups - pub string_value_match_type: ::std::option::Option, - // special fields - // @@protoc_insertion_point(special_field:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.StringValueMatch.special_fields) - pub special_fields: ::protobuf::SpecialFields, - } - - impl<'a> ::std::default::Default for &'a StringValueMatch { - fn default() -> &'a StringValueMatch { - ::default_instance() - } - } - - impl StringValueMatch { - pub fn new() -> StringValueMatch { - ::std::default::Default::default() - } - - // string match_value = 2; - - pub fn match_value(&self) -> &str { - match self.string_value_match_type { - ::std::option::Option::Some(string_value_match::String_value_match_type::MatchValue(ref v)) => v, - _ => "", - } - } - - pub fn clear_match_value(&mut self) { - self.string_value_match_type = ::std::option::Option::None; - } - - pub fn has_match_value(&self) -> bool { - match self.string_value_match_type { - ::std::option::Option::Some(string_value_match::String_value_match_type::MatchValue(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_match_value(&mut self, v: ::std::string::String) { - self.string_value_match_type = ::std::option::Option::Some(string_value_match::String_value_match_type::MatchValue(v)) - } - - // Mutable pointer to the field. - pub fn mut_match_value(&mut self) -> &mut ::std::string::String { - if let ::std::option::Option::Some(string_value_match::String_value_match_type::MatchValue(_)) = self.string_value_match_type { - } else { - self.string_value_match_type = ::std::option::Option::Some(string_value_match::String_value_match_type::MatchValue(::std::string::String::new())); - } - match self.string_value_match_type { - ::std::option::Option::Some(string_value_match::String_value_match_type::MatchValue(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_match_value(&mut self) -> ::std::string::String { - if self.has_match_value() { - match self.string_value_match_type.take() { - ::std::option::Option::Some(string_value_match::String_value_match_type::MatchValue(v)) => v, - _ => panic!(), - } - } else { - ::std::string::String::new() - } - } - - // string save_field_id = 3; - - pub fn save_field_id(&self) -> &str { - match self.string_value_match_type { - ::std::option::Option::Some(string_value_match::String_value_match_type::SaveFieldId(ref v)) => v, - _ => "", - } - } - - pub fn clear_save_field_id(&mut self) { - self.string_value_match_type = ::std::option::Option::None; - } - - pub fn has_save_field_id(&self) -> bool { - match self.string_value_match_type { - ::std::option::Option::Some(string_value_match::String_value_match_type::SaveFieldId(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_save_field_id(&mut self, v: ::std::string::String) { - self.string_value_match_type = ::std::option::Option::Some(string_value_match::String_value_match_type::SaveFieldId(v)) - } - - // Mutable pointer to the field. - pub fn mut_save_field_id(&mut self) -> &mut ::std::string::String { - if let ::std::option::Option::Some(string_value_match::String_value_match_type::SaveFieldId(_)) = self.string_value_match_type { - } else { - self.string_value_match_type = ::std::option::Option::Some(string_value_match::String_value_match_type::SaveFieldId(::std::string::String::new())); - } - match self.string_value_match_type { - ::std::option::Option::Some(string_value_match::String_value_match_type::SaveFieldId(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_save_field_id(&mut self) -> ::std::string::String { - if self.has_save_field_id() { - match self.string_value_match_type.take() { - ::std::option::Option::Some(string_value_match::String_value_match_type::SaveFieldId(v)) => v, - _ => panic!(), - } - } else { - ::std::string::String::new() - } - } - - pub(in super::super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(3); - let mut oneofs = ::std::vec::Vec::with_capacity(1); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "operator", - |m: &StringValueMatch| { &m.operator }, - |m: &mut StringValueMatch| { &mut m.operator }, - )); - fields.push(::protobuf::reflect::rt::v2::make_oneof_deref_has_get_set_simpler_accessor::<_, _>( - "match_value", - StringValueMatch::has_match_value, - StringValueMatch::match_value, - StringValueMatch::set_match_value, - )); - fields.push(::protobuf::reflect::rt::v2::make_oneof_deref_has_get_set_simpler_accessor::<_, _>( - "save_field_id", - StringValueMatch::has_save_field_id, - StringValueMatch::save_field_id, - StringValueMatch::set_save_field_id, - )); - oneofs.push(string_value_match::String_value_match_type::generated_oneof_descriptor_data()); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "LogMatcher.BaseLogMatcher.StringValueMatch", - fields, - oneofs, - ) - } - } - - impl ::protobuf::Message for StringValueMatch { - const NAME: &'static str = "StringValueMatch"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 8 => { - self.operator = is.read_enum_or_unknown()?; - }, - 18 => { - self.string_value_match_type = ::std::option::Option::Some(string_value_match::String_value_match_type::MatchValue(is.read_string()?)); - }, - 26 => { - self.string_value_match_type = ::std::option::Option::Some(string_value_match::String_value_match_type::SaveFieldId(is.read_string()?)); - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - if self.operator != ::protobuf::EnumOrUnknown::new(Operator::OPERATOR_UNSPECIFIED) { - my_size += ::protobuf::rt::int32_size(1, self.operator.value()); - } - if let ::std::option::Option::Some(ref v) = self.string_value_match_type { - match v { - &string_value_match::String_value_match_type::MatchValue(ref v) => { - my_size += ::protobuf::rt::string_size(2, &v); - }, - &string_value_match::String_value_match_type::SaveFieldId(ref v) => { - my_size += ::protobuf::rt::string_size(3, &v); - }, - }; - } - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - if self.operator != ::protobuf::EnumOrUnknown::new(Operator::OPERATOR_UNSPECIFIED) { - os.write_enum(1, ::protobuf::EnumOrUnknown::value(&self.operator))?; - } - if let ::std::option::Option::Some(ref v) = self.string_value_match_type { - match v { - &string_value_match::String_value_match_type::MatchValue(ref v) => { - os.write_string(2, v)?; - }, - &string_value_match::String_value_match_type::SaveFieldId(ref v) => { - os.write_string(3, v)?; - }, - }; - } - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> StringValueMatch { - StringValueMatch::new() - } - - fn clear(&mut self) { - self.operator = ::protobuf::EnumOrUnknown::new(Operator::OPERATOR_UNSPECIFIED); - self.string_value_match_type = ::std::option::Option::None; - self.string_value_match_type = ::std::option::Option::None; - self.special_fields.clear(); - } - - fn default_instance() -> &'static StringValueMatch { - static instance: StringValueMatch = StringValueMatch { - operator: ::protobuf::EnumOrUnknown::from_i32(0), - string_value_match_type: ::std::option::Option::None, - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } - } - - impl ::protobuf::MessageFull for StringValueMatch { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| super::super::file_descriptor().message_by_package_relative_name("LogMatcher.BaseLogMatcher.StringValueMatch").unwrap()).clone() - } - } - - impl ::std::fmt::Display for StringValueMatch { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } - } - - impl ::protobuf::reflect::ProtobufValue for StringValueMatch { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; - } - - /// Nested message and enums of message `StringValueMatch` - pub mod string_value_match { - - #[derive(Clone,PartialEq,Debug)] - // @@protoc_insertion_point(oneof:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.StringValueMatch.string_value_match_type) - pub enum String_value_match_type { - // @@protoc_insertion_point(oneof_field:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.StringValueMatch.match_value) - MatchValue(::std::string::String), - // @@protoc_insertion_point(oneof_field:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.StringValueMatch.save_field_id) - SaveFieldId(::std::string::String), - } - - impl ::protobuf::Oneof for String_value_match_type { - } - - impl ::protobuf::OneofFull for String_value_match_type { - fn descriptor() -> ::protobuf::reflect::OneofDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::OneofDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| ::descriptor().oneof_by_name("string_value_match_type").unwrap()).clone() - } - } - - impl String_value_match_type { - pub(in super::super::super) fn generated_oneof_descriptor_data() -> ::protobuf::reflect::GeneratedOneofDescriptorData { - ::protobuf::reflect::GeneratedOneofDescriptorData::new::("string_value_match_type") - } - } - } - - // @@protoc_insertion_point(message:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.IntValueMatch) - #[derive(PartialEq,Clone,Default,Debug)] - pub struct IntValueMatch { - // message fields - // @@protoc_insertion_point(field:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.IntValueMatch.operator) - pub operator: ::protobuf::EnumOrUnknown, - // message oneof groups - pub int_value_match_type: ::std::option::Option, - // special fields - // @@protoc_insertion_point(special_field:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.IntValueMatch.special_fields) - pub special_fields: ::protobuf::SpecialFields, - } - - impl<'a> ::std::default::Default for &'a IntValueMatch { - fn default() -> &'a IntValueMatch { - ::default_instance() - } - } - - impl IntValueMatch { - pub fn new() -> IntValueMatch { - ::std::default::Default::default() - } - - // int32 match_value = 2; - - pub fn match_value(&self) -> i32 { - match self.int_value_match_type { - ::std::option::Option::Some(int_value_match::Int_value_match_type::MatchValue(v)) => v, - _ => 0, - } - } - - pub fn clear_match_value(&mut self) { - self.int_value_match_type = ::std::option::Option::None; - } - - pub fn has_match_value(&self) -> bool { - match self.int_value_match_type { - ::std::option::Option::Some(int_value_match::Int_value_match_type::MatchValue(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_match_value(&mut self, v: i32) { - self.int_value_match_type = ::std::option::Option::Some(int_value_match::Int_value_match_type::MatchValue(v)) - } - - // string save_field_id = 3; - - pub fn save_field_id(&self) -> &str { - match self.int_value_match_type { - ::std::option::Option::Some(int_value_match::Int_value_match_type::SaveFieldId(ref v)) => v, - _ => "", - } - } - - pub fn clear_save_field_id(&mut self) { - self.int_value_match_type = ::std::option::Option::None; - } - - pub fn has_save_field_id(&self) -> bool { - match self.int_value_match_type { - ::std::option::Option::Some(int_value_match::Int_value_match_type::SaveFieldId(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_save_field_id(&mut self, v: ::std::string::String) { - self.int_value_match_type = ::std::option::Option::Some(int_value_match::Int_value_match_type::SaveFieldId(v)) - } - - // Mutable pointer to the field. - pub fn mut_save_field_id(&mut self) -> &mut ::std::string::String { - if let ::std::option::Option::Some(int_value_match::Int_value_match_type::SaveFieldId(_)) = self.int_value_match_type { - } else { - self.int_value_match_type = ::std::option::Option::Some(int_value_match::Int_value_match_type::SaveFieldId(::std::string::String::new())); - } - match self.int_value_match_type { - ::std::option::Option::Some(int_value_match::Int_value_match_type::SaveFieldId(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_save_field_id(&mut self) -> ::std::string::String { - if self.has_save_field_id() { - match self.int_value_match_type.take() { - ::std::option::Option::Some(int_value_match::Int_value_match_type::SaveFieldId(v)) => v, - _ => panic!(), - } - } else { - ::std::string::String::new() - } - } - - pub(in super::super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(3); - let mut oneofs = ::std::vec::Vec::with_capacity(1); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "operator", - |m: &IntValueMatch| { &m.operator }, - |m: &mut IntValueMatch| { &mut m.operator }, - )); - fields.push(::protobuf::reflect::rt::v2::make_oneof_copy_has_get_set_simpler_accessors::<_, _>( - "match_value", - IntValueMatch::has_match_value, - IntValueMatch::match_value, - IntValueMatch::set_match_value, - )); - fields.push(::protobuf::reflect::rt::v2::make_oneof_deref_has_get_set_simpler_accessor::<_, _>( - "save_field_id", - IntValueMatch::has_save_field_id, - IntValueMatch::save_field_id, - IntValueMatch::set_save_field_id, - )); - oneofs.push(int_value_match::Int_value_match_type::generated_oneof_descriptor_data()); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "LogMatcher.BaseLogMatcher.IntValueMatch", - fields, - oneofs, - ) - } - } - - impl ::protobuf::Message for IntValueMatch { - const NAME: &'static str = "IntValueMatch"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 8 => { - self.operator = is.read_enum_or_unknown()?; - }, - 16 => { - self.int_value_match_type = ::std::option::Option::Some(int_value_match::Int_value_match_type::MatchValue(is.read_int32()?)); - }, - 26 => { - self.int_value_match_type = ::std::option::Option::Some(int_value_match::Int_value_match_type::SaveFieldId(is.read_string()?)); - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - if self.operator != ::protobuf::EnumOrUnknown::new(Operator::OPERATOR_UNSPECIFIED) { - my_size += ::protobuf::rt::int32_size(1, self.operator.value()); - } - if let ::std::option::Option::Some(ref v) = self.int_value_match_type { - match v { - &int_value_match::Int_value_match_type::MatchValue(v) => { - my_size += ::protobuf::rt::int32_size(2, v); - }, - &int_value_match::Int_value_match_type::SaveFieldId(ref v) => { - my_size += ::protobuf::rt::string_size(3, &v); - }, - }; - } - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - if self.operator != ::protobuf::EnumOrUnknown::new(Operator::OPERATOR_UNSPECIFIED) { - os.write_enum(1, ::protobuf::EnumOrUnknown::value(&self.operator))?; - } - if let ::std::option::Option::Some(ref v) = self.int_value_match_type { - match v { - &int_value_match::Int_value_match_type::MatchValue(v) => { - os.write_int32(2, v)?; - }, - &int_value_match::Int_value_match_type::SaveFieldId(ref v) => { - os.write_string(3, v)?; - }, - }; - } - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> IntValueMatch { - IntValueMatch::new() - } - - fn clear(&mut self) { - self.operator = ::protobuf::EnumOrUnknown::new(Operator::OPERATOR_UNSPECIFIED); - self.int_value_match_type = ::std::option::Option::None; - self.int_value_match_type = ::std::option::Option::None; - self.special_fields.clear(); - } - - fn default_instance() -> &'static IntValueMatch { - static instance: IntValueMatch = IntValueMatch { - operator: ::protobuf::EnumOrUnknown::from_i32(0), - int_value_match_type: ::std::option::Option::None, - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } - } - - impl ::protobuf::MessageFull for IntValueMatch { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| super::super::file_descriptor().message_by_package_relative_name("LogMatcher.BaseLogMatcher.IntValueMatch").unwrap()).clone() - } - } - - impl ::std::fmt::Display for IntValueMatch { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } - } - - impl ::protobuf::reflect::ProtobufValue for IntValueMatch { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; - } - - /// Nested message and enums of message `IntValueMatch` - pub mod int_value_match { - - #[derive(Clone,PartialEq,Debug)] - // @@protoc_insertion_point(oneof:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.IntValueMatch.int_value_match_type) - pub enum Int_value_match_type { - // @@protoc_insertion_point(oneof_field:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.IntValueMatch.match_value) - MatchValue(i32), - // @@protoc_insertion_point(oneof_field:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.IntValueMatch.save_field_id) - SaveFieldId(::std::string::String), - } - - impl ::protobuf::Oneof for Int_value_match_type { - } - - impl ::protobuf::OneofFull for Int_value_match_type { - fn descriptor() -> ::protobuf::reflect::OneofDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::OneofDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| ::descriptor().oneof_by_name("int_value_match_type").unwrap()).clone() - } - } - - impl Int_value_match_type { - pub(in super::super::super) fn generated_oneof_descriptor_data() -> ::protobuf::reflect::GeneratedOneofDescriptorData { - ::protobuf::reflect::GeneratedOneofDescriptorData::new::("int_value_match_type") - } - } - } - - // @@protoc_insertion_point(message:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.DoubleValueMatch) - #[derive(PartialEq,Clone,Default,Debug)] - pub struct DoubleValueMatch { - // message fields - // @@protoc_insertion_point(field:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.DoubleValueMatch.operator) - pub operator: ::protobuf::EnumOrUnknown, - // message oneof groups - pub double_value_match_type: ::std::option::Option, - // special fields - // @@protoc_insertion_point(special_field:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.DoubleValueMatch.special_fields) - pub special_fields: ::protobuf::SpecialFields, - } - - impl<'a> ::std::default::Default for &'a DoubleValueMatch { - fn default() -> &'a DoubleValueMatch { - ::default_instance() - } - } - - impl DoubleValueMatch { - pub fn new() -> DoubleValueMatch { - ::std::default::Default::default() - } - - // double match_value = 2; - - pub fn match_value(&self) -> f64 { - match self.double_value_match_type { - ::std::option::Option::Some(double_value_match::Double_value_match_type::MatchValue(v)) => v, - _ => 0., - } - } - - pub fn clear_match_value(&mut self) { - self.double_value_match_type = ::std::option::Option::None; - } - - pub fn has_match_value(&self) -> bool { - match self.double_value_match_type { - ::std::option::Option::Some(double_value_match::Double_value_match_type::MatchValue(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_match_value(&mut self, v: f64) { - self.double_value_match_type = ::std::option::Option::Some(double_value_match::Double_value_match_type::MatchValue(v)) - } - - // string save_field_id = 3; - - pub fn save_field_id(&self) -> &str { - match self.double_value_match_type { - ::std::option::Option::Some(double_value_match::Double_value_match_type::SaveFieldId(ref v)) => v, - _ => "", - } - } - - pub fn clear_save_field_id(&mut self) { - self.double_value_match_type = ::std::option::Option::None; - } - - pub fn has_save_field_id(&self) -> bool { - match self.double_value_match_type { - ::std::option::Option::Some(double_value_match::Double_value_match_type::SaveFieldId(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_save_field_id(&mut self, v: ::std::string::String) { - self.double_value_match_type = ::std::option::Option::Some(double_value_match::Double_value_match_type::SaveFieldId(v)) - } - - // Mutable pointer to the field. - pub fn mut_save_field_id(&mut self) -> &mut ::std::string::String { - if let ::std::option::Option::Some(double_value_match::Double_value_match_type::SaveFieldId(_)) = self.double_value_match_type { - } else { - self.double_value_match_type = ::std::option::Option::Some(double_value_match::Double_value_match_type::SaveFieldId(::std::string::String::new())); - } - match self.double_value_match_type { - ::std::option::Option::Some(double_value_match::Double_value_match_type::SaveFieldId(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_save_field_id(&mut self) -> ::std::string::String { - if self.has_save_field_id() { - match self.double_value_match_type.take() { - ::std::option::Option::Some(double_value_match::Double_value_match_type::SaveFieldId(v)) => v, - _ => panic!(), - } - } else { - ::std::string::String::new() - } - } - - pub(in super::super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(3); - let mut oneofs = ::std::vec::Vec::with_capacity(1); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "operator", - |m: &DoubleValueMatch| { &m.operator }, - |m: &mut DoubleValueMatch| { &mut m.operator }, - )); - fields.push(::protobuf::reflect::rt::v2::make_oneof_copy_has_get_set_simpler_accessors::<_, _>( - "match_value", - DoubleValueMatch::has_match_value, - DoubleValueMatch::match_value, - DoubleValueMatch::set_match_value, - )); - fields.push(::protobuf::reflect::rt::v2::make_oneof_deref_has_get_set_simpler_accessor::<_, _>( - "save_field_id", - DoubleValueMatch::has_save_field_id, - DoubleValueMatch::save_field_id, - DoubleValueMatch::set_save_field_id, - )); - oneofs.push(double_value_match::Double_value_match_type::generated_oneof_descriptor_data()); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "LogMatcher.BaseLogMatcher.DoubleValueMatch", - fields, - oneofs, - ) - } - } - - impl ::protobuf::Message for DoubleValueMatch { - const NAME: &'static str = "DoubleValueMatch"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 8 => { - self.operator = is.read_enum_or_unknown()?; - }, - 17 => { - self.double_value_match_type = ::std::option::Option::Some(double_value_match::Double_value_match_type::MatchValue(is.read_double()?)); - }, - 26 => { - self.double_value_match_type = ::std::option::Option::Some(double_value_match::Double_value_match_type::SaveFieldId(is.read_string()?)); - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - if self.operator != ::protobuf::EnumOrUnknown::new(Operator::OPERATOR_UNSPECIFIED) { - my_size += ::protobuf::rt::int32_size(1, self.operator.value()); - } - if let ::std::option::Option::Some(ref v) = self.double_value_match_type { - match v { - &double_value_match::Double_value_match_type::MatchValue(v) => { - my_size += 1 + 8; - }, - &double_value_match::Double_value_match_type::SaveFieldId(ref v) => { - my_size += ::protobuf::rt::string_size(3, &v); - }, - }; - } - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - if self.operator != ::protobuf::EnumOrUnknown::new(Operator::OPERATOR_UNSPECIFIED) { - os.write_enum(1, ::protobuf::EnumOrUnknown::value(&self.operator))?; - } - if let ::std::option::Option::Some(ref v) = self.double_value_match_type { - match v { - &double_value_match::Double_value_match_type::MatchValue(v) => { - os.write_double(2, v)?; - }, - &double_value_match::Double_value_match_type::SaveFieldId(ref v) => { - os.write_string(3, v)?; - }, - }; - } - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> DoubleValueMatch { - DoubleValueMatch::new() - } - - fn clear(&mut self) { - self.operator = ::protobuf::EnumOrUnknown::new(Operator::OPERATOR_UNSPECIFIED); - self.double_value_match_type = ::std::option::Option::None; - self.double_value_match_type = ::std::option::Option::None; - self.special_fields.clear(); - } - - fn default_instance() -> &'static DoubleValueMatch { - static instance: DoubleValueMatch = DoubleValueMatch { - operator: ::protobuf::EnumOrUnknown::from_i32(0), - double_value_match_type: ::std::option::Option::None, - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } - } - - impl ::protobuf::MessageFull for DoubleValueMatch { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| super::super::file_descriptor().message_by_package_relative_name("LogMatcher.BaseLogMatcher.DoubleValueMatch").unwrap()).clone() - } - } - - impl ::std::fmt::Display for DoubleValueMatch { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } - } - - impl ::protobuf::reflect::ProtobufValue for DoubleValueMatch { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; - } - - /// Nested message and enums of message `DoubleValueMatch` - pub mod double_value_match { - - #[derive(Clone,PartialEq,Debug)] - // @@protoc_insertion_point(oneof:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.DoubleValueMatch.double_value_match_type) - pub enum Double_value_match_type { - // @@protoc_insertion_point(oneof_field:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.DoubleValueMatch.match_value) - MatchValue(f64), - // @@protoc_insertion_point(oneof_field:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.DoubleValueMatch.save_field_id) - SaveFieldId(::std::string::String), - } - - impl ::protobuf::Oneof for Double_value_match_type { - } - - impl ::protobuf::OneofFull for Double_value_match_type { - fn descriptor() -> ::protobuf::reflect::OneofDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::OneofDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| ::descriptor().oneof_by_name("double_value_match_type").unwrap()).clone() - } - } - - impl Double_value_match_type { - pub(in super::super::super) fn generated_oneof_descriptor_data() -> ::protobuf::reflect::GeneratedOneofDescriptorData { - ::protobuf::reflect::GeneratedOneofDescriptorData::new::("double_value_match_type") - } - } - } - - // @@protoc_insertion_point(message:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.SemVerValueMatch) - #[derive(PartialEq,Clone,Default,Debug)] - pub struct SemVerValueMatch { - // message fields - // @@protoc_insertion_point(field:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.SemVerValueMatch.operator) - pub operator: ::protobuf::EnumOrUnknown, - // @@protoc_insertion_point(field:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.SemVerValueMatch.match_value) - pub match_value: ::std::string::String, - // special fields - // @@protoc_insertion_point(special_field:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.SemVerValueMatch.special_fields) - pub special_fields: ::protobuf::SpecialFields, - } - - impl<'a> ::std::default::Default for &'a SemVerValueMatch { - fn default() -> &'a SemVerValueMatch { - ::default_instance() - } - } - - impl SemVerValueMatch { - pub fn new() -> SemVerValueMatch { - ::std::default::Default::default() - } - - pub(in super::super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(2); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "operator", - |m: &SemVerValueMatch| { &m.operator }, - |m: &mut SemVerValueMatch| { &mut m.operator }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "match_value", - |m: &SemVerValueMatch| { &m.match_value }, - |m: &mut SemVerValueMatch| { &mut m.match_value }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "LogMatcher.BaseLogMatcher.SemVerValueMatch", - fields, - oneofs, - ) - } - } - - impl ::protobuf::Message for SemVerValueMatch { - const NAME: &'static str = "SemVerValueMatch"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 8 => { - self.operator = is.read_enum_or_unknown()?; - }, - 18 => { - self.match_value = is.read_string()?; - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - if self.operator != ::protobuf::EnumOrUnknown::new(Operator::OPERATOR_UNSPECIFIED) { - my_size += ::protobuf::rt::int32_size(1, self.operator.value()); - } - if !self.match_value.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.match_value); - } - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - if self.operator != ::protobuf::EnumOrUnknown::new(Operator::OPERATOR_UNSPECIFIED) { - os.write_enum(1, ::protobuf::EnumOrUnknown::value(&self.operator))?; - } - if !self.match_value.is_empty() { - os.write_string(2, &self.match_value)?; - } - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> SemVerValueMatch { - SemVerValueMatch::new() - } - - fn clear(&mut self) { - self.operator = ::protobuf::EnumOrUnknown::new(Operator::OPERATOR_UNSPECIFIED); - self.match_value.clear(); - self.special_fields.clear(); - } - - fn default_instance() -> &'static SemVerValueMatch { - static instance: SemVerValueMatch = SemVerValueMatch { - operator: ::protobuf::EnumOrUnknown::from_i32(0), - match_value: ::std::string::String::new(), - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } - } - - impl ::protobuf::MessageFull for SemVerValueMatch { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| super::super::file_descriptor().message_by_package_relative_name("LogMatcher.BaseLogMatcher.SemVerValueMatch").unwrap()).clone() - } - } - - impl ::std::fmt::Display for SemVerValueMatch { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } - } - - impl ::protobuf::reflect::ProtobufValue for SemVerValueMatch { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; - } - // @@protoc_insertion_point(message:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.MessageMatch) #[derive(PartialEq,Clone,Default,Debug)] pub struct MessageMatch { // message fields // @@protoc_insertion_point(field:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.MessageMatch.string_value_match) - pub string_value_match: ::protobuf::MessageField, + pub string_value_match: ::protobuf::MessageField, // special fields // @@protoc_insertion_point(special_field:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.MessageMatch.special_fields) pub special_fields: ::protobuf::SpecialFields, @@ -1786,7 +815,7 @@ pub mod log_matcher { pub(in super::super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { let mut fields = ::std::vec::Vec::with_capacity(1); let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, StringValueMatch>( + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::super::super::value_matcher::StringValueMatch>( "string_value_match", |m: &MessageMatch| { &m.string_value_match }, |m: &mut MessageMatch| { &mut m.string_value_match }, @@ -1884,109 +913,6 @@ pub mod log_matcher { type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; } - // @@protoc_insertion_point(message:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.IsSetMatch) - #[derive(PartialEq,Clone,Default,Debug)] - pub struct IsSetMatch { - // special fields - // @@protoc_insertion_point(special_field:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.IsSetMatch.special_fields) - pub special_fields: ::protobuf::SpecialFields, - } - - impl<'a> ::std::default::Default for &'a IsSetMatch { - fn default() -> &'a IsSetMatch { - ::default_instance() - } - } - - impl IsSetMatch { - pub fn new() -> IsSetMatch { - ::std::default::Default::default() - } - - pub(in super::super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(0); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "LogMatcher.BaseLogMatcher.IsSetMatch", - fields, - oneofs, - ) - } - } - - impl ::protobuf::Message for IsSetMatch { - const NAME: &'static str = "IsSetMatch"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> IsSetMatch { - IsSetMatch::new() - } - - fn clear(&mut self) { - self.special_fields.clear(); - } - - fn default_instance() -> &'static IsSetMatch { - static instance: IsSetMatch = IsSetMatch { - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } - } - - impl ::protobuf::MessageFull for IsSetMatch { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| super::super::file_descriptor().message_by_package_relative_name("LogMatcher.BaseLogMatcher.IsSetMatch").unwrap()).clone() - } - } - - impl ::std::fmt::Display for IsSetMatch { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } - } - - impl ::protobuf::reflect::ProtobufValue for IsSetMatch { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; - } - // @@protoc_insertion_point(message:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.TagMatch) #[derive(PartialEq,Clone,Default,Debug)] pub struct TagMatch { @@ -2011,12 +937,12 @@ pub mod log_matcher { ::std::default::Default::default() } - // .bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.StringValueMatch string_value_match = 2; + // .bitdrift_public.protobuf.value_matcher.v1.StringValueMatch string_value_match = 2; - pub fn string_value_match(&self) -> &StringValueMatch { + pub fn string_value_match(&self) -> &super::super::super::value_matcher::StringValueMatch { match self.value_match { ::std::option::Option::Some(tag_match::Value_match::StringValueMatch(ref v)) => v, - _ => ::default_instance(), + _ => ::default_instance(), } } @@ -2032,15 +958,15 @@ pub mod log_matcher { } // Param is passed by value, moved - pub fn set_string_value_match(&mut self, v: StringValueMatch) { + pub fn set_string_value_match(&mut self, v: super::super::super::value_matcher::StringValueMatch) { self.value_match = ::std::option::Option::Some(tag_match::Value_match::StringValueMatch(v)) } // Mutable pointer to the field. - pub fn mut_string_value_match(&mut self) -> &mut StringValueMatch { + pub fn mut_string_value_match(&mut self) -> &mut super::super::super::value_matcher::StringValueMatch { if let ::std::option::Option::Some(tag_match::Value_match::StringValueMatch(_)) = self.value_match { } else { - self.value_match = ::std::option::Option::Some(tag_match::Value_match::StringValueMatch(StringValueMatch::new())); + self.value_match = ::std::option::Option::Some(tag_match::Value_match::StringValueMatch(super::super::super::value_matcher::StringValueMatch::new())); } match self.value_match { ::std::option::Option::Some(tag_match::Value_match::StringValueMatch(ref mut v)) => v, @@ -2049,23 +975,23 @@ pub mod log_matcher { } // Take field - pub fn take_string_value_match(&mut self) -> StringValueMatch { + pub fn take_string_value_match(&mut self) -> super::super::super::value_matcher::StringValueMatch { if self.has_string_value_match() { match self.value_match.take() { ::std::option::Option::Some(tag_match::Value_match::StringValueMatch(v)) => v, _ => panic!(), } } else { - StringValueMatch::new() + super::super::super::value_matcher::StringValueMatch::new() } } - // .bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.IntValueMatch int_value_match = 3; + // .bitdrift_public.protobuf.value_matcher.v1.IntValueMatch int_value_match = 3; - pub fn int_value_match(&self) -> &IntValueMatch { + pub fn int_value_match(&self) -> &super::super::super::value_matcher::IntValueMatch { match self.value_match { ::std::option::Option::Some(tag_match::Value_match::IntValueMatch(ref v)) => v, - _ => ::default_instance(), + _ => ::default_instance(), } } @@ -2081,15 +1007,15 @@ pub mod log_matcher { } // Param is passed by value, moved - pub fn set_int_value_match(&mut self, v: IntValueMatch) { + pub fn set_int_value_match(&mut self, v: super::super::super::value_matcher::IntValueMatch) { self.value_match = ::std::option::Option::Some(tag_match::Value_match::IntValueMatch(v)) } // Mutable pointer to the field. - pub fn mut_int_value_match(&mut self) -> &mut IntValueMatch { + pub fn mut_int_value_match(&mut self) -> &mut super::super::super::value_matcher::IntValueMatch { if let ::std::option::Option::Some(tag_match::Value_match::IntValueMatch(_)) = self.value_match { } else { - self.value_match = ::std::option::Option::Some(tag_match::Value_match::IntValueMatch(IntValueMatch::new())); + self.value_match = ::std::option::Option::Some(tag_match::Value_match::IntValueMatch(super::super::super::value_matcher::IntValueMatch::new())); } match self.value_match { ::std::option::Option::Some(tag_match::Value_match::IntValueMatch(ref mut v)) => v, @@ -2098,23 +1024,23 @@ pub mod log_matcher { } // Take field - pub fn take_int_value_match(&mut self) -> IntValueMatch { + pub fn take_int_value_match(&mut self) -> super::super::super::value_matcher::IntValueMatch { if self.has_int_value_match() { match self.value_match.take() { ::std::option::Option::Some(tag_match::Value_match::IntValueMatch(v)) => v, _ => panic!(), } } else { - IntValueMatch::new() + super::super::super::value_matcher::IntValueMatch::new() } } - // .bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.SemVerValueMatch sem_ver_value_match = 4; + // .bitdrift_public.protobuf.value_matcher.v1.SemVerValueMatch sem_ver_value_match = 4; - pub fn sem_ver_value_match(&self) -> &SemVerValueMatch { + pub fn sem_ver_value_match(&self) -> &super::super::super::value_matcher::SemVerValueMatch { match self.value_match { ::std::option::Option::Some(tag_match::Value_match::SemVerValueMatch(ref v)) => v, - _ => ::default_instance(), + _ => ::default_instance(), } } @@ -2130,15 +1056,15 @@ pub mod log_matcher { } // Param is passed by value, moved - pub fn set_sem_ver_value_match(&mut self, v: SemVerValueMatch) { + pub fn set_sem_ver_value_match(&mut self, v: super::super::super::value_matcher::SemVerValueMatch) { self.value_match = ::std::option::Option::Some(tag_match::Value_match::SemVerValueMatch(v)) } // Mutable pointer to the field. - pub fn mut_sem_ver_value_match(&mut self) -> &mut SemVerValueMatch { + pub fn mut_sem_ver_value_match(&mut self) -> &mut super::super::super::value_matcher::SemVerValueMatch { if let ::std::option::Option::Some(tag_match::Value_match::SemVerValueMatch(_)) = self.value_match { } else { - self.value_match = ::std::option::Option::Some(tag_match::Value_match::SemVerValueMatch(SemVerValueMatch::new())); + self.value_match = ::std::option::Option::Some(tag_match::Value_match::SemVerValueMatch(super::super::super::value_matcher::SemVerValueMatch::new())); } match self.value_match { ::std::option::Option::Some(tag_match::Value_match::SemVerValueMatch(ref mut v)) => v, @@ -2147,23 +1073,23 @@ pub mod log_matcher { } // Take field - pub fn take_sem_ver_value_match(&mut self) -> SemVerValueMatch { + pub fn take_sem_ver_value_match(&mut self) -> super::super::super::value_matcher::SemVerValueMatch { if self.has_sem_ver_value_match() { match self.value_match.take() { ::std::option::Option::Some(tag_match::Value_match::SemVerValueMatch(v)) => v, _ => panic!(), } } else { - SemVerValueMatch::new() + super::super::super::value_matcher::SemVerValueMatch::new() } } - // .bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.IsSetMatch is_set_match = 5; + // .bitdrift_public.protobuf.value_matcher.v1.IsSetMatch is_set_match = 5; - pub fn is_set_match(&self) -> &IsSetMatch { + pub fn is_set_match(&self) -> &super::super::super::value_matcher::IsSetMatch { match self.value_match { ::std::option::Option::Some(tag_match::Value_match::IsSetMatch(ref v)) => v, - _ => ::default_instance(), + _ => ::default_instance(), } } @@ -2179,15 +1105,15 @@ pub mod log_matcher { } // Param is passed by value, moved - pub fn set_is_set_match(&mut self, v: IsSetMatch) { + pub fn set_is_set_match(&mut self, v: super::super::super::value_matcher::IsSetMatch) { self.value_match = ::std::option::Option::Some(tag_match::Value_match::IsSetMatch(v)) } // Mutable pointer to the field. - pub fn mut_is_set_match(&mut self) -> &mut IsSetMatch { + pub fn mut_is_set_match(&mut self) -> &mut super::super::super::value_matcher::IsSetMatch { if let ::std::option::Option::Some(tag_match::Value_match::IsSetMatch(_)) = self.value_match { } else { - self.value_match = ::std::option::Option::Some(tag_match::Value_match::IsSetMatch(IsSetMatch::new())); + self.value_match = ::std::option::Option::Some(tag_match::Value_match::IsSetMatch(super::super::super::value_matcher::IsSetMatch::new())); } match self.value_match { ::std::option::Option::Some(tag_match::Value_match::IsSetMatch(ref mut v)) => v, @@ -2196,23 +1122,23 @@ pub mod log_matcher { } // Take field - pub fn take_is_set_match(&mut self) -> IsSetMatch { + pub fn take_is_set_match(&mut self) -> super::super::super::value_matcher::IsSetMatch { if self.has_is_set_match() { match self.value_match.take() { ::std::option::Option::Some(tag_match::Value_match::IsSetMatch(v)) => v, _ => panic!(), } } else { - IsSetMatch::new() + super::super::super::value_matcher::IsSetMatch::new() } } - // .bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.DoubleValueMatch double_value_match = 6; + // .bitdrift_public.protobuf.value_matcher.v1.DoubleValueMatch double_value_match = 6; - pub fn double_value_match(&self) -> &DoubleValueMatch { + pub fn double_value_match(&self) -> &super::super::super::value_matcher::DoubleValueMatch { match self.value_match { ::std::option::Option::Some(tag_match::Value_match::DoubleValueMatch(ref v)) => v, - _ => ::default_instance(), + _ => ::default_instance(), } } @@ -2228,15 +1154,15 @@ pub mod log_matcher { } // Param is passed by value, moved - pub fn set_double_value_match(&mut self, v: DoubleValueMatch) { + pub fn set_double_value_match(&mut self, v: super::super::super::value_matcher::DoubleValueMatch) { self.value_match = ::std::option::Option::Some(tag_match::Value_match::DoubleValueMatch(v)) } // Mutable pointer to the field. - pub fn mut_double_value_match(&mut self) -> &mut DoubleValueMatch { + pub fn mut_double_value_match(&mut self) -> &mut super::super::super::value_matcher::DoubleValueMatch { if let ::std::option::Option::Some(tag_match::Value_match::DoubleValueMatch(_)) = self.value_match { } else { - self.value_match = ::std::option::Option::Some(tag_match::Value_match::DoubleValueMatch(DoubleValueMatch::new())); + self.value_match = ::std::option::Option::Some(tag_match::Value_match::DoubleValueMatch(super::super::super::value_matcher::DoubleValueMatch::new())); } match self.value_match { ::std::option::Option::Some(tag_match::Value_match::DoubleValueMatch(ref mut v)) => v, @@ -2245,14 +1171,14 @@ pub mod log_matcher { } // Take field - pub fn take_double_value_match(&mut self) -> DoubleValueMatch { + pub fn take_double_value_match(&mut self) -> super::super::super::value_matcher::DoubleValueMatch { if self.has_double_value_match() { match self.value_match.take() { ::std::option::Option::Some(tag_match::Value_match::DoubleValueMatch(v)) => v, _ => panic!(), } } else { - DoubleValueMatch::new() + super::super::super::value_matcher::DoubleValueMatch::new() } } @@ -2264,35 +1190,35 @@ pub mod log_matcher { |m: &TagMatch| { &m.tag_key }, |m: &mut TagMatch| { &mut m.tag_key }, )); - fields.push(::protobuf::reflect::rt::v2::make_oneof_message_has_get_mut_set_accessor::<_, StringValueMatch>( + fields.push(::protobuf::reflect::rt::v2::make_oneof_message_has_get_mut_set_accessor::<_, super::super::super::value_matcher::StringValueMatch>( "string_value_match", TagMatch::has_string_value_match, TagMatch::string_value_match, TagMatch::mut_string_value_match, TagMatch::set_string_value_match, )); - fields.push(::protobuf::reflect::rt::v2::make_oneof_message_has_get_mut_set_accessor::<_, IntValueMatch>( + fields.push(::protobuf::reflect::rt::v2::make_oneof_message_has_get_mut_set_accessor::<_, super::super::super::value_matcher::IntValueMatch>( "int_value_match", TagMatch::has_int_value_match, TagMatch::int_value_match, TagMatch::mut_int_value_match, TagMatch::set_int_value_match, )); - fields.push(::protobuf::reflect::rt::v2::make_oneof_message_has_get_mut_set_accessor::<_, SemVerValueMatch>( + fields.push(::protobuf::reflect::rt::v2::make_oneof_message_has_get_mut_set_accessor::<_, super::super::super::value_matcher::SemVerValueMatch>( "sem_ver_value_match", TagMatch::has_sem_ver_value_match, TagMatch::sem_ver_value_match, TagMatch::mut_sem_ver_value_match, TagMatch::set_sem_ver_value_match, )); - fields.push(::protobuf::reflect::rt::v2::make_oneof_message_has_get_mut_set_accessor::<_, IsSetMatch>( + fields.push(::protobuf::reflect::rt::v2::make_oneof_message_has_get_mut_set_accessor::<_, super::super::super::value_matcher::IsSetMatch>( "is_set_match", TagMatch::has_is_set_match, TagMatch::is_set_match, TagMatch::mut_is_set_match, TagMatch::set_is_set_match, )); - fields.push(::protobuf::reflect::rt::v2::make_oneof_message_has_get_mut_set_accessor::<_, DoubleValueMatch>( + fields.push(::protobuf::reflect::rt::v2::make_oneof_message_has_get_mut_set_accessor::<_, super::super::super::value_matcher::DoubleValueMatch>( "double_value_match", TagMatch::has_double_value_match, TagMatch::double_value_match, @@ -2463,15 +1389,15 @@ pub mod log_matcher { // @@protoc_insertion_point(oneof:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.TagMatch.value_match) pub enum Value_match { // @@protoc_insertion_point(oneof_field:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.TagMatch.string_value_match) - StringValueMatch(super::StringValueMatch), + StringValueMatch(super::super::super::super::value_matcher::StringValueMatch), // @@protoc_insertion_point(oneof_field:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.TagMatch.int_value_match) - IntValueMatch(super::IntValueMatch), + IntValueMatch(super::super::super::super::value_matcher::IntValueMatch), // @@protoc_insertion_point(oneof_field:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.TagMatch.sem_ver_value_match) - SemVerValueMatch(super::SemVerValueMatch), + SemVerValueMatch(super::super::super::super::value_matcher::SemVerValueMatch), // @@protoc_insertion_point(oneof_field:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.TagMatch.is_set_match) - IsSetMatch(super::IsSetMatch), + IsSetMatch(super::super::super::super::value_matcher::IsSetMatch), // @@protoc_insertion_point(oneof_field:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.TagMatch.double_value_match) - DoubleValueMatch(super::DoubleValueMatch), + DoubleValueMatch(super::super::super::super::value_matcher::DoubleValueMatch), } impl ::protobuf::Oneof for Value_match { @@ -2491,161 +1417,60 @@ pub mod log_matcher { } } - // @@protoc_insertion_point(message:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.FeatureFlagMatch) + // @@protoc_insertion_point(message:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.StateMatch) #[derive(PartialEq,Clone,Default,Debug)] - pub struct FeatureFlagMatch { + pub struct StateMatch { // message fields - // @@protoc_insertion_point(field:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.FeatureFlagMatch.flag_name) - pub flag_name: ::std::string::String, - // message oneof groups - pub value_match: ::std::option::Option, + // @@protoc_insertion_point(field:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.StateMatch.scope) + pub scope: ::protobuf::EnumOrUnknown, + // @@protoc_insertion_point(field:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.StateMatch.state_key) + pub state_key: ::std::string::String, + // @@protoc_insertion_point(field:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.StateMatch.state_value_match) + pub state_value_match: ::protobuf::MessageField, // special fields - // @@protoc_insertion_point(special_field:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.FeatureFlagMatch.special_fields) + // @@protoc_insertion_point(special_field:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.StateMatch.special_fields) pub special_fields: ::protobuf::SpecialFields, } - impl<'a> ::std::default::Default for &'a FeatureFlagMatch { - fn default() -> &'a FeatureFlagMatch { - ::default_instance() + impl<'a> ::std::default::Default for &'a StateMatch { + fn default() -> &'a StateMatch { + ::default_instance() } } - impl FeatureFlagMatch { - pub fn new() -> FeatureFlagMatch { + impl StateMatch { + pub fn new() -> StateMatch { ::std::default::Default::default() } - // .bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.StringValueMatch string_value_match = 2; - - pub fn string_value_match(&self) -> &StringValueMatch { - match self.value_match { - ::std::option::Option::Some(feature_flag_match::Value_match::StringValueMatch(ref v)) => v, - _ => ::default_instance(), - } - } - - pub fn clear_string_value_match(&mut self) { - self.value_match = ::std::option::Option::None; - } - - pub fn has_string_value_match(&self) -> bool { - match self.value_match { - ::std::option::Option::Some(feature_flag_match::Value_match::StringValueMatch(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_string_value_match(&mut self, v: StringValueMatch) { - self.value_match = ::std::option::Option::Some(feature_flag_match::Value_match::StringValueMatch(v)) - } - - // Mutable pointer to the field. - pub fn mut_string_value_match(&mut self) -> &mut StringValueMatch { - if let ::std::option::Option::Some(feature_flag_match::Value_match::StringValueMatch(_)) = self.value_match { - } else { - self.value_match = ::std::option::Option::Some(feature_flag_match::Value_match::StringValueMatch(StringValueMatch::new())); - } - match self.value_match { - ::std::option::Option::Some(feature_flag_match::Value_match::StringValueMatch(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_string_value_match(&mut self) -> StringValueMatch { - if self.has_string_value_match() { - match self.value_match.take() { - ::std::option::Option::Some(feature_flag_match::Value_match::StringValueMatch(v)) => v, - _ => panic!(), - } - } else { - StringValueMatch::new() - } - } - - // .bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.IsSetMatch is_set_match = 3; - - pub fn is_set_match(&self) -> &IsSetMatch { - match self.value_match { - ::std::option::Option::Some(feature_flag_match::Value_match::IsSetMatch(ref v)) => v, - _ => ::default_instance(), - } - } - - pub fn clear_is_set_match(&mut self) { - self.value_match = ::std::option::Option::None; - } - - pub fn has_is_set_match(&self) -> bool { - match self.value_match { - ::std::option::Option::Some(feature_flag_match::Value_match::IsSetMatch(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_is_set_match(&mut self, v: IsSetMatch) { - self.value_match = ::std::option::Option::Some(feature_flag_match::Value_match::IsSetMatch(v)) - } - - // Mutable pointer to the field. - pub fn mut_is_set_match(&mut self) -> &mut IsSetMatch { - if let ::std::option::Option::Some(feature_flag_match::Value_match::IsSetMatch(_)) = self.value_match { - } else { - self.value_match = ::std::option::Option::Some(feature_flag_match::Value_match::IsSetMatch(IsSetMatch::new())); - } - match self.value_match { - ::std::option::Option::Some(feature_flag_match::Value_match::IsSetMatch(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_is_set_match(&mut self) -> IsSetMatch { - if self.has_is_set_match() { - match self.value_match.take() { - ::std::option::Option::Some(feature_flag_match::Value_match::IsSetMatch(v)) => v, - _ => panic!(), - } - } else { - IsSetMatch::new() - } - } - pub(in super::super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { let mut fields = ::std::vec::Vec::with_capacity(3); - let mut oneofs = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "flag_name", - |m: &FeatureFlagMatch| { &m.flag_name }, - |m: &mut FeatureFlagMatch| { &mut m.flag_name }, + "scope", + |m: &StateMatch| { &m.scope }, + |m: &mut StateMatch| { &mut m.scope }, )); - fields.push(::protobuf::reflect::rt::v2::make_oneof_message_has_get_mut_set_accessor::<_, StringValueMatch>( - "string_value_match", - FeatureFlagMatch::has_string_value_match, - FeatureFlagMatch::string_value_match, - FeatureFlagMatch::mut_string_value_match, - FeatureFlagMatch::set_string_value_match, + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "state_key", + |m: &StateMatch| { &m.state_key }, + |m: &mut StateMatch| { &mut m.state_key }, )); - fields.push(::protobuf::reflect::rt::v2::make_oneof_message_has_get_mut_set_accessor::<_, IsSetMatch>( - "is_set_match", - FeatureFlagMatch::has_is_set_match, - FeatureFlagMatch::is_set_match, - FeatureFlagMatch::mut_is_set_match, - FeatureFlagMatch::set_is_set_match, + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::super::super::matcher::StateValueMatch>( + "state_value_match", + |m: &StateMatch| { &m.state_value_match }, + |m: &mut StateMatch| { &mut m.state_value_match }, )); - oneofs.push(feature_flag_match::Value_match::generated_oneof_descriptor_data()); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "LogMatcher.BaseLogMatcher.FeatureFlagMatch", + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "LogMatcher.BaseLogMatcher.StateMatch", fields, oneofs, ) } } - impl ::protobuf::Message for FeatureFlagMatch { - const NAME: &'static str = "FeatureFlagMatch"; + impl ::protobuf::Message for StateMatch { + const NAME: &'static str = "StateMatch"; fn is_initialized(&self) -> bool { true @@ -2654,14 +1479,14 @@ pub mod log_matcher { fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { while let Some(tag) = is.read_raw_tag_or_eof()? { match tag { - 10 => { - self.flag_name = is.read_string()?; + 8 => { + self.scope = is.read_enum_or_unknown()?; }, 18 => { - self.value_match = ::std::option::Option::Some(feature_flag_match::Value_match::StringValueMatch(is.read_message()?)); + self.state_key = is.read_string()?; }, 26 => { - self.value_match = ::std::option::Option::Some(feature_flag_match::Value_match::IsSetMatch(is.read_message()?)); + ::protobuf::rt::read_singular_message_into_field(is, &mut self.state_value_match)?; }, tag => { ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; @@ -2675,20 +1500,15 @@ pub mod log_matcher { #[allow(unused_variables)] fn compute_size(&self) -> u64 { let mut my_size = 0; - if !self.flag_name.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.flag_name); + if self.scope != ::protobuf::EnumOrUnknown::new(super::super::super::scope::StateScope::UNSPECIFIED) { + my_size += ::protobuf::rt::int32_size(1, self.scope.value()); } - if let ::std::option::Option::Some(ref v) = self.value_match { - match v { - &feature_flag_match::Value_match::StringValueMatch(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - }, - &feature_flag_match::Value_match::IsSetMatch(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - }, - }; + if !self.state_key.is_empty() { + my_size += ::protobuf::rt::string_size(2, &self.state_key); + } + if let Some(v) = self.state_value_match.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; } my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); self.special_fields.cached_size().set(my_size as u32); @@ -2696,18 +1516,14 @@ pub mod log_matcher { } fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - if !self.flag_name.is_empty() { - os.write_string(1, &self.flag_name)?; + if self.scope != ::protobuf::EnumOrUnknown::new(super::super::super::scope::StateScope::UNSPECIFIED) { + os.write_enum(1, ::protobuf::EnumOrUnknown::value(&self.scope))?; } - if let ::std::option::Option::Some(ref v) = self.value_match { - match v { - &feature_flag_match::Value_match::StringValueMatch(ref v) => { - ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; - }, - &feature_flag_match::Value_match::IsSetMatch(ref v) => { - ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; - }, - }; + if !self.state_key.is_empty() { + os.write_string(2, &self.state_key)?; + } + if let Some(v) = self.state_value_match.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; } os.write_unknown_fields(self.special_fields.unknown_fields())?; ::std::result::Result::Ok(()) @@ -2721,164 +1537,44 @@ pub mod log_matcher { &mut self.special_fields } - fn new() -> FeatureFlagMatch { - FeatureFlagMatch::new() + fn new() -> StateMatch { + StateMatch::new() } fn clear(&mut self) { - self.flag_name.clear(); - self.value_match = ::std::option::Option::None; - self.value_match = ::std::option::Option::None; + self.scope = ::protobuf::EnumOrUnknown::new(super::super::super::scope::StateScope::UNSPECIFIED); + self.state_key.clear(); + self.state_value_match.clear(); self.special_fields.clear(); } - fn default_instance() -> &'static FeatureFlagMatch { - static instance: FeatureFlagMatch = FeatureFlagMatch { - flag_name: ::std::string::String::new(), - value_match: ::std::option::Option::None, + fn default_instance() -> &'static StateMatch { + static instance: StateMatch = StateMatch { + scope: ::protobuf::EnumOrUnknown::from_i32(0), + state_key: ::std::string::String::new(), + state_value_match: ::protobuf::MessageField::none(), special_fields: ::protobuf::SpecialFields::new(), }; &instance } } - impl ::protobuf::MessageFull for FeatureFlagMatch { + impl ::protobuf::MessageFull for StateMatch { fn descriptor() -> ::protobuf::reflect::MessageDescriptor { static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| super::super::file_descriptor().message_by_package_relative_name("LogMatcher.BaseLogMatcher.FeatureFlagMatch").unwrap()).clone() + descriptor.get(|| super::super::file_descriptor().message_by_package_relative_name("LogMatcher.BaseLogMatcher.StateMatch").unwrap()).clone() } } - impl ::std::fmt::Display for FeatureFlagMatch { + impl ::std::fmt::Display for StateMatch { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } - impl ::protobuf::reflect::ProtobufValue for FeatureFlagMatch { + impl ::protobuf::reflect::ProtobufValue for StateMatch { type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; } - - /// Nested message and enums of message `FeatureFlagMatch` - pub mod feature_flag_match { - - #[derive(Clone,PartialEq,Debug)] - // @@protoc_insertion_point(oneof:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.FeatureFlagMatch.value_match) - pub enum Value_match { - // @@protoc_insertion_point(oneof_field:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.FeatureFlagMatch.string_value_match) - StringValueMatch(super::StringValueMatch), - // @@protoc_insertion_point(oneof_field:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.FeatureFlagMatch.is_set_match) - IsSetMatch(super::IsSetMatch), - } - - impl ::protobuf::Oneof for Value_match { - } - - impl ::protobuf::OneofFull for Value_match { - fn descriptor() -> ::protobuf::reflect::OneofDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::OneofDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| ::descriptor().oneof_by_name("value_match").unwrap()).clone() - } - } - - impl Value_match { - pub(in super::super::super) fn generated_oneof_descriptor_data() -> ::protobuf::reflect::GeneratedOneofDescriptorData { - ::protobuf::reflect::GeneratedOneofDescriptorData::new::("value_match") - } - } - } - - #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] - // @@protoc_insertion_point(enum:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.Operator) - pub enum Operator { - // @@protoc_insertion_point(enum_value:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.Operator.OPERATOR_UNSPECIFIED) - OPERATOR_UNSPECIFIED = 0, - // @@protoc_insertion_point(enum_value:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.Operator.OPERATOR_LESS_THAN) - OPERATOR_LESS_THAN = 1, - // @@protoc_insertion_point(enum_value:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.Operator.OPERATOR_LESS_THAN_OR_EQUAL) - OPERATOR_LESS_THAN_OR_EQUAL = 2, - // @@protoc_insertion_point(enum_value:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.Operator.OPERATOR_EQUALS) - OPERATOR_EQUALS = 3, - // @@protoc_insertion_point(enum_value:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.Operator.OPERATOR_GREATER_THAN) - OPERATOR_GREATER_THAN = 4, - // @@protoc_insertion_point(enum_value:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.Operator.OPERATOR_GREATER_THAN_OR_EQUAL) - OPERATOR_GREATER_THAN_OR_EQUAL = 5, - // @@protoc_insertion_point(enum_value:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.Operator.OPERATOR_NOT_EQUALS) - OPERATOR_NOT_EQUALS = 6, - // @@protoc_insertion_point(enum_value:bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.Operator.OPERATOR_REGEX) - OPERATOR_REGEX = 7, - } - - impl ::protobuf::Enum for Operator { - const NAME: &'static str = "Operator"; - - fn value(&self) -> i32 { - *self as i32 - } - - fn from_i32(value: i32) -> ::std::option::Option { - match value { - 0 => ::std::option::Option::Some(Operator::OPERATOR_UNSPECIFIED), - 1 => ::std::option::Option::Some(Operator::OPERATOR_LESS_THAN), - 2 => ::std::option::Option::Some(Operator::OPERATOR_LESS_THAN_OR_EQUAL), - 3 => ::std::option::Option::Some(Operator::OPERATOR_EQUALS), - 4 => ::std::option::Option::Some(Operator::OPERATOR_GREATER_THAN), - 5 => ::std::option::Option::Some(Operator::OPERATOR_GREATER_THAN_OR_EQUAL), - 6 => ::std::option::Option::Some(Operator::OPERATOR_NOT_EQUALS), - 7 => ::std::option::Option::Some(Operator::OPERATOR_REGEX), - _ => ::std::option::Option::None - } - } - - fn from_str(str: &str) -> ::std::option::Option { - match str { - "OPERATOR_UNSPECIFIED" => ::std::option::Option::Some(Operator::OPERATOR_UNSPECIFIED), - "OPERATOR_LESS_THAN" => ::std::option::Option::Some(Operator::OPERATOR_LESS_THAN), - "OPERATOR_LESS_THAN_OR_EQUAL" => ::std::option::Option::Some(Operator::OPERATOR_LESS_THAN_OR_EQUAL), - "OPERATOR_EQUALS" => ::std::option::Option::Some(Operator::OPERATOR_EQUALS), - "OPERATOR_GREATER_THAN" => ::std::option::Option::Some(Operator::OPERATOR_GREATER_THAN), - "OPERATOR_GREATER_THAN_OR_EQUAL" => ::std::option::Option::Some(Operator::OPERATOR_GREATER_THAN_OR_EQUAL), - "OPERATOR_NOT_EQUALS" => ::std::option::Option::Some(Operator::OPERATOR_NOT_EQUALS), - "OPERATOR_REGEX" => ::std::option::Option::Some(Operator::OPERATOR_REGEX), - _ => ::std::option::Option::None - } - } - - const VALUES: &'static [Operator] = &[ - Operator::OPERATOR_UNSPECIFIED, - Operator::OPERATOR_LESS_THAN, - Operator::OPERATOR_LESS_THAN_OR_EQUAL, - Operator::OPERATOR_EQUALS, - Operator::OPERATOR_GREATER_THAN, - Operator::OPERATOR_GREATER_THAN_OR_EQUAL, - Operator::OPERATOR_NOT_EQUALS, - Operator::OPERATOR_REGEX, - ]; - } - - impl ::protobuf::EnumFull for Operator { - fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| super::super::file_descriptor().enum_by_package_relative_name("LogMatcher.BaseLogMatcher.Operator").unwrap()).clone() - } - - fn descriptor(&self) -> ::protobuf::reflect::EnumValueDescriptor { - let index = *self as usize; - Self::enum_descriptor().value_by_index(index) - } - } - - impl ::std::default::Default for Operator { - fn default() -> Self { - Operator::OPERATOR_UNSPECIFIED - } - } - - impl Operator { - pub(in super::super) fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { - ::protobuf::reflect::GeneratedEnumDescriptorData::new::("LogMatcher.BaseLogMatcher.Operator") - } - } } // @@protoc_insertion_point(message:bitdrift_public.protobuf.matcher.v1.LogMatcher.MatcherList) @@ -3007,67 +1703,42 @@ pub mod log_matcher { static file_descriptor_proto_data: &'static [u8] = b"\ \n5bitdrift_public/protobuf/matcher/v1/log_matcher.proto\x12#bitdrift_pu\ - blic.protobuf.matcher.v1\x1a\x17validate/validate.proto\"\xe9\x18\n\nLog\ - Matcher\x12c\n\x0cbase_matcher\x18\x01\x20\x01(\x0b2>.bitdrift_public.pr\ - otobuf.matcher.v1.LogMatcher.BaseLogMatcherH\0R\x0bbaseMatcher\x12\\\n\n\ - or_matcher\x18\x02\x20\x01(\x0b2;.bitdrift_public.protobuf.matcher.v1.Lo\ - gMatcher.MatcherListH\0R\torMatcher\x12^\n\x0band_matcher\x18\x03\x20\ - \x01(\x0b2;.bitdrift_public.protobuf.matcher.v1.LogMatcher.MatcherListH\ - \0R\nandMatcher\x12R\n\x0bnot_matcher\x18\x04\x20\x01(\x0b2/.bitdrift_pu\ - blic.protobuf.matcher.v1.LogMatcherH\0R\nnotMatcher\x1a\xe6\x14\n\x0eBas\ - eLogMatcher\x12r\n\rmessage_match\x18\x01\x20\x01(\x0b2K.bitdrift_public\ - .protobuf.matcher.v1.LogMatcher.BaseLogMatcher.MessageMatchH\0R\x0cmessa\ - geMatch\x12f\n\ttag_match\x18\x02\x20\x01(\x0b2G.bitdrift_public.protobu\ - f.matcher.v1.LogMatcher.BaseLogMatcher.TagMatchH\0R\x08tagMatch\x12\x7f\ - \n\x12feature_flag_match\x18\x03\x20\x01(\x0b2O.bitdrift_public.protobuf\ - .matcher.v1.LogMatcher.BaseLogMatcher.FeatureFlagMatchH\0R\x10featureFla\ - gMatch\x1a\xee\x01\n\x10StringValueMatch\x12m\n\x08operator\x18\x01\x20\ - \x01(\x0e2G.bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatche\ - r.OperatorR\x08operatorB\x08\xfaB\x05\x82\x01\x02\x10\x01\x12*\n\x0bmatc\ - h_value\x18\x02\x20\x01(\tH\0R\nmatchValueB\x07\xfaB\x04r\x02\x10\x01\ - \x12$\n\rsave_field_id\x18\x03\x20\x01(\tH\0R\x0bsaveFieldIdB\x19\n\x17s\ - tring_value_match_type\x1a\xdf\x01\n\rIntValueMatch\x12m\n\x08operator\ - \x18\x01\x20\x01(\x0e2G.bitdrift_public.protobuf.matcher.v1.LogMatcher.B\ - aseLogMatcher.OperatorR\x08operatorB\x08\xfaB\x05\x82\x01\x02\x10\x01\ - \x12!\n\x0bmatch_value\x18\x02\x20\x01(\x05H\0R\nmatchValue\x12$\n\rsave\ - _field_id\x18\x03\x20\x01(\tH\0R\x0bsaveFieldIdB\x16\n\x14int_value_matc\ - h_type\x1a\xe5\x01\n\x10DoubleValueMatch\x12m\n\x08operator\x18\x01\x20\ - \x01(\x0e2G.bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatche\ - r.OperatorR\x08operatorB\x08\xfaB\x05\x82\x01\x02\x10\x01\x12!\n\x0bmatc\ - h_value\x18\x02\x20\x01(\x01H\0R\nmatchValue\x12$\n\rsave_field_id\x18\ - \x03\x20\x01(\tH\0R\x0bsaveFieldIdB\x19\n\x17double_value_match_type\x1a\ - \xab\x01\n\x10SemVerValueMatch\x12m\n\x08operator\x18\x01\x20\x01(\x0e2G\ - .bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.OperatorR\ - \x08operatorB\x08\xfaB\x05\x82\x01\x02\x10\x01\x12(\n\x0bmatch_value\x18\ - \x02\x20\x01(\tR\nmatchValueB\x07\xfaB\x04r\x02\x10\x01\x1a\x8d\x01\n\ - \x0cMessageMatch\x12}\n\x12string_value_match\x18\x01\x20\x01(\x0b2O.bit\ - drift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.StringValueMa\ - tchR\x10stringValueMatch\x1a\x0c\n\nIsSetMatch\x1a\xae\x05\n\x08TagMatch\ - \x12\"\n\x07tag_key\x18\x01\x20\x01(\tR\x06tagKeyB\t\xfaB\x06r\x04\x10\ - \x01\x18@\x12\x7f\n\x12string_value_match\x18\x02\x20\x01(\x0b2O.bitdrif\ - t_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.StringValueMatchH\ - \0R\x10stringValueMatch\x12v\n\x0fint_value_match\x18\x03\x20\x01(\x0b2L\ - .bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.IntValueM\ - atchH\0R\rintValueMatch\x12\x80\x01\n\x13sem_ver_value_match\x18\x04\x20\ - \x01(\x0b2O.bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatche\ - r.SemVerValueMatchH\0R\x10semVerValueMatch\x12m\n\x0cis_set_match\x18\ - \x05\x20\x01(\x0b2I.bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseL\ - ogMatcher.IsSetMatchH\0R\nisSetMatch\x12\x7f\n\x12double_value_match\x18\ - \x06\x20\x01(\x0b2O.bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseL\ - ogMatcher.DoubleValueMatchH\0R\x10doubleValueMatchB\x12\n\x0bvalue_match\ - \x12\x03\xf8B\x01\x1a\xbe\x02\n\x10FeatureFlagMatch\x12&\n\tflag_name\ - \x18\x01\x20\x01(\tR\x08flagNameB\t\xfaB\x06r\x04\x10\x01\x18@\x12\x7f\n\ - \x12string_value_match\x18\x02\x20\x01(\x0b2O.bitdrift_public.protobuf.m\ - atcher.v1.LogMatcher.BaseLogMatcher.StringValueMatchH\0R\x10stringValueM\ - atch\x12m\n\x0cis_set_match\x18\x03\x20\x01(\x0b2I.bitdrift_public.proto\ - buf.matcher.v1.LogMatcher.BaseLogMatcher.IsSetMatchH\0R\nisSetMatchB\x12\ - \n\x0bvalue_match\x12\x03\xf8B\x01\"\xea\x01\n\x08Operator\x12\x18\n\x14\ - OPERATOR_UNSPECIFIED\x10\0\x12\x16\n\x12OPERATOR_LESS_THAN\x10\x01\x12\ - \x1f\n\x1bOPERATOR_LESS_THAN_OR_EQUAL\x10\x02\x12\x13\n\x0fOPERATOR_EQUA\ - LS\x10\x03\x12\x19\n\x15OPERATOR_GREATER_THAN\x10\x04\x12\"\n\x1eOPERATO\ - R_GREATER_THAN_OR_EQUAL\x10\x05\x12\x17\n\x13OPERATOR_NOT_EQUALS\x10\x06\ - \x12\x12\n\x0eOPERATOR_REGEX\x10\x07\"\x04\x08\x08\x10\x08\"\x04\x08\t\ - \x10\tB\x11\n\nmatch_type\x12\x03\xf8B\x01\x1ak\n\x0bMatcherList\x12\\\n\ + blic.protobuf.matcher.v1\x1a/bitdrift_public/protobuf/state/v1/matcher.p\ + roto\x1a-bitdrift_public/protobuf/state/v1/scope.proto\x1a=bitdrift_publ\ + ic/protobuf/value_matcher/v1/value_matcher.proto\x1a\x17validate/validat\ + e.proto\"\xab\x0e\n\nLogMatcher\x12c\n\x0cbase_matcher\x18\x01\x20\x01(\ + \x0b2>.bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcherH\0R\ + \x0bbaseMatcher\x12\\\n\nor_matcher\x18\x02\x20\x01(\x0b2;.bitdrift_publ\ + ic.protobuf.matcher.v1.LogMatcher.MatcherListH\0R\torMatcher\x12^\n\x0ba\ + nd_matcher\x18\x03\x20\x01(\x0b2;.bitdrift_public.protobuf.matcher.v1.Lo\ + gMatcher.MatcherListH\0R\nandMatcher\x12R\n\x0bnot_matcher\x18\x04\x20\ + \x01(\x0b2/.bitdrift_public.protobuf.matcher.v1.LogMatcherH\0R\nnotMatch\ + er\x1a\xa8\n\n\x0eBaseLogMatcher\x12r\n\rmessage_match\x18\x01\x20\x01(\ + \x0b2K.bitdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.Mes\ + sageMatchH\0R\x0cmessageMatch\x12f\n\ttag_match\x18\x02\x20\x01(\x0b2G.b\ + itdrift_public.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.TagMatchH\0\ + R\x08tagMatch\x12l\n\x0bstate_match\x18\x04\x20\x01(\x0b2I.bitdrift_publ\ + ic.protobuf.matcher.v1.LogMatcher.BaseLogMatcher.StateMatchH\0R\nstateMa\ + tch\x1ay\n\x0cMessageMatch\x12i\n\x12string_value_match\x18\x01\x20\x01(\ + \x0b2;.bitdrift_public.protobuf.value_matcher.v1.StringValueMatchR\x10st\ + ringValueMatch\x1a\xc9\x04\n\x08TagMatch\x12\"\n\x07tag_key\x18\x01\x20\ + \x01(\tR\x06tagKeyB\t\xfaB\x06r\x04\x10\x01\x18@\x12k\n\x12string_value_\ + match\x18\x02\x20\x01(\x0b2;.bitdrift_public.protobuf.value_matcher.v1.S\ + tringValueMatchH\0R\x10stringValueMatch\x12b\n\x0fint_value_match\x18\ + \x03\x20\x01(\x0b28.bitdrift_public.protobuf.value_matcher.v1.IntValueMa\ + tchH\0R\rintValueMatch\x12l\n\x13sem_ver_value_match\x18\x04\x20\x01(\ + \x0b2;.bitdrift_public.protobuf.value_matcher.v1.SemVerValueMatchH\0R\ + \x10semVerValueMatch\x12Y\n\x0cis_set_match\x18\x05\x20\x01(\x0b25.bitdr\ + ift_public.protobuf.value_matcher.v1.IsSetMatchH\0R\nisSetMatch\x12k\n\ + \x12double_value_match\x18\x06\x20\x01(\x0b2;.bitdrift_public.protobuf.v\ + alue_matcher.v1.DoubleValueMatchH\0R\x10doubleValueMatchB\x12\n\x0bvalue\ + _match\x12\x03\xf8B\x01\x1a\xeb\x01\n\nStateMatch\x12M\n\x05scope\x18\ + \x01\x20\x01(\x0e2-.bitdrift_public.protobuf.state.v1.StateScopeR\x05sco\ + peB\x08\xfaB\x05\x82\x01\x02\x10\x01\x12$\n\tstate_key\x18\x02\x20\x01(\ + \tR\x08stateKeyB\x07\xfaB\x04r\x02\x10\x01\x12h\n\x11state_value_match\ + \x18\x03\x20\x01(\x0b22.bitdrift_public.protobuf.state.v1.StateValueMatc\ + hR\x0fstateValueMatchB\x08\xfaB\x05\x8a\x01\x02\x10\x01B\x11\n\nmatch_ty\ + pe\x12\x03\xf8B\x01J\x04\x08\x03\x10\x04\x1ak\n\x0bMatcherList\x12\\\n\ \x0clog_matchers\x18\x01\x20\x03(\x0b2/.bitdrift_public.protobuf.matcher\ .v1.LogMatcherR\x0blogMatchersB\x08\xfaB\x05\x92\x01\x02\x08\x02B\x0e\n\ \x07matcher\x12\x03\xf8B\x01b\x06proto3\ @@ -3087,22 +1758,19 @@ pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); file_descriptor.get(|| { let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { - let mut deps = ::std::vec::Vec::with_capacity(1); + let mut deps = ::std::vec::Vec::with_capacity(4); + deps.push(super::matcher::file_descriptor().clone()); + deps.push(super::scope::file_descriptor().clone()); + deps.push(super::value_matcher::file_descriptor().clone()); deps.push(super::validate::file_descriptor().clone()); - let mut messages = ::std::vec::Vec::with_capacity(11); + let mut messages = ::std::vec::Vec::with_capacity(6); messages.push(LogMatcher::generated_message_descriptor_data()); messages.push(log_matcher::BaseLogMatcher::generated_message_descriptor_data()); messages.push(log_matcher::MatcherList::generated_message_descriptor_data()); - messages.push(log_matcher::base_log_matcher::StringValueMatch::generated_message_descriptor_data()); - messages.push(log_matcher::base_log_matcher::IntValueMatch::generated_message_descriptor_data()); - messages.push(log_matcher::base_log_matcher::DoubleValueMatch::generated_message_descriptor_data()); - messages.push(log_matcher::base_log_matcher::SemVerValueMatch::generated_message_descriptor_data()); messages.push(log_matcher::base_log_matcher::MessageMatch::generated_message_descriptor_data()); - messages.push(log_matcher::base_log_matcher::IsSetMatch::generated_message_descriptor_data()); messages.push(log_matcher::base_log_matcher::TagMatch::generated_message_descriptor_data()); - messages.push(log_matcher::base_log_matcher::FeatureFlagMatch::generated_message_descriptor_data()); - let mut enums = ::std::vec::Vec::with_capacity(1); - enums.push(log_matcher::base_log_matcher::Operator::generated_enum_descriptor_data()); + messages.push(log_matcher::base_log_matcher::StateMatch::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(0); ::protobuf::reflect::GeneratedFileDescriptor::new_generated( file_descriptor_proto(), deps, diff --git a/bd-proto/src/protos/log_matcher/mod.rs b/bd-proto/src/protos/log_matcher/mod.rs index 3478e714d..12d38acac 100644 --- a/bd-proto/src/protos/log_matcher/mod.rs +++ b/bd-proto/src/protos/log_matcher/mod.rs @@ -7,4 +7,6 @@ pub mod log_matcher; +use super::state::{matcher, scope}; +use super::value_matcher::value_matcher; use bd_pgv::generated::protos::validate; diff --git a/bd-proto/src/protos/mod.rs b/bd-proto/src/protos/mod.rs index 4ea21e924..01eb69a26 100644 --- a/bd-proto/src/protos/mod.rs +++ b/bd-proto/src/protos/mod.rs @@ -18,4 +18,5 @@ pub mod mme; pub mod prometheus; pub mod pulse; pub mod state; +pub mod value_matcher; pub mod workflow; diff --git a/bd-proto/src/protos/state/matcher.rs b/bd-proto/src/protos/state/matcher.rs new file mode 100644 index 000000000..90f7fbd0f --- /dev/null +++ b/bd-proto/src/protos/state/matcher.rs @@ -0,0 +1,493 @@ +// proto - bitdrift's client/server API definitions +// Copyright Bitdrift, Inc. All rights reserved. +// +// Use of this source code and APIs are governed by a source available license that can be found in +// the LICENSE file or at: +// https://polyformproject.org/wp-content/uploads/2020/06/PolyForm-Shield-1.0.0.txt + +// This file is generated by rust-protobuf 4.0.0-alpha.0. Do not edit +// .proto file is parsed by protoc 33.1 +// @generated + +// https://github.com/rust-lang/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![allow(unused_attributes)] +#![cfg_attr(rustfmt, rustfmt::skip)] + +#![allow(dead_code)] +#![allow(missing_docs)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(non_upper_case_globals)] +#![allow(trivial_casts)] +#![allow(unused_results)] +#![allow(unused_mut)] + +//! Generated file from `bitdrift_public/protobuf/state/v1/matcher.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_4_0_0_ALPHA_0; + +// @@protoc_insertion_point(message:bitdrift_public.protobuf.state.v1.StateValueMatch) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct StateValueMatch { + // message oneof groups + pub value_match: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:bitdrift_public.protobuf.state.v1.StateValueMatch.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a StateValueMatch { + fn default() -> &'a StateValueMatch { + ::default_instance() + } +} + +impl StateValueMatch { + pub fn new() -> StateValueMatch { + ::std::default::Default::default() + } + + // .bitdrift_public.protobuf.value_matcher.v1.StringValueMatch string_value_match = 3; + + pub fn string_value_match(&self) -> &super::value_matcher::StringValueMatch { + match self.value_match { + ::std::option::Option::Some(state_value_match::Value_match::StringValueMatch(ref v)) => v, + _ => ::default_instance(), + } + } + + pub fn clear_string_value_match(&mut self) { + self.value_match = ::std::option::Option::None; + } + + pub fn has_string_value_match(&self) -> bool { + match self.value_match { + ::std::option::Option::Some(state_value_match::Value_match::StringValueMatch(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_string_value_match(&mut self, v: super::value_matcher::StringValueMatch) { + self.value_match = ::std::option::Option::Some(state_value_match::Value_match::StringValueMatch(v)) + } + + // Mutable pointer to the field. + pub fn mut_string_value_match(&mut self) -> &mut super::value_matcher::StringValueMatch { + if let ::std::option::Option::Some(state_value_match::Value_match::StringValueMatch(_)) = self.value_match { + } else { + self.value_match = ::std::option::Option::Some(state_value_match::Value_match::StringValueMatch(super::value_matcher::StringValueMatch::new())); + } + match self.value_match { + ::std::option::Option::Some(state_value_match::Value_match::StringValueMatch(ref mut v)) => v, + _ => panic!(), + } + } + + // Take field + pub fn take_string_value_match(&mut self) -> super::value_matcher::StringValueMatch { + if self.has_string_value_match() { + match self.value_match.take() { + ::std::option::Option::Some(state_value_match::Value_match::StringValueMatch(v)) => v, + _ => panic!(), + } + } else { + super::value_matcher::StringValueMatch::new() + } + } + + // .bitdrift_public.protobuf.value_matcher.v1.IntValueMatch int_value_match = 4; + + pub fn int_value_match(&self) -> &super::value_matcher::IntValueMatch { + match self.value_match { + ::std::option::Option::Some(state_value_match::Value_match::IntValueMatch(ref v)) => v, + _ => ::default_instance(), + } + } + + pub fn clear_int_value_match(&mut self) { + self.value_match = ::std::option::Option::None; + } + + pub fn has_int_value_match(&self) -> bool { + match self.value_match { + ::std::option::Option::Some(state_value_match::Value_match::IntValueMatch(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_int_value_match(&mut self, v: super::value_matcher::IntValueMatch) { + self.value_match = ::std::option::Option::Some(state_value_match::Value_match::IntValueMatch(v)) + } + + // Mutable pointer to the field. + pub fn mut_int_value_match(&mut self) -> &mut super::value_matcher::IntValueMatch { + if let ::std::option::Option::Some(state_value_match::Value_match::IntValueMatch(_)) = self.value_match { + } else { + self.value_match = ::std::option::Option::Some(state_value_match::Value_match::IntValueMatch(super::value_matcher::IntValueMatch::new())); + } + match self.value_match { + ::std::option::Option::Some(state_value_match::Value_match::IntValueMatch(ref mut v)) => v, + _ => panic!(), + } + } + + // Take field + pub fn take_int_value_match(&mut self) -> super::value_matcher::IntValueMatch { + if self.has_int_value_match() { + match self.value_match.take() { + ::std::option::Option::Some(state_value_match::Value_match::IntValueMatch(v)) => v, + _ => panic!(), + } + } else { + super::value_matcher::IntValueMatch::new() + } + } + + // .bitdrift_public.protobuf.value_matcher.v1.DoubleValueMatch double_value_match = 5; + + pub fn double_value_match(&self) -> &super::value_matcher::DoubleValueMatch { + match self.value_match { + ::std::option::Option::Some(state_value_match::Value_match::DoubleValueMatch(ref v)) => v, + _ => ::default_instance(), + } + } + + pub fn clear_double_value_match(&mut self) { + self.value_match = ::std::option::Option::None; + } + + pub fn has_double_value_match(&self) -> bool { + match self.value_match { + ::std::option::Option::Some(state_value_match::Value_match::DoubleValueMatch(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_double_value_match(&mut self, v: super::value_matcher::DoubleValueMatch) { + self.value_match = ::std::option::Option::Some(state_value_match::Value_match::DoubleValueMatch(v)) + } + + // Mutable pointer to the field. + pub fn mut_double_value_match(&mut self) -> &mut super::value_matcher::DoubleValueMatch { + if let ::std::option::Option::Some(state_value_match::Value_match::DoubleValueMatch(_)) = self.value_match { + } else { + self.value_match = ::std::option::Option::Some(state_value_match::Value_match::DoubleValueMatch(super::value_matcher::DoubleValueMatch::new())); + } + match self.value_match { + ::std::option::Option::Some(state_value_match::Value_match::DoubleValueMatch(ref mut v)) => v, + _ => panic!(), + } + } + + // Take field + pub fn take_double_value_match(&mut self) -> super::value_matcher::DoubleValueMatch { + if self.has_double_value_match() { + match self.value_match.take() { + ::std::option::Option::Some(state_value_match::Value_match::DoubleValueMatch(v)) => v, + _ => panic!(), + } + } else { + super::value_matcher::DoubleValueMatch::new() + } + } + + // .bitdrift_public.protobuf.value_matcher.v1.IsSetMatch is_set_match = 6; + + pub fn is_set_match(&self) -> &super::value_matcher::IsSetMatch { + match self.value_match { + ::std::option::Option::Some(state_value_match::Value_match::IsSetMatch(ref v)) => v, + _ => ::default_instance(), + } + } + + pub fn clear_is_set_match(&mut self) { + self.value_match = ::std::option::Option::None; + } + + pub fn has_is_set_match(&self) -> bool { + match self.value_match { + ::std::option::Option::Some(state_value_match::Value_match::IsSetMatch(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_is_set_match(&mut self, v: super::value_matcher::IsSetMatch) { + self.value_match = ::std::option::Option::Some(state_value_match::Value_match::IsSetMatch(v)) + } + + // Mutable pointer to the field. + pub fn mut_is_set_match(&mut self) -> &mut super::value_matcher::IsSetMatch { + if let ::std::option::Option::Some(state_value_match::Value_match::IsSetMatch(_)) = self.value_match { + } else { + self.value_match = ::std::option::Option::Some(state_value_match::Value_match::IsSetMatch(super::value_matcher::IsSetMatch::new())); + } + match self.value_match { + ::std::option::Option::Some(state_value_match::Value_match::IsSetMatch(ref mut v)) => v, + _ => panic!(), + } + } + + // Take field + pub fn take_is_set_match(&mut self) -> super::value_matcher::IsSetMatch { + if self.has_is_set_match() { + match self.value_match.take() { + ::std::option::Option::Some(state_value_match::Value_match::IsSetMatch(v)) => v, + _ => panic!(), + } + } else { + super::value_matcher::IsSetMatch::new() + } + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(4); + let mut oneofs = ::std::vec::Vec::with_capacity(1); + fields.push(::protobuf::reflect::rt::v2::make_oneof_message_has_get_mut_set_accessor::<_, super::value_matcher::StringValueMatch>( + "string_value_match", + StateValueMatch::has_string_value_match, + StateValueMatch::string_value_match, + StateValueMatch::mut_string_value_match, + StateValueMatch::set_string_value_match, + )); + fields.push(::protobuf::reflect::rt::v2::make_oneof_message_has_get_mut_set_accessor::<_, super::value_matcher::IntValueMatch>( + "int_value_match", + StateValueMatch::has_int_value_match, + StateValueMatch::int_value_match, + StateValueMatch::mut_int_value_match, + StateValueMatch::set_int_value_match, + )); + fields.push(::protobuf::reflect::rt::v2::make_oneof_message_has_get_mut_set_accessor::<_, super::value_matcher::DoubleValueMatch>( + "double_value_match", + StateValueMatch::has_double_value_match, + StateValueMatch::double_value_match, + StateValueMatch::mut_double_value_match, + StateValueMatch::set_double_value_match, + )); + fields.push(::protobuf::reflect::rt::v2::make_oneof_message_has_get_mut_set_accessor::<_, super::value_matcher::IsSetMatch>( + "is_set_match", + StateValueMatch::has_is_set_match, + StateValueMatch::is_set_match, + StateValueMatch::mut_is_set_match, + StateValueMatch::set_is_set_match, + )); + oneofs.push(state_value_match::Value_match::generated_oneof_descriptor_data()); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "StateValueMatch", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for StateValueMatch { + const NAME: &'static str = "StateValueMatch"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 26 => { + self.value_match = ::std::option::Option::Some(state_value_match::Value_match::StringValueMatch(is.read_message()?)); + }, + 34 => { + self.value_match = ::std::option::Option::Some(state_value_match::Value_match::IntValueMatch(is.read_message()?)); + }, + 42 => { + self.value_match = ::std::option::Option::Some(state_value_match::Value_match::DoubleValueMatch(is.read_message()?)); + }, + 50 => { + self.value_match = ::std::option::Option::Some(state_value_match::Value_match::IsSetMatch(is.read_message()?)); + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if let ::std::option::Option::Some(ref v) = self.value_match { + match v { + &state_value_match::Value_match::StringValueMatch(ref v) => { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }, + &state_value_match::Value_match::IntValueMatch(ref v) => { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }, + &state_value_match::Value_match::DoubleValueMatch(ref v) => { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }, + &state_value_match::Value_match::IsSetMatch(ref v) => { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }, + }; + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if let ::std::option::Option::Some(ref v) = self.value_match { + match v { + &state_value_match::Value_match::StringValueMatch(ref v) => { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; + }, + &state_value_match::Value_match::IntValueMatch(ref v) => { + ::protobuf::rt::write_message_field_with_cached_size(4, v, os)?; + }, + &state_value_match::Value_match::DoubleValueMatch(ref v) => { + ::protobuf::rt::write_message_field_with_cached_size(5, v, os)?; + }, + &state_value_match::Value_match::IsSetMatch(ref v) => { + ::protobuf::rt::write_message_field_with_cached_size(6, v, os)?; + }, + }; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> StateValueMatch { + StateValueMatch::new() + } + + fn clear(&mut self) { + self.value_match = ::std::option::Option::None; + self.value_match = ::std::option::Option::None; + self.value_match = ::std::option::Option::None; + self.value_match = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static StateValueMatch { + static instance: StateValueMatch = StateValueMatch { + value_match: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for StateValueMatch { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("StateValueMatch").unwrap()).clone() + } +} + +impl ::std::fmt::Display for StateValueMatch { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for StateValueMatch { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `StateValueMatch` +pub mod state_value_match { + + #[derive(Clone,PartialEq,Debug)] + // @@protoc_insertion_point(oneof:bitdrift_public.protobuf.state.v1.StateValueMatch.value_match) + pub enum Value_match { + // @@protoc_insertion_point(oneof_field:bitdrift_public.protobuf.state.v1.StateValueMatch.string_value_match) + StringValueMatch(super::super::value_matcher::StringValueMatch), + // @@protoc_insertion_point(oneof_field:bitdrift_public.protobuf.state.v1.StateValueMatch.int_value_match) + IntValueMatch(super::super::value_matcher::IntValueMatch), + // @@protoc_insertion_point(oneof_field:bitdrift_public.protobuf.state.v1.StateValueMatch.double_value_match) + DoubleValueMatch(super::super::value_matcher::DoubleValueMatch), + // @@protoc_insertion_point(oneof_field:bitdrift_public.protobuf.state.v1.StateValueMatch.is_set_match) + IsSetMatch(super::super::value_matcher::IsSetMatch), + } + + impl ::protobuf::Oneof for Value_match { + } + + impl ::protobuf::OneofFull for Value_match { + fn descriptor() -> ::protobuf::reflect::OneofDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::OneofDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| ::descriptor().oneof_by_name("value_match").unwrap()).clone() + } + } + + impl Value_match { + pub(in super) fn generated_oneof_descriptor_data() -> ::protobuf::reflect::GeneratedOneofDescriptorData { + ::protobuf::reflect::GeneratedOneofDescriptorData::new::("value_match") + } + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n/bitdrift_public/protobuf/state/v1/matcher.proto\x12!bitdrift_public.p\ + rotobuf.state.v1\x1a=bitdrift_public/protobuf/value_matcher/v1/value_mat\ + cher.proto\x1a\x17validate/validate.proto\"\xbe\x03\n\x0fStateValueMatch\ + \x12k\n\x12string_value_match\x18\x03\x20\x01(\x0b2;.bitdrift_public.pro\ + tobuf.value_matcher.v1.StringValueMatchH\0R\x10stringValueMatch\x12b\n\ + \x0fint_value_match\x18\x04\x20\x01(\x0b28.bitdrift_public.protobuf.valu\ + e_matcher.v1.IntValueMatchH\0R\rintValueMatch\x12k\n\x12double_value_mat\ + ch\x18\x05\x20\x01(\x0b2;.bitdrift_public.protobuf.value_matcher.v1.Doub\ + leValueMatchH\0R\x10doubleValueMatch\x12Y\n\x0cis_set_match\x18\x06\x20\ + \x01(\x0b25.bitdrift_public.protobuf.value_matcher.v1.IsSetMatchH\0R\nis\ + SetMatchB\x12\n\x0bvalue_match\x12\x03\xf8B\x01b\x06proto3\ +"; + +/// `FileDescriptorProto` object which was a source for this generated file +fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new(); + file_descriptor_proto_lazy.get(|| { + ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() + }) +} + +/// `FileDescriptor` object which allows dynamic access to files +pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { + static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new(); + static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); + file_descriptor.get(|| { + let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { + let mut deps = ::std::vec::Vec::with_capacity(2); + deps.push(super::value_matcher::file_descriptor().clone()); + deps.push(super::validate::file_descriptor().clone()); + let mut messages = ::std::vec::Vec::with_capacity(1); + messages.push(StateValueMatch::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/bd-proto/src/protos/state/mod.rs b/bd-proto/src/protos/state/mod.rs index fbb091fe2..db4a472bb 100644 --- a/bd-proto/src/protos/state/mod.rs +++ b/bd-proto/src/protos/state/mod.rs @@ -1 +1,6 @@ +pub mod matcher; pub mod payload; +pub mod scope; + +use super::value_matcher::value_matcher; +use bd_pgv::generated::protos::validate; diff --git a/bd-proto/src/protos/state/payload.rs b/bd-proto/src/protos/state/payload.rs index a9e63076a..6da790f4a 100644 --- a/bd-proto/src/protos/state/payload.rs +++ b/bd-proto/src/protos/state/payload.rs @@ -367,156 +367,13 @@ pub mod state_value { } } -// @@protoc_insertion_point(message:bitdrift_public.protobuf.state.v1.StateKeyValuePair) -#[derive(PartialEq,Clone,Default,Debug)] -pub struct StateKeyValuePair { - // message fields - // @@protoc_insertion_point(field:bitdrift_public.protobuf.state.v1.StateKeyValuePair.key) - pub key: ::std::string::String, - // @@protoc_insertion_point(field:bitdrift_public.protobuf.state.v1.StateKeyValuePair.value) - pub value: ::protobuf::MessageField, - // special fields - // @@protoc_insertion_point(special_field:bitdrift_public.protobuf.state.v1.StateKeyValuePair.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a StateKeyValuePair { - fn default() -> &'a StateKeyValuePair { - ::default_instance() - } -} - -impl StateKeyValuePair { - pub fn new() -> StateKeyValuePair { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(2); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "key", - |m: &StateKeyValuePair| { &m.key }, - |m: &mut StateKeyValuePair| { &mut m.key }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, StateValue>( - "value", - |m: &StateKeyValuePair| { &m.value }, - |m: &mut StateKeyValuePair| { &mut m.value }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "StateKeyValuePair", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for StateKeyValuePair { - const NAME: &'static str = "StateKeyValuePair"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 10 => { - self.key = is.read_string()?; - }, - 18 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.value)?; - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - if !self.key.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.key); - } - if let Some(v) = self.value.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - if !self.key.is_empty() { - os.write_string(1, &self.key)?; - } - if let Some(v) = self.value.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; - } - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> StateKeyValuePair { - StateKeyValuePair::new() - } - - fn clear(&mut self) { - self.key.clear(); - self.value.clear(); - self.special_fields.clear(); - } - - fn default_instance() -> &'static StateKeyValuePair { - static instance: StateKeyValuePair = StateKeyValuePair { - key: ::std::string::String::new(), - value: ::protobuf::MessageField::none(), - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for StateKeyValuePair { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("StateKeyValuePair").unwrap()).clone() - } -} - -impl ::std::fmt::Display for StateKeyValuePair { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for StateKeyValuePair { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - static file_descriptor_proto_data: &'static [u8] = b"\ \n/bitdrift_public/protobuf/state/v1/payload.proto\x12!bitdrift_public.p\ rotobuf.state.v1\"\xa4\x01\n\nStateValue\x12#\n\x0cstring_value\x18\x01\ \x20\x01(\tH\0R\x0bstringValue\x12\x1d\n\tint_value\x18\x02\x20\x01(\x03\ H\0R\x08intValue\x12#\n\x0cdouble_value\x18\x03\x20\x01(\x01H\0R\x0bdoub\ leValue\x12\x1f\n\nbool_value\x18\x04\x20\x01(\x08H\0R\tboolValueB\x0c\n\ - \nvalue_type\"j\n\x11StateKeyValuePair\x12\x10\n\x03key\x18\x01\x20\x01(\ - \tR\x03key\x12C\n\x05value\x18\x02\x20\x01(\x0b2-.bitdrift_public.protob\ - uf.state.v1.StateValueR\x05valueb\x06proto3\ + \nvalue_typeb\x06proto3\ "; /// `FileDescriptorProto` object which was a source for this generated file @@ -534,9 +391,8 @@ pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { file_descriptor.get(|| { let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { let mut deps = ::std::vec::Vec::with_capacity(0); - let mut messages = ::std::vec::Vec::with_capacity(2); + let mut messages = ::std::vec::Vec::with_capacity(1); messages.push(StateValue::generated_message_descriptor_data()); - messages.push(StateKeyValuePair::generated_message_descriptor_data()); let mut enums = ::std::vec::Vec::with_capacity(0); ::protobuf::reflect::GeneratedFileDescriptor::new_generated( file_descriptor_proto(), diff --git a/bd-proto/src/protos/state/scope.rs b/bd-proto/src/protos/state/scope.rs new file mode 100644 index 000000000..f3b34e3c5 --- /dev/null +++ b/bd-proto/src/protos/state/scope.rs @@ -0,0 +1,134 @@ +// proto - bitdrift's client/server API definitions +// Copyright Bitdrift, Inc. All rights reserved. +// +// Use of this source code and APIs are governed by a source available license that can be found in +// the LICENSE file or at: +// https://polyformproject.org/wp-content/uploads/2020/06/PolyForm-Shield-1.0.0.txt + +// This file is generated by rust-protobuf 4.0.0-alpha.0. Do not edit +// .proto file is parsed by protoc 33.1 +// @generated + +// https://github.com/rust-lang/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![allow(unused_attributes)] +#![cfg_attr(rustfmt, rustfmt::skip)] + +#![allow(dead_code)] +#![allow(missing_docs)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(non_upper_case_globals)] +#![allow(trivial_casts)] +#![allow(unused_results)] +#![allow(unused_mut)] + +//! Generated file from `bitdrift_public/protobuf/state/v1/scope.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_4_0_0_ALPHA_0; + +#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] +// @@protoc_insertion_point(enum:bitdrift_public.protobuf.state.v1.StateScope) +pub enum StateScope { + // @@protoc_insertion_point(enum_value:bitdrift_public.protobuf.state.v1.StateScope.UNSPECIFIED) + UNSPECIFIED = 0, + // @@protoc_insertion_point(enum_value:bitdrift_public.protobuf.state.v1.StateScope.FEATURE_FLAG) + FEATURE_FLAG = 1, + // @@protoc_insertion_point(enum_value:bitdrift_public.protobuf.state.v1.StateScope.GLOBAL_STATE) + GLOBAL_STATE = 2, +} + +impl ::protobuf::Enum for StateScope { + const NAME: &'static str = "StateScope"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(StateScope::UNSPECIFIED), + 1 => ::std::option::Option::Some(StateScope::FEATURE_FLAG), + 2 => ::std::option::Option::Some(StateScope::GLOBAL_STATE), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "UNSPECIFIED" => ::std::option::Option::Some(StateScope::UNSPECIFIED), + "FEATURE_FLAG" => ::std::option::Option::Some(StateScope::FEATURE_FLAG), + "GLOBAL_STATE" => ::std::option::Option::Some(StateScope::GLOBAL_STATE), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [StateScope] = &[ + StateScope::UNSPECIFIED, + StateScope::FEATURE_FLAG, + StateScope::GLOBAL_STATE, + ]; +} + +impl ::protobuf::EnumFull for StateScope { + fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().enum_by_package_relative_name("StateScope").unwrap()).clone() + } + + fn descriptor(&self) -> ::protobuf::reflect::EnumValueDescriptor { + let index = *self as usize; + Self::enum_descriptor().value_by_index(index) + } +} + +impl ::std::default::Default for StateScope { + fn default() -> Self { + StateScope::UNSPECIFIED + } +} + +impl StateScope { + fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("StateScope") + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n-bitdrift_public/protobuf/state/v1/scope.proto\x12!bitdrift_public.pro\ + tobuf.state.v1*A\n\nStateScope\x12\x0f\n\x0bUNSPECIFIED\x10\0\x12\x10\n\ + \x0cFEATURE_FLAG\x10\x01\x12\x10\n\x0cGLOBAL_STATE\x10\x02b\x06proto3\ +"; + +/// `FileDescriptorProto` object which was a source for this generated file +fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new(); + file_descriptor_proto_lazy.get(|| { + ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() + }) +} + +/// `FileDescriptor` object which allows dynamic access to files +pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { + static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new(); + static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); + file_descriptor.get(|| { + let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { + let mut deps = ::std::vec::Vec::with_capacity(0); + let mut messages = ::std::vec::Vec::with_capacity(0); + let mut enums = ::std::vec::Vec::with_capacity(1); + enums.push(StateScope::generated_enum_descriptor_data()); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/bd-proto/src/protos/value_matcher/mod.rs b/bd-proto/src/protos/value_matcher/mod.rs new file mode 100644 index 000000000..a01d70e16 --- /dev/null +++ b/bd-proto/src/protos/value_matcher/mod.rs @@ -0,0 +1,3 @@ +pub mod value_matcher; + +use bd_pgv::generated::protos::validate; diff --git a/bd-proto/src/protos/value_matcher/value_matcher.rs b/bd-proto/src/protos/value_matcher/value_matcher.rs new file mode 100644 index 000000000..54dde94f4 --- /dev/null +++ b/bd-proto/src/protos/value_matcher/value_matcher.rs @@ -0,0 +1,1262 @@ +// proto - bitdrift's client/server API definitions +// Copyright Bitdrift, Inc. All rights reserved. +// +// Use of this source code and APIs are governed by a source available license that can be found in +// the LICENSE file or at: +// https://polyformproject.org/wp-content/uploads/2020/06/PolyForm-Shield-1.0.0.txt + +// This file is generated by rust-protobuf 4.0.0-alpha.0. Do not edit +// .proto file is parsed by protoc 33.1 +// @generated + +// https://github.com/rust-lang/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![allow(unused_attributes)] +#![cfg_attr(rustfmt, rustfmt::skip)] + +#![allow(dead_code)] +#![allow(missing_docs)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(non_upper_case_globals)] +#![allow(trivial_casts)] +#![allow(unused_results)] +#![allow(unused_mut)] + +//! Generated file from `bitdrift_public/protobuf/value_matcher/v1/value_matcher.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_4_0_0_ALPHA_0; + +// @@protoc_insertion_point(message:bitdrift_public.protobuf.value_matcher.v1.StringValueMatch) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct StringValueMatch { + // message fields + // @@protoc_insertion_point(field:bitdrift_public.protobuf.value_matcher.v1.StringValueMatch.operator) + pub operator: ::protobuf::EnumOrUnknown, + // message oneof groups + pub string_value_match_type: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:bitdrift_public.protobuf.value_matcher.v1.StringValueMatch.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a StringValueMatch { + fn default() -> &'a StringValueMatch { + ::default_instance() + } +} + +impl StringValueMatch { + pub fn new() -> StringValueMatch { + ::std::default::Default::default() + } + + // string match_value = 2; + + pub fn match_value(&self) -> &str { + match self.string_value_match_type { + ::std::option::Option::Some(string_value_match::String_value_match_type::MatchValue(ref v)) => v, + _ => "", + } + } + + pub fn clear_match_value(&mut self) { + self.string_value_match_type = ::std::option::Option::None; + } + + pub fn has_match_value(&self) -> bool { + match self.string_value_match_type { + ::std::option::Option::Some(string_value_match::String_value_match_type::MatchValue(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_match_value(&mut self, v: ::std::string::String) { + self.string_value_match_type = ::std::option::Option::Some(string_value_match::String_value_match_type::MatchValue(v)) + } + + // Mutable pointer to the field. + pub fn mut_match_value(&mut self) -> &mut ::std::string::String { + if let ::std::option::Option::Some(string_value_match::String_value_match_type::MatchValue(_)) = self.string_value_match_type { + } else { + self.string_value_match_type = ::std::option::Option::Some(string_value_match::String_value_match_type::MatchValue(::std::string::String::new())); + } + match self.string_value_match_type { + ::std::option::Option::Some(string_value_match::String_value_match_type::MatchValue(ref mut v)) => v, + _ => panic!(), + } + } + + // Take field + pub fn take_match_value(&mut self) -> ::std::string::String { + if self.has_match_value() { + match self.string_value_match_type.take() { + ::std::option::Option::Some(string_value_match::String_value_match_type::MatchValue(v)) => v, + _ => panic!(), + } + } else { + ::std::string::String::new() + } + } + + // string save_field_id = 3; + + pub fn save_field_id(&self) -> &str { + match self.string_value_match_type { + ::std::option::Option::Some(string_value_match::String_value_match_type::SaveFieldId(ref v)) => v, + _ => "", + } + } + + pub fn clear_save_field_id(&mut self) { + self.string_value_match_type = ::std::option::Option::None; + } + + pub fn has_save_field_id(&self) -> bool { + match self.string_value_match_type { + ::std::option::Option::Some(string_value_match::String_value_match_type::SaveFieldId(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_save_field_id(&mut self, v: ::std::string::String) { + self.string_value_match_type = ::std::option::Option::Some(string_value_match::String_value_match_type::SaveFieldId(v)) + } + + // Mutable pointer to the field. + pub fn mut_save_field_id(&mut self) -> &mut ::std::string::String { + if let ::std::option::Option::Some(string_value_match::String_value_match_type::SaveFieldId(_)) = self.string_value_match_type { + } else { + self.string_value_match_type = ::std::option::Option::Some(string_value_match::String_value_match_type::SaveFieldId(::std::string::String::new())); + } + match self.string_value_match_type { + ::std::option::Option::Some(string_value_match::String_value_match_type::SaveFieldId(ref mut v)) => v, + _ => panic!(), + } + } + + // Take field + pub fn take_save_field_id(&mut self) -> ::std::string::String { + if self.has_save_field_id() { + match self.string_value_match_type.take() { + ::std::option::Option::Some(string_value_match::String_value_match_type::SaveFieldId(v)) => v, + _ => panic!(), + } + } else { + ::std::string::String::new() + } + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(1); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "operator", + |m: &StringValueMatch| { &m.operator }, + |m: &mut StringValueMatch| { &mut m.operator }, + )); + fields.push(::protobuf::reflect::rt::v2::make_oneof_deref_has_get_set_simpler_accessor::<_, _>( + "match_value", + StringValueMatch::has_match_value, + StringValueMatch::match_value, + StringValueMatch::set_match_value, + )); + fields.push(::protobuf::reflect::rt::v2::make_oneof_deref_has_get_set_simpler_accessor::<_, _>( + "save_field_id", + StringValueMatch::has_save_field_id, + StringValueMatch::save_field_id, + StringValueMatch::set_save_field_id, + )); + oneofs.push(string_value_match::String_value_match_type::generated_oneof_descriptor_data()); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "StringValueMatch", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for StringValueMatch { + const NAME: &'static str = "StringValueMatch"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 8 => { + self.operator = is.read_enum_or_unknown()?; + }, + 18 => { + self.string_value_match_type = ::std::option::Option::Some(string_value_match::String_value_match_type::MatchValue(is.read_string()?)); + }, + 26 => { + self.string_value_match_type = ::std::option::Option::Some(string_value_match::String_value_match_type::SaveFieldId(is.read_string()?)); + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if self.operator != ::protobuf::EnumOrUnknown::new(Operator::OPERATOR_UNSPECIFIED) { + my_size += ::protobuf::rt::int32_size(1, self.operator.value()); + } + if let ::std::option::Option::Some(ref v) = self.string_value_match_type { + match v { + &string_value_match::String_value_match_type::MatchValue(ref v) => { + my_size += ::protobuf::rt::string_size(2, &v); + }, + &string_value_match::String_value_match_type::SaveFieldId(ref v) => { + my_size += ::protobuf::rt::string_size(3, &v); + }, + }; + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if self.operator != ::protobuf::EnumOrUnknown::new(Operator::OPERATOR_UNSPECIFIED) { + os.write_enum(1, ::protobuf::EnumOrUnknown::value(&self.operator))?; + } + if let ::std::option::Option::Some(ref v) = self.string_value_match_type { + match v { + &string_value_match::String_value_match_type::MatchValue(ref v) => { + os.write_string(2, v)?; + }, + &string_value_match::String_value_match_type::SaveFieldId(ref v) => { + os.write_string(3, v)?; + }, + }; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> StringValueMatch { + StringValueMatch::new() + } + + fn clear(&mut self) { + self.operator = ::protobuf::EnumOrUnknown::new(Operator::OPERATOR_UNSPECIFIED); + self.string_value_match_type = ::std::option::Option::None; + self.string_value_match_type = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static StringValueMatch { + static instance: StringValueMatch = StringValueMatch { + operator: ::protobuf::EnumOrUnknown::from_i32(0), + string_value_match_type: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for StringValueMatch { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("StringValueMatch").unwrap()).clone() + } +} + +impl ::std::fmt::Display for StringValueMatch { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for StringValueMatch { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `StringValueMatch` +pub mod string_value_match { + + #[derive(Clone,PartialEq,Debug)] + // @@protoc_insertion_point(oneof:bitdrift_public.protobuf.value_matcher.v1.StringValueMatch.string_value_match_type) + pub enum String_value_match_type { + // @@protoc_insertion_point(oneof_field:bitdrift_public.protobuf.value_matcher.v1.StringValueMatch.match_value) + MatchValue(::std::string::String), + // @@protoc_insertion_point(oneof_field:bitdrift_public.protobuf.value_matcher.v1.StringValueMatch.save_field_id) + SaveFieldId(::std::string::String), + } + + impl ::protobuf::Oneof for String_value_match_type { + } + + impl ::protobuf::OneofFull for String_value_match_type { + fn descriptor() -> ::protobuf::reflect::OneofDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::OneofDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| ::descriptor().oneof_by_name("string_value_match_type").unwrap()).clone() + } + } + + impl String_value_match_type { + pub(in super) fn generated_oneof_descriptor_data() -> ::protobuf::reflect::GeneratedOneofDescriptorData { + ::protobuf::reflect::GeneratedOneofDescriptorData::new::("string_value_match_type") + } + } +} + +// @@protoc_insertion_point(message:bitdrift_public.protobuf.value_matcher.v1.IntValueMatch) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct IntValueMatch { + // message fields + // @@protoc_insertion_point(field:bitdrift_public.protobuf.value_matcher.v1.IntValueMatch.operator) + pub operator: ::protobuf::EnumOrUnknown, + // message oneof groups + pub int_value_match_type: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:bitdrift_public.protobuf.value_matcher.v1.IntValueMatch.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a IntValueMatch { + fn default() -> &'a IntValueMatch { + ::default_instance() + } +} + +impl IntValueMatch { + pub fn new() -> IntValueMatch { + ::std::default::Default::default() + } + + // int32 match_value = 2; + + pub fn match_value(&self) -> i32 { + match self.int_value_match_type { + ::std::option::Option::Some(int_value_match::Int_value_match_type::MatchValue(v)) => v, + _ => 0, + } + } + + pub fn clear_match_value(&mut self) { + self.int_value_match_type = ::std::option::Option::None; + } + + pub fn has_match_value(&self) -> bool { + match self.int_value_match_type { + ::std::option::Option::Some(int_value_match::Int_value_match_type::MatchValue(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_match_value(&mut self, v: i32) { + self.int_value_match_type = ::std::option::Option::Some(int_value_match::Int_value_match_type::MatchValue(v)) + } + + // string save_field_id = 3; + + pub fn save_field_id(&self) -> &str { + match self.int_value_match_type { + ::std::option::Option::Some(int_value_match::Int_value_match_type::SaveFieldId(ref v)) => v, + _ => "", + } + } + + pub fn clear_save_field_id(&mut self) { + self.int_value_match_type = ::std::option::Option::None; + } + + pub fn has_save_field_id(&self) -> bool { + match self.int_value_match_type { + ::std::option::Option::Some(int_value_match::Int_value_match_type::SaveFieldId(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_save_field_id(&mut self, v: ::std::string::String) { + self.int_value_match_type = ::std::option::Option::Some(int_value_match::Int_value_match_type::SaveFieldId(v)) + } + + // Mutable pointer to the field. + pub fn mut_save_field_id(&mut self) -> &mut ::std::string::String { + if let ::std::option::Option::Some(int_value_match::Int_value_match_type::SaveFieldId(_)) = self.int_value_match_type { + } else { + self.int_value_match_type = ::std::option::Option::Some(int_value_match::Int_value_match_type::SaveFieldId(::std::string::String::new())); + } + match self.int_value_match_type { + ::std::option::Option::Some(int_value_match::Int_value_match_type::SaveFieldId(ref mut v)) => v, + _ => panic!(), + } + } + + // Take field + pub fn take_save_field_id(&mut self) -> ::std::string::String { + if self.has_save_field_id() { + match self.int_value_match_type.take() { + ::std::option::Option::Some(int_value_match::Int_value_match_type::SaveFieldId(v)) => v, + _ => panic!(), + } + } else { + ::std::string::String::new() + } + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(1); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "operator", + |m: &IntValueMatch| { &m.operator }, + |m: &mut IntValueMatch| { &mut m.operator }, + )); + fields.push(::protobuf::reflect::rt::v2::make_oneof_copy_has_get_set_simpler_accessors::<_, _>( + "match_value", + IntValueMatch::has_match_value, + IntValueMatch::match_value, + IntValueMatch::set_match_value, + )); + fields.push(::protobuf::reflect::rt::v2::make_oneof_deref_has_get_set_simpler_accessor::<_, _>( + "save_field_id", + IntValueMatch::has_save_field_id, + IntValueMatch::save_field_id, + IntValueMatch::set_save_field_id, + )); + oneofs.push(int_value_match::Int_value_match_type::generated_oneof_descriptor_data()); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "IntValueMatch", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for IntValueMatch { + const NAME: &'static str = "IntValueMatch"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 8 => { + self.operator = is.read_enum_or_unknown()?; + }, + 16 => { + self.int_value_match_type = ::std::option::Option::Some(int_value_match::Int_value_match_type::MatchValue(is.read_int32()?)); + }, + 26 => { + self.int_value_match_type = ::std::option::Option::Some(int_value_match::Int_value_match_type::SaveFieldId(is.read_string()?)); + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if self.operator != ::protobuf::EnumOrUnknown::new(Operator::OPERATOR_UNSPECIFIED) { + my_size += ::protobuf::rt::int32_size(1, self.operator.value()); + } + if let ::std::option::Option::Some(ref v) = self.int_value_match_type { + match v { + &int_value_match::Int_value_match_type::MatchValue(v) => { + my_size += ::protobuf::rt::int32_size(2, v); + }, + &int_value_match::Int_value_match_type::SaveFieldId(ref v) => { + my_size += ::protobuf::rt::string_size(3, &v); + }, + }; + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if self.operator != ::protobuf::EnumOrUnknown::new(Operator::OPERATOR_UNSPECIFIED) { + os.write_enum(1, ::protobuf::EnumOrUnknown::value(&self.operator))?; + } + if let ::std::option::Option::Some(ref v) = self.int_value_match_type { + match v { + &int_value_match::Int_value_match_type::MatchValue(v) => { + os.write_int32(2, v)?; + }, + &int_value_match::Int_value_match_type::SaveFieldId(ref v) => { + os.write_string(3, v)?; + }, + }; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> IntValueMatch { + IntValueMatch::new() + } + + fn clear(&mut self) { + self.operator = ::protobuf::EnumOrUnknown::new(Operator::OPERATOR_UNSPECIFIED); + self.int_value_match_type = ::std::option::Option::None; + self.int_value_match_type = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static IntValueMatch { + static instance: IntValueMatch = IntValueMatch { + operator: ::protobuf::EnumOrUnknown::from_i32(0), + int_value_match_type: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for IntValueMatch { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("IntValueMatch").unwrap()).clone() + } +} + +impl ::std::fmt::Display for IntValueMatch { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for IntValueMatch { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `IntValueMatch` +pub mod int_value_match { + + #[derive(Clone,PartialEq,Debug)] + // @@protoc_insertion_point(oneof:bitdrift_public.protobuf.value_matcher.v1.IntValueMatch.int_value_match_type) + pub enum Int_value_match_type { + // @@protoc_insertion_point(oneof_field:bitdrift_public.protobuf.value_matcher.v1.IntValueMatch.match_value) + MatchValue(i32), + // @@protoc_insertion_point(oneof_field:bitdrift_public.protobuf.value_matcher.v1.IntValueMatch.save_field_id) + SaveFieldId(::std::string::String), + } + + impl ::protobuf::Oneof for Int_value_match_type { + } + + impl ::protobuf::OneofFull for Int_value_match_type { + fn descriptor() -> ::protobuf::reflect::OneofDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::OneofDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| ::descriptor().oneof_by_name("int_value_match_type").unwrap()).clone() + } + } + + impl Int_value_match_type { + pub(in super) fn generated_oneof_descriptor_data() -> ::protobuf::reflect::GeneratedOneofDescriptorData { + ::protobuf::reflect::GeneratedOneofDescriptorData::new::("int_value_match_type") + } + } +} + +// @@protoc_insertion_point(message:bitdrift_public.protobuf.value_matcher.v1.DoubleValueMatch) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct DoubleValueMatch { + // message fields + // @@protoc_insertion_point(field:bitdrift_public.protobuf.value_matcher.v1.DoubleValueMatch.operator) + pub operator: ::protobuf::EnumOrUnknown, + // message oneof groups + pub double_value_match_type: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:bitdrift_public.protobuf.value_matcher.v1.DoubleValueMatch.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a DoubleValueMatch { + fn default() -> &'a DoubleValueMatch { + ::default_instance() + } +} + +impl DoubleValueMatch { + pub fn new() -> DoubleValueMatch { + ::std::default::Default::default() + } + + // double match_value = 2; + + pub fn match_value(&self) -> f64 { + match self.double_value_match_type { + ::std::option::Option::Some(double_value_match::Double_value_match_type::MatchValue(v)) => v, + _ => 0., + } + } + + pub fn clear_match_value(&mut self) { + self.double_value_match_type = ::std::option::Option::None; + } + + pub fn has_match_value(&self) -> bool { + match self.double_value_match_type { + ::std::option::Option::Some(double_value_match::Double_value_match_type::MatchValue(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_match_value(&mut self, v: f64) { + self.double_value_match_type = ::std::option::Option::Some(double_value_match::Double_value_match_type::MatchValue(v)) + } + + // string save_field_id = 3; + + pub fn save_field_id(&self) -> &str { + match self.double_value_match_type { + ::std::option::Option::Some(double_value_match::Double_value_match_type::SaveFieldId(ref v)) => v, + _ => "", + } + } + + pub fn clear_save_field_id(&mut self) { + self.double_value_match_type = ::std::option::Option::None; + } + + pub fn has_save_field_id(&self) -> bool { + match self.double_value_match_type { + ::std::option::Option::Some(double_value_match::Double_value_match_type::SaveFieldId(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_save_field_id(&mut self, v: ::std::string::String) { + self.double_value_match_type = ::std::option::Option::Some(double_value_match::Double_value_match_type::SaveFieldId(v)) + } + + // Mutable pointer to the field. + pub fn mut_save_field_id(&mut self) -> &mut ::std::string::String { + if let ::std::option::Option::Some(double_value_match::Double_value_match_type::SaveFieldId(_)) = self.double_value_match_type { + } else { + self.double_value_match_type = ::std::option::Option::Some(double_value_match::Double_value_match_type::SaveFieldId(::std::string::String::new())); + } + match self.double_value_match_type { + ::std::option::Option::Some(double_value_match::Double_value_match_type::SaveFieldId(ref mut v)) => v, + _ => panic!(), + } + } + + // Take field + pub fn take_save_field_id(&mut self) -> ::std::string::String { + if self.has_save_field_id() { + match self.double_value_match_type.take() { + ::std::option::Option::Some(double_value_match::Double_value_match_type::SaveFieldId(v)) => v, + _ => panic!(), + } + } else { + ::std::string::String::new() + } + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(1); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "operator", + |m: &DoubleValueMatch| { &m.operator }, + |m: &mut DoubleValueMatch| { &mut m.operator }, + )); + fields.push(::protobuf::reflect::rt::v2::make_oneof_copy_has_get_set_simpler_accessors::<_, _>( + "match_value", + DoubleValueMatch::has_match_value, + DoubleValueMatch::match_value, + DoubleValueMatch::set_match_value, + )); + fields.push(::protobuf::reflect::rt::v2::make_oneof_deref_has_get_set_simpler_accessor::<_, _>( + "save_field_id", + DoubleValueMatch::has_save_field_id, + DoubleValueMatch::save_field_id, + DoubleValueMatch::set_save_field_id, + )); + oneofs.push(double_value_match::Double_value_match_type::generated_oneof_descriptor_data()); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "DoubleValueMatch", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for DoubleValueMatch { + const NAME: &'static str = "DoubleValueMatch"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 8 => { + self.operator = is.read_enum_or_unknown()?; + }, + 17 => { + self.double_value_match_type = ::std::option::Option::Some(double_value_match::Double_value_match_type::MatchValue(is.read_double()?)); + }, + 26 => { + self.double_value_match_type = ::std::option::Option::Some(double_value_match::Double_value_match_type::SaveFieldId(is.read_string()?)); + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if self.operator != ::protobuf::EnumOrUnknown::new(Operator::OPERATOR_UNSPECIFIED) { + my_size += ::protobuf::rt::int32_size(1, self.operator.value()); + } + if let ::std::option::Option::Some(ref v) = self.double_value_match_type { + match v { + &double_value_match::Double_value_match_type::MatchValue(v) => { + my_size += 1 + 8; + }, + &double_value_match::Double_value_match_type::SaveFieldId(ref v) => { + my_size += ::protobuf::rt::string_size(3, &v); + }, + }; + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if self.operator != ::protobuf::EnumOrUnknown::new(Operator::OPERATOR_UNSPECIFIED) { + os.write_enum(1, ::protobuf::EnumOrUnknown::value(&self.operator))?; + } + if let ::std::option::Option::Some(ref v) = self.double_value_match_type { + match v { + &double_value_match::Double_value_match_type::MatchValue(v) => { + os.write_double(2, v)?; + }, + &double_value_match::Double_value_match_type::SaveFieldId(ref v) => { + os.write_string(3, v)?; + }, + }; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> DoubleValueMatch { + DoubleValueMatch::new() + } + + fn clear(&mut self) { + self.operator = ::protobuf::EnumOrUnknown::new(Operator::OPERATOR_UNSPECIFIED); + self.double_value_match_type = ::std::option::Option::None; + self.double_value_match_type = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static DoubleValueMatch { + static instance: DoubleValueMatch = DoubleValueMatch { + operator: ::protobuf::EnumOrUnknown::from_i32(0), + double_value_match_type: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for DoubleValueMatch { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("DoubleValueMatch").unwrap()).clone() + } +} + +impl ::std::fmt::Display for DoubleValueMatch { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DoubleValueMatch { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `DoubleValueMatch` +pub mod double_value_match { + + #[derive(Clone,PartialEq,Debug)] + // @@protoc_insertion_point(oneof:bitdrift_public.protobuf.value_matcher.v1.DoubleValueMatch.double_value_match_type) + pub enum Double_value_match_type { + // @@protoc_insertion_point(oneof_field:bitdrift_public.protobuf.value_matcher.v1.DoubleValueMatch.match_value) + MatchValue(f64), + // @@protoc_insertion_point(oneof_field:bitdrift_public.protobuf.value_matcher.v1.DoubleValueMatch.save_field_id) + SaveFieldId(::std::string::String), + } + + impl ::protobuf::Oneof for Double_value_match_type { + } + + impl ::protobuf::OneofFull for Double_value_match_type { + fn descriptor() -> ::protobuf::reflect::OneofDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::OneofDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| ::descriptor().oneof_by_name("double_value_match_type").unwrap()).clone() + } + } + + impl Double_value_match_type { + pub(in super) fn generated_oneof_descriptor_data() -> ::protobuf::reflect::GeneratedOneofDescriptorData { + ::protobuf::reflect::GeneratedOneofDescriptorData::new::("double_value_match_type") + } + } +} + +// @@protoc_insertion_point(message:bitdrift_public.protobuf.value_matcher.v1.SemVerValueMatch) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct SemVerValueMatch { + // message fields + // @@protoc_insertion_point(field:bitdrift_public.protobuf.value_matcher.v1.SemVerValueMatch.operator) + pub operator: ::protobuf::EnumOrUnknown, + // @@protoc_insertion_point(field:bitdrift_public.protobuf.value_matcher.v1.SemVerValueMatch.match_value) + pub match_value: ::std::string::String, + // special fields + // @@protoc_insertion_point(special_field:bitdrift_public.protobuf.value_matcher.v1.SemVerValueMatch.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a SemVerValueMatch { + fn default() -> &'a SemVerValueMatch { + ::default_instance() + } +} + +impl SemVerValueMatch { + pub fn new() -> SemVerValueMatch { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(2); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "operator", + |m: &SemVerValueMatch| { &m.operator }, + |m: &mut SemVerValueMatch| { &mut m.operator }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "match_value", + |m: &SemVerValueMatch| { &m.match_value }, + |m: &mut SemVerValueMatch| { &mut m.match_value }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "SemVerValueMatch", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for SemVerValueMatch { + const NAME: &'static str = "SemVerValueMatch"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 8 => { + self.operator = is.read_enum_or_unknown()?; + }, + 18 => { + self.match_value = is.read_string()?; + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if self.operator != ::protobuf::EnumOrUnknown::new(Operator::OPERATOR_UNSPECIFIED) { + my_size += ::protobuf::rt::int32_size(1, self.operator.value()); + } + if !self.match_value.is_empty() { + my_size += ::protobuf::rt::string_size(2, &self.match_value); + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if self.operator != ::protobuf::EnumOrUnknown::new(Operator::OPERATOR_UNSPECIFIED) { + os.write_enum(1, ::protobuf::EnumOrUnknown::value(&self.operator))?; + } + if !self.match_value.is_empty() { + os.write_string(2, &self.match_value)?; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> SemVerValueMatch { + SemVerValueMatch::new() + } + + fn clear(&mut self) { + self.operator = ::protobuf::EnumOrUnknown::new(Operator::OPERATOR_UNSPECIFIED); + self.match_value.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static SemVerValueMatch { + static instance: SemVerValueMatch = SemVerValueMatch { + operator: ::protobuf::EnumOrUnknown::from_i32(0), + match_value: ::std::string::String::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for SemVerValueMatch { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("SemVerValueMatch").unwrap()).clone() + } +} + +impl ::std::fmt::Display for SemVerValueMatch { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for SemVerValueMatch { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +// @@protoc_insertion_point(message:bitdrift_public.protobuf.value_matcher.v1.IsSetMatch) +#[derive(PartialEq,Clone,Default,Debug)] +pub struct IsSetMatch { + // special fields + // @@protoc_insertion_point(special_field:bitdrift_public.protobuf.value_matcher.v1.IsSetMatch.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a IsSetMatch { + fn default() -> &'a IsSetMatch { + ::default_instance() + } +} + +impl IsSetMatch { + pub fn new() -> IsSetMatch { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(0); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "IsSetMatch", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for IsSetMatch { + const NAME: &'static str = "IsSetMatch"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> IsSetMatch { + IsSetMatch::new() + } + + fn clear(&mut self) { + self.special_fields.clear(); + } + + fn default_instance() -> &'static IsSetMatch { + static instance: IsSetMatch = IsSetMatch { + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for IsSetMatch { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("IsSetMatch").unwrap()).clone() + } +} + +impl ::std::fmt::Display for IsSetMatch { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for IsSetMatch { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] +// @@protoc_insertion_point(enum:bitdrift_public.protobuf.value_matcher.v1.Operator) +pub enum Operator { + // @@protoc_insertion_point(enum_value:bitdrift_public.protobuf.value_matcher.v1.Operator.OPERATOR_UNSPECIFIED) + OPERATOR_UNSPECIFIED = 0, + // @@protoc_insertion_point(enum_value:bitdrift_public.protobuf.value_matcher.v1.Operator.OPERATOR_LESS_THAN) + OPERATOR_LESS_THAN = 1, + // @@protoc_insertion_point(enum_value:bitdrift_public.protobuf.value_matcher.v1.Operator.OPERATOR_LESS_THAN_OR_EQUAL) + OPERATOR_LESS_THAN_OR_EQUAL = 2, + // @@protoc_insertion_point(enum_value:bitdrift_public.protobuf.value_matcher.v1.Operator.OPERATOR_EQUALS) + OPERATOR_EQUALS = 3, + // @@protoc_insertion_point(enum_value:bitdrift_public.protobuf.value_matcher.v1.Operator.OPERATOR_GREATER_THAN) + OPERATOR_GREATER_THAN = 4, + // @@protoc_insertion_point(enum_value:bitdrift_public.protobuf.value_matcher.v1.Operator.OPERATOR_GREATER_THAN_OR_EQUAL) + OPERATOR_GREATER_THAN_OR_EQUAL = 5, + // @@protoc_insertion_point(enum_value:bitdrift_public.protobuf.value_matcher.v1.Operator.OPERATOR_NOT_EQUALS) + OPERATOR_NOT_EQUALS = 6, + // @@protoc_insertion_point(enum_value:bitdrift_public.protobuf.value_matcher.v1.Operator.OPERATOR_REGEX) + OPERATOR_REGEX = 7, +} + +impl ::protobuf::Enum for Operator { + const NAME: &'static str = "Operator"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(Operator::OPERATOR_UNSPECIFIED), + 1 => ::std::option::Option::Some(Operator::OPERATOR_LESS_THAN), + 2 => ::std::option::Option::Some(Operator::OPERATOR_LESS_THAN_OR_EQUAL), + 3 => ::std::option::Option::Some(Operator::OPERATOR_EQUALS), + 4 => ::std::option::Option::Some(Operator::OPERATOR_GREATER_THAN), + 5 => ::std::option::Option::Some(Operator::OPERATOR_GREATER_THAN_OR_EQUAL), + 6 => ::std::option::Option::Some(Operator::OPERATOR_NOT_EQUALS), + 7 => ::std::option::Option::Some(Operator::OPERATOR_REGEX), + _ => ::std::option::Option::None + } + } + + fn from_str(str: &str) -> ::std::option::Option { + match str { + "OPERATOR_UNSPECIFIED" => ::std::option::Option::Some(Operator::OPERATOR_UNSPECIFIED), + "OPERATOR_LESS_THAN" => ::std::option::Option::Some(Operator::OPERATOR_LESS_THAN), + "OPERATOR_LESS_THAN_OR_EQUAL" => ::std::option::Option::Some(Operator::OPERATOR_LESS_THAN_OR_EQUAL), + "OPERATOR_EQUALS" => ::std::option::Option::Some(Operator::OPERATOR_EQUALS), + "OPERATOR_GREATER_THAN" => ::std::option::Option::Some(Operator::OPERATOR_GREATER_THAN), + "OPERATOR_GREATER_THAN_OR_EQUAL" => ::std::option::Option::Some(Operator::OPERATOR_GREATER_THAN_OR_EQUAL), + "OPERATOR_NOT_EQUALS" => ::std::option::Option::Some(Operator::OPERATOR_NOT_EQUALS), + "OPERATOR_REGEX" => ::std::option::Option::Some(Operator::OPERATOR_REGEX), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [Operator] = &[ + Operator::OPERATOR_UNSPECIFIED, + Operator::OPERATOR_LESS_THAN, + Operator::OPERATOR_LESS_THAN_OR_EQUAL, + Operator::OPERATOR_EQUALS, + Operator::OPERATOR_GREATER_THAN, + Operator::OPERATOR_GREATER_THAN_OR_EQUAL, + Operator::OPERATOR_NOT_EQUALS, + Operator::OPERATOR_REGEX, + ]; +} + +impl ::protobuf::EnumFull for Operator { + fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().enum_by_package_relative_name("Operator").unwrap()).clone() + } + + fn descriptor(&self) -> ::protobuf::reflect::EnumValueDescriptor { + let index = *self as usize; + Self::enum_descriptor().value_by_index(index) + } +} + +impl ::std::default::Default for Operator { + fn default() -> Self { + Operator::OPERATOR_UNSPECIFIED + } +} + +impl Operator { + fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("Operator") + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n=bitdrift_public/protobuf/value_matcher/v1/value_matcher.proto\x12)bit\ + drift_public.protobuf.value_matcher.v1\x1a\x17validate/validate.proto\"\ + \xda\x01\n\x10StringValueMatch\x12Y\n\x08operator\x18\x01\x20\x01(\x0e23\ + .bitdrift_public.protobuf.value_matcher.v1.OperatorR\x08operatorB\x08\ + \xfaB\x05\x82\x01\x02\x10\x01\x12*\n\x0bmatch_value\x18\x02\x20\x01(\tH\ + \0R\nmatchValueB\x07\xfaB\x04r\x02\x10\x01\x12$\n\rsave_field_id\x18\x03\ + \x20\x01(\tH\0R\x0bsaveFieldIdB\x19\n\x17string_value_match_type\"\xcb\ + \x01\n\rIntValueMatch\x12Y\n\x08operator\x18\x01\x20\x01(\x0e23.bitdrift\ + _public.protobuf.value_matcher.v1.OperatorR\x08operatorB\x08\xfaB\x05\ + \x82\x01\x02\x10\x01\x12!\n\x0bmatch_value\x18\x02\x20\x01(\x05H\0R\nmat\ + chValue\x12$\n\rsave_field_id\x18\x03\x20\x01(\tH\0R\x0bsaveFieldIdB\x16\ + \n\x14int_value_match_type\"\xd1\x01\n\x10DoubleValueMatch\x12Y\n\x08ope\ + rator\x18\x01\x20\x01(\x0e23.bitdrift_public.protobuf.value_matcher.v1.O\ + peratorR\x08operatorB\x08\xfaB\x05\x82\x01\x02\x10\x01\x12!\n\x0bmatch_v\ + alue\x18\x02\x20\x01(\x01H\0R\nmatchValue\x12$\n\rsave_field_id\x18\x03\ + \x20\x01(\tH\0R\x0bsaveFieldIdB\x19\n\x17double_value_match_type\"\x97\ + \x01\n\x10SemVerValueMatch\x12Y\n\x08operator\x18\x01\x20\x01(\x0e23.bit\ + drift_public.protobuf.value_matcher.v1.OperatorR\x08operatorB\x08\xfaB\ + \x05\x82\x01\x02\x10\x01\x12(\n\x0bmatch_value\x18\x02\x20\x01(\tR\nmatc\ + hValueB\x07\xfaB\x04r\x02\x10\x01\"\x0c\n\nIsSetMatch*\xea\x01\n\x08Oper\ + ator\x12\x18\n\x14OPERATOR_UNSPECIFIED\x10\0\x12\x16\n\x12OPERATOR_LESS_\ + THAN\x10\x01\x12\x1f\n\x1bOPERATOR_LESS_THAN_OR_EQUAL\x10\x02\x12\x13\n\ + \x0fOPERATOR_EQUALS\x10\x03\x12\x19\n\x15OPERATOR_GREATER_THAN\x10\x04\ + \x12\"\n\x1eOPERATOR_GREATER_THAN_OR_EQUAL\x10\x05\x12\x17\n\x13OPERATOR\ + _NOT_EQUALS\x10\x06\x12\x12\n\x0eOPERATOR_REGEX\x10\x07\"\x04\x08\x08\ + \x10\x08\"\x04\x08\t\x10\tb\x06proto3\ +"; + +/// `FileDescriptorProto` object which was a source for this generated file +fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new(); + file_descriptor_proto_lazy.get(|| { + ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() + }) +} + +/// `FileDescriptor` object which allows dynamic access to files +pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { + static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new(); + static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); + file_descriptor.get(|| { + let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { + let mut deps = ::std::vec::Vec::with_capacity(1); + deps.push(super::validate::file_descriptor().clone()); + let mut messages = ::std::vec::Vec::with_capacity(5); + messages.push(StringValueMatch::generated_message_descriptor_data()); + messages.push(IntValueMatch::generated_message_descriptor_data()); + messages.push(DoubleValueMatch::generated_message_descriptor_data()); + messages.push(SemVerValueMatch::generated_message_descriptor_data()); + messages.push(IsSetMatch::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(1); + enums.push(Operator::generated_enum_descriptor_data()); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/bd-proto/src/protos/workflow/mod.rs b/bd-proto/src/protos/workflow/mod.rs index bc41f3006..d3cc64dc0 100644 --- a/bd-proto/src/protos/workflow/mod.rs +++ b/bd-proto/src/protos/workflow/mod.rs @@ -8,4 +8,5 @@ pub mod workflow; use super::log_matcher::log_matcher; +use super::state::{matcher, scope}; use bd_pgv::generated::protos::validate; diff --git a/bd-proto/src/protos/workflow/workflow.rs b/bd-proto/src/protos/workflow/workflow.rs index cd11a71f3..99e333af7 100644 --- a/bd-proto/src/protos/workflow/workflow.rs +++ b/bd-proto/src/protos/workflow/workflow.rs @@ -922,8 +922,57 @@ pub mod workflow { } } + // .bitdrift_public.protobuf.workflow.v1.Workflow.RuleStateChangeMatch rule_state_change_match = 3; + + pub fn rule_state_change_match(&self) -> &RuleStateChangeMatch { + match self.rule_type { + ::std::option::Option::Some(rule::Rule_type::RuleStateChangeMatch(ref v)) => v, + _ => ::default_instance(), + } + } + + pub fn clear_rule_state_change_match(&mut self) { + self.rule_type = ::std::option::Option::None; + } + + pub fn has_rule_state_change_match(&self) -> bool { + match self.rule_type { + ::std::option::Option::Some(rule::Rule_type::RuleStateChangeMatch(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_rule_state_change_match(&mut self, v: RuleStateChangeMatch) { + self.rule_type = ::std::option::Option::Some(rule::Rule_type::RuleStateChangeMatch(v)) + } + + // Mutable pointer to the field. + pub fn mut_rule_state_change_match(&mut self) -> &mut RuleStateChangeMatch { + if let ::std::option::Option::Some(rule::Rule_type::RuleStateChangeMatch(_)) = self.rule_type { + } else { + self.rule_type = ::std::option::Option::Some(rule::Rule_type::RuleStateChangeMatch(RuleStateChangeMatch::new())); + } + match self.rule_type { + ::std::option::Option::Some(rule::Rule_type::RuleStateChangeMatch(ref mut v)) => v, + _ => panic!(), + } + } + + // Take field + pub fn take_rule_state_change_match(&mut self) -> RuleStateChangeMatch { + if self.has_rule_state_change_match() { + match self.rule_type.take() { + ::std::option::Option::Some(rule::Rule_type::RuleStateChangeMatch(v)) => v, + _ => panic!(), + } + } else { + RuleStateChangeMatch::new() + } + } + pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(1); + let mut fields = ::std::vec::Vec::with_capacity(2); let mut oneofs = ::std::vec::Vec::with_capacity(1); fields.push(::protobuf::reflect::rt::v2::make_oneof_message_has_get_mut_set_accessor::<_, RuleLogMatch>( "rule_log_match", @@ -932,6 +981,13 @@ pub mod workflow { Rule::mut_rule_log_match, Rule::set_rule_log_match, )); + fields.push(::protobuf::reflect::rt::v2::make_oneof_message_has_get_mut_set_accessor::<_, RuleStateChangeMatch>( + "rule_state_change_match", + Rule::has_rule_state_change_match, + Rule::rule_state_change_match, + Rule::mut_rule_state_change_match, + Rule::set_rule_state_change_match, + )); oneofs.push(rule::Rule_type::generated_oneof_descriptor_data()); ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( "Workflow.Rule", @@ -954,6 +1010,9 @@ pub mod workflow { 10 => { self.rule_type = ::std::option::Option::Some(rule::Rule_type::RuleLogMatch(is.read_message()?)); }, + 26 => { + self.rule_type = ::std::option::Option::Some(rule::Rule_type::RuleStateChangeMatch(is.read_message()?)); + }, tag => { ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; }, @@ -972,6 +1031,10 @@ pub mod workflow { let len = v.compute_size(); my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; }, + &rule::Rule_type::RuleStateChangeMatch(ref v) => { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }, }; } my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); @@ -985,6 +1048,9 @@ pub mod workflow { &rule::Rule_type::RuleLogMatch(ref v) => { ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; }, + &rule::Rule_type::RuleStateChangeMatch(ref v) => { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; + }, }; } os.write_unknown_fields(self.special_fields.unknown_fields())?; @@ -1004,6 +1070,7 @@ pub mod workflow { } fn clear(&mut self) { + self.rule_type = ::std::option::Option::None; self.rule_type = ::std::option::Option::None; self.special_fields.clear(); } @@ -1042,6 +1109,8 @@ pub mod workflow { pub enum Rule_type { // @@protoc_insertion_point(oneof_field:bitdrift_public.protobuf.workflow.v1.Workflow.Rule.rule_log_match) RuleLogMatch(super::RuleLogMatch), + // @@protoc_insertion_point(oneof_field:bitdrift_public.protobuf.workflow.v1.Workflow.Rule.rule_state_change_match) + RuleStateChangeMatch(super::RuleStateChangeMatch), } impl ::protobuf::Oneof for Rule_type { @@ -2123,6 +2192,184 @@ pub mod workflow { type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; } + // @@protoc_insertion_point(message:bitdrift_public.protobuf.workflow.v1.Workflow.RuleStateChangeMatch) + #[derive(PartialEq,Clone,Default,Debug)] + pub struct RuleStateChangeMatch { + // message fields + // @@protoc_insertion_point(field:bitdrift_public.protobuf.workflow.v1.Workflow.RuleStateChangeMatch.scope) + pub scope: ::protobuf::EnumOrUnknown, + // @@protoc_insertion_point(field:bitdrift_public.protobuf.workflow.v1.Workflow.RuleStateChangeMatch.key) + pub key: ::std::string::String, + // @@protoc_insertion_point(field:bitdrift_public.protobuf.workflow.v1.Workflow.RuleStateChangeMatch.previous_value) + pub previous_value: ::protobuf::MessageField, + // @@protoc_insertion_point(field:bitdrift_public.protobuf.workflow.v1.Workflow.RuleStateChangeMatch.new_value) + pub new_value: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:bitdrift_public.protobuf.workflow.v1.Workflow.RuleStateChangeMatch.special_fields) + pub special_fields: ::protobuf::SpecialFields, + } + + impl<'a> ::std::default::Default for &'a RuleStateChangeMatch { + fn default() -> &'a RuleStateChangeMatch { + ::default_instance() + } + } + + impl RuleStateChangeMatch { + pub fn new() -> RuleStateChangeMatch { + ::std::default::Default::default() + } + + pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(4); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "scope", + |m: &RuleStateChangeMatch| { &m.scope }, + |m: &mut RuleStateChangeMatch| { &mut m.scope }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "key", + |m: &RuleStateChangeMatch| { &m.key }, + |m: &mut RuleStateChangeMatch| { &mut m.key }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::super::matcher::StateValueMatch>( + "previous_value", + |m: &RuleStateChangeMatch| { &m.previous_value }, + |m: &mut RuleStateChangeMatch| { &mut m.previous_value }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::super::matcher::StateValueMatch>( + "new_value", + |m: &RuleStateChangeMatch| { &m.new_value }, + |m: &mut RuleStateChangeMatch| { &mut m.new_value }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "Workflow.RuleStateChangeMatch", + fields, + oneofs, + ) + } + } + + impl ::protobuf::Message for RuleStateChangeMatch { + const NAME: &'static str = "RuleStateChangeMatch"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 8 => { + self.scope = is.read_enum_or_unknown()?; + }, + 18 => { + self.key = is.read_string()?; + }, + 26 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.previous_value)?; + }, + 34 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.new_value)?; + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if self.scope != ::protobuf::EnumOrUnknown::new(super::super::scope::StateScope::UNSPECIFIED) { + my_size += ::protobuf::rt::int32_size(1, self.scope.value()); + } + if !self.key.is_empty() { + my_size += ::protobuf::rt::string_size(2, &self.key); + } + if let Some(v) = self.previous_value.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.new_value.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if self.scope != ::protobuf::EnumOrUnknown::new(super::super::scope::StateScope::UNSPECIFIED) { + os.write_enum(1, ::protobuf::EnumOrUnknown::value(&self.scope))?; + } + if !self.key.is_empty() { + os.write_string(2, &self.key)?; + } + if let Some(v) = self.previous_value.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; + } + if let Some(v) = self.new_value.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(4, v, os)?; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> RuleStateChangeMatch { + RuleStateChangeMatch::new() + } + + fn clear(&mut self) { + self.scope = ::protobuf::EnumOrUnknown::new(super::super::scope::StateScope::UNSPECIFIED); + self.key.clear(); + self.previous_value.clear(); + self.new_value.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static RuleStateChangeMatch { + static instance: RuleStateChangeMatch = RuleStateChangeMatch { + scope: ::protobuf::EnumOrUnknown::from_i32(0), + key: ::std::string::String::new(), + previous_value: ::protobuf::MessageField::none(), + new_value: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } + } + + impl ::protobuf::MessageFull for RuleStateChangeMatch { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| super::file_descriptor().message_by_package_relative_name("Workflow.RuleStateChangeMatch").unwrap()).clone() + } + } + + impl ::std::fmt::Display for RuleStateChangeMatch { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } + } + + impl ::protobuf::reflect::ProtobufValue for RuleStateChangeMatch { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; + } + // @@protoc_insertion_point(message:bitdrift_public.protobuf.workflow.v1.Workflow.Action) #[derive(PartialEq,Clone,Default,Debug)] pub struct Action { @@ -7072,146 +7319,157 @@ pub mod workflow { static file_descriptor_proto_data: &'static [u8] = b"\ \n3bitdrift_public/protobuf/workflow/v1/workflow.proto\x12$bitdrift_publ\ - ic.protobuf.workflow.v1\x1a\x17validate/validate.proto\x1a5bitdrift_publ\ - ic/protobuf/matcher/v1/log_matcher.proto\"f\n\x16WorkflowsConfiguration\ - \x12L\n\tworkflows\x18\x01\x20\x03(\x0b2..bitdrift_public.protobuf.workf\ - low.v1.WorkflowR\tworkflows\"\x905\n\x08Workflow\x12\x17\n\x02id\x18\x01\ - \x20\x01(\tR\x02idB\x07\xfaB\x04r\x02\x10\x01\x12V\n\x06states\x18\x02\ - \x20\x03(\x0b24.bitdrift_public.protobuf.workflow.v1.Workflow.StateR\x06\ - statesB\x08\xfaB\x05\x92\x01\x02\x08\x01\x12V\n\texecution\x18\x03\x20\ - \x01(\x0b28.bitdrift_public.protobuf.workflow.v1.Workflow.ExecutionR\tex\ - ecution\x12}\n\x18limit_matched_logs_count\x18\x04\x20\x01(\x0b2D.bitdri\ - ft_public.protobuf.workflow.v1.Workflow.LimitMatchedLogsCountR\x15limitM\ - atchedLogsCount\x12c\n\x0elimit_duration\x18\x05\x20\x01(\x0b2<.bitdrift\ - _public.protobuf.workflow.v1.Workflow.LimitDurationR\rlimitDuration\x1a\ - \xd9\x01\n\x05State\x12\x17\n\x02id\x18\x01\x20\x01(\tR\x02idB\x07\xfaB\ - \x04r\x02\x10\x01\x12[\n\x0btransitions\x18\x02\x20\x03(\x0b29.bitdrift_\ - public.protobuf.workflow.v1.Workflow.TransitionR\x0btransitions\x12Z\n\ - \x07timeout\x18\x03\x20\x01(\x0b2@.bitdrift_public.protobuf.workflow.v1.\ - Workflow.TransitionTimeoutR\x07timeout\x1a\xbd\x01\n\x11TransitionTimeou\ - t\x12/\n\x0ftarget_state_id\x18\x01\x20\x01(\tR\rtargetStateIdB\x07\xfaB\ - \x04r\x02\x10\x01\x12&\n\ntimeout_ms\x18\x02\x20\x01(\x04R\ttimeoutMsB\ - \x07\xfaB\x042\x02\x20\0\x12O\n\x07actions\x18\x03\x20\x03(\x0b25.bitdri\ - ft_public.protobuf.workflow.v1.Workflow.ActionR\x07actions\x1a\xc5\x02\n\ - \nTransition\x12/\n\x0ftarget_state_id\x18\x01\x20\x01(\tR\rtargetStateI\ - dB\x07\xfaB\x04r\x02\x10\x01\x12Q\n\x04rule\x18\x02\x20\x01(\x0b23.bitdr\ - ift_public.protobuf.workflow.v1.Workflow.RuleR\x04ruleB\x08\xfaB\x05\x8a\ - \x01\x02\x10\x01\x12O\n\x07actions\x18\x03\x20\x03(\x0b25.bitdrift_publi\ - c.protobuf.workflow.v1.Workflow.ActionR\x07actions\x12b\n\nextensions\ - \x18\x04\x20\x03(\x0b2B.bitdrift_public.protobuf.workflow.v1.Workflow.Tr\ - ansitionExtensionR\nextensions\x1a\x83\x01\n\x04Rule\x12c\n\x0erule_log_\ - match\x18\x01\x20\x01(\x0b2;.bitdrift_public.protobuf.workflow.v1.Workfl\ - ow.RuleLogMatchH\0R\x0cruleLogMatchB\x10\n\trule_type\x12\x03\xf8B\x01J\ - \x04\x08\x02\x10\x03\x1a\xe4\x06\n\x13TransitionExtension\x12\xa8\x01\n\ - \x1fsankey_diagram_value_extraction\x18\x01\x20\x01(\x0b2_.bitdrift_publ\ - ic.protobuf.workflow.v1.Workflow.TransitionExtension.SankeyDiagramValueE\ - xtractionH\0R\x1csankeyDiagramValueExtraction\x12y\n\x0esave_timestamp\ - \x18\x02\x20\x01(\x0b2P.bitdrift_public.protobuf.workflow.v1.Workflow.Tr\ - ansitionExtension.SaveTimestampH\0R\rsaveTimestamp\x12m\n\nsave_field\ - \x18\x03\x20\x01(\x0b2L.bitdrift_public.protobuf.workflow.v1.Workflow.Tr\ - ansitionExtension.SaveFieldH\0R\tsaveField\x1a\x1f\n\rSaveTimestamp\x12\ - \x0e\n\x02id\x18\x01\x20\x01(\tR\x02id\x1a:\n\tSaveField\x12\x0e\n\x02id\ - \x18\x01\x20\x01(\tR\x02id\x12\x1d\n\nfield_name\x18\x02\x20\x01(\tR\tfi\ - eldName\x1a\xc3\x02\n\x1cSankeyDiagramValueExtraction\x123\n\x11sankey_d\ - iagram_id\x18\x01\x20\x01(\tR\x0fsankeyDiagramIdB\x07\xfaB\x04r\x02\x10\ - \x01\x12\x1f\n\x05fixed\x18\x02\x20\x01(\tH\0R\x05fixedB\x07\xfaB\x04r\ - \x02\x10\x01\x12h\n\x0ffield_extracted\x18\x03\x20\x01(\x0b2=.bitdrift_p\ - ublic.protobuf.workflow.v1.Workflow.FieldExtractedH\0R\x0efieldExtracted\ - \x12P\n%counts_toward_sankey_extraction_limit\x18\x04\x20\x01(\x08R!coun\ - tsTowardSankeyExtractionLimitB\x11\n\nvalue_type\x12\x03\xf8B\x01B\x15\n\ - \x0eextension_type\x12\x03\xf8B\x01\x1a\x89\x01\n\x0cRuleLogMatch\x12Z\n\ - \x0blog_matcher\x18\x01\x20\x01(\x0b2/.bitdrift_public.protobuf.matcher.\ - v1.LogMatcherR\nlogMatcherB\x08\xfaB\x05\x8a\x01\x02\x10\x01\x12\x1d\n\ - \x05count\x18\x02\x20\x01(\rR\x05countB\x07\xfaB\x04*\x02\x20\0\x1a\xe1\ - \x1d\n\x06Action\x12|\n\x14action_flush_buffers\x18\x01\x20\x01(\x0b2H.b\ - itdrift_public.protobuf.workflow.v1.Workflow.Action.ActionFlushBuffersH\ - \0R\x12actionFlushBuffers\x12v\n\x12action_emit_metric\x18\x02\x20\x01(\ - \x0b2F.bitdrift_public.protobuf.workflow.v1.Workflow.Action.ActionEmitMe\ - tricH\0R\x10actionEmitMetric\x12\x8c\x01\n\x1aaction_emit_sankey_diagram\ - \x18\x03\x20\x01(\x0b2M.bitdrift_public.protobuf.workflow.v1.Workflow.Ac\ - tion.ActionEmitSankeyDiagramH\0R\x17actionEmitSankeyDiagram\x12\x82\x01\ - \n\x16action_take_screenshot\x18\x04\x20\x01(\x0b2J.bitdrift_public.prot\ - obuf.workflow.v1.Workflow.Action.ActionTakeScreenshotH\0R\x14actionTakeS\ - creenshot\x12y\n\x13action_generate_log\x18\x05\x20\x01(\x0b2G.bitdrift_\ - public.protobuf.workflow.v1.Workflow.Action.ActionGenerateLogH\0R\x11act\ - ionGenerateLog\x1a\xb1\n\n\x11ActionGenerateLog\x12\x18\n\x07message\x18\ - \x01\x20\x01(\tR\x07message\x12n\n\x06fields\x18\x02\x20\x03(\x0b2V.bitd\ - rift_public.protobuf.workflow.v1.Workflow.Action.ActionGenerateLog.Gener\ - atedFieldR\x06fields\x12\x0e\n\x02id\x18\x03\x20\x01(\tR\x02id\x12\x19\n\ - \x08log_type\x18\x04\x20\x01(\rR\x07logType\x1a\xe5\x01\n\x0eValueRefere\ - nce\x12\x16\n\x05fixed\x18\x01\x20\x01(\tH\0R\x05fixed\x125\n\x16field_f\ - rom_current_log\x18\x02\x20\x01(\tH\0R\x13fieldFromCurrentLog\x12&\n\x0e\ - saved_field_id\x18\x03\x20\x01(\tH\0R\x0csavedFieldId\x12.\n\x12saved_ti\ - mestamp_id\x18\x04\x20\x01(\tH\0R\x10savedTimestampId\x12\x14\n\x04uuid\ - \x18\x05\x20\x01(\x08H\0R\x04uuidB\x16\n\x14value_reference_type\x1a\xe8\ - \x01\n\x12ValueReferencePair\x12h\n\x03lhs\x18\x01\x20\x01(\x0b2V.bitdri\ - ft_public.protobuf.workflow.v1.Workflow.Action.ActionGenerateLog.ValueRe\ - ferenceR\x03lhs\x12h\n\x03rhs\x18\x02\x20\x01(\x0b2V.bitdrift_public.pro\ - tobuf.workflow.v1.Workflow.Action.ActionGenerateLog.ValueReferenceR\x03r\ - hs\x1a\x93\x05\n\x0eGeneratedField\x12\x12\n\x04name\x18\x01\x20\x01(\tR\ - \x04name\x12p\n\x06single\x18\x02\x20\x01(\x0b2V.bitdrift_public.protobu\ - f.workflow.v1.Workflow.Action.ActionGenerateLog.ValueReferenceH\0R\x06si\ - ngle\x12x\n\x08subtract\x18\x03\x20\x01(\x0b2Z.bitdrift_public.protobuf.\ - workflow.v1.Workflow.Action.ActionGenerateLog.ValueReferencePairH\0R\x08\ - subtract\x12n\n\x03add\x18\x04\x20\x01(\x0b2Z.bitdrift_public.protobuf.w\ - orkflow.v1.Workflow.Action.ActionGenerateLog.ValueReferencePairH\0R\x03a\ - dd\x12x\n\x08multiply\x18\x05\x20\x01(\x0b2Z.bitdrift_public.protobuf.wo\ - rkflow.v1.Workflow.Action.ActionGenerateLog.ValueReferencePairH\0R\x08mu\ - ltiply\x12t\n\x06divide\x18\x06\x20\x01(\x0b2Z.bitdrift_public.protobuf.\ - workflow.v1.Workflow.Action.ActionGenerateLog.ValueReferencePairH\0R\x06\ - divideB!\n\x1agenerated_field_value_type\x12\x03\xf8B\x01\x1a\xa9\x05\n\ - \x12ActionFlushBuffers\x12\x1d\n\nbuffer_ids\x18\x01\x20\x03(\tR\tbuffer\ - Ids\x12\x17\n\x02id\x18\x02\x20\x01(\tR\x02idB\x07\xfaB\x04r\x02\x10\x01\ - \x12p\n\tstreaming\x18\x03\x20\x01(\x0b2R.bitdrift_public.protobuf.workf\ - low.v1.Workflow.Action.ActionFlushBuffers.StreamingR\tstreaming\x1a\xe8\ - \x03\n\tStreaming\x12G\n\x20destination_streaming_buffer_ids\x18\x01\x20\ - \x03(\tR\x1ddestinationStreamingBufferIds\x12\x9a\x01\n\x14termination_c\ - riteria\x18\x02\x20\x03(\x0b2g.bitdrift_public.protobuf.workflow.v1.Work\ - flow.Action.ActionFlushBuffers.Streaming.TerminationCriterionR\x13termin\ - ationCriteria\x1a\xf4\x01\n\x14TerminationCriterion\x12\x92\x01\n\nlogs_\ - count\x18\x01\x20\x01(\x0b2q.bitdrift_public.protobuf.workflow.v1.Workfl\ - ow.Action.ActionFlushBuffers.Streaming.TerminationCriterion.LogsCountH\0\ - R\tlogsCount\x1a:\n\tLogsCount\x12-\n\x0emax_logs_count\x18\x01\x20\x01(\ - \x04R\x0cmaxLogsCountB\x07\xfaB\x042\x02\x20\0B\x0b\n\x04type\x12\x03\ - \xf8B\x01\x1a\xa3\x04\n\x10ActionEmitMetric\x12\x17\n\x02id\x18\x01\x20\ - \x01(\tR\x02idB\x07\xfaB\x04r\x02\x10\x01\x12j\n\x07counter\x18\x02\x20\ - \x01(\x0b2N.bitdrift_public.protobuf.workflow.v1.Workflow.Action.ActionE\ - mitMetric.CounterH\0R\x07counter\x12p\n\thistogram\x18\x05\x20\x01(\x0b2\ - P.bitdrift_public.protobuf.workflow.v1.Workflow.Action.ActionEmitMetric.\ - HistogramH\0R\thistogram\x12\x16\n\x05fixed\x18\x03\x20\x01(\rH\x01R\x05\ - fixed\x12h\n\x0ffield_extracted\x18\x06\x20\x01(\x0b2=.bitdrift_public.p\ - rotobuf.workflow.v1.Workflow.FieldExtractedH\x01R\x0efieldExtracted\x12M\ - \n\x04tags\x18\x04\x20\x03(\x0b29.bitdrift_public.protobuf.workflow.v1.W\ - orkflow.Action.TagR\x04tags\x1a\t\n\x07Counter\x1a\x0b\n\tHistogramB\x12\ - \n\x0bmetric_type\x12\x03\xf8B\x01B\x1b\n\x14value_extractor_type\x12\ - \x03\xf8B\x01\x1a\xa0\x01\n\x17ActionEmitSankeyDiagram\x12\x17\n\x02id\ - \x18\x01\x20\x01(\tR\x02idB\x07\xfaB\x04r\x02\x10\x01\x12\x1d\n\x05limit\ - \x18\x02\x20\x01(\rR\x05limitB\x07\xfaB\x04*\x02\x20\0\x12M\n\x04tags\ - \x18\x03\x20\x03(\x0b29.bitdrift_public.protobuf.workflow.v1.Workflow.Ac\ - tion.TagR\x04tags\x1a\xf6\x02\n\x03Tag\x12\x1b\n\x04name\x18\x01\x20\x01\ - (\tR\x04nameB\x07\xfaB\x04r\x02\x10\x01\x12*\n\x0bfixed_value\x18\x02\ - \x20\x01(\tH\0R\nfixedValueB\x07\xfaB\x04r\x02\x10\x01\x12h\n\x0ffield_e\ - xtracted\x18\x03\x20\x01(\x0b2=.bitdrift_public.protobuf.workflow.v1.Wor\ - kflow.FieldExtractedH\0R\x0efieldExtracted\x12.\n\x12log_body_extracted\ - \x18\x04\x20\x01(\x08H\0R\x10logBodyExtracted\x12{\n\x16feature_flag_ext\ - racted\x18\x05\x20\x01(\x0b2C.bitdrift_public.protobuf.workflow.v1.Workf\ - low.FeatureFlagExtractedH\0R\x14featureFlagExtractedB\x0f\n\x08tag_type\ - \x12\x03\xf8B\x01\x1a\x1c\n\x14ActionTakeScreenshotJ\x04\x08\x01\x10\x02\ - B\x12\n\x0baction_type\x12\x03\xf8B\x01\x1a\xb9\x01\n\tExecution\x12~\n\ - \x13execution_exclusive\x18\x01\x20\x01(\x0b2K.bitdrift_public.protobuf.\ - workflow.v1.Workflow.Execution.ExecutionExclusiveH\0R\x12executionExclus\ - ive\x1a\x14\n\x12ExecutionExclusiveB\x10\n\x0eexecution_typeJ\x04\x08\ - \x02\x10\x03\x1a6\n\x15LimitMatchedLogsCount\x12\x1d\n\x05count\x18\x01\ - \x20\x01(\rR\x05countB\x07\xfaB\x04*\x02\x20\0\x1a9\n\rLimitDuration\x12\ - (\n\x0bduration_ms\x18\x02\x20\x01(\x04R\ndurationMsB\x07\xfaB\x042\x02\ - \x20\0\x1a\xb1\x01\n\x0eFieldExtracted\x12&\n\nfield_name\x18\x01\x20\ - \x01(\tR\tfieldNameB\x07\xfaB\x04r\x02\x10\x01\x12[\n\x05exact\x18\x02\ - \x20\x01(\x0b2C.bitdrift_public.protobuf.workflow.v1.Workflow.FieldExtra\ - cted.ExactH\0R\x05exact\x1a\x07\n\x05ExactB\x11\n\x0fextraction_type\x1a\ - \xb2\x01\n\x14FeatureFlagExtracted\x12\x1b\n\x04name\x18\x01\x20\x01(\tR\ - \x04nameB\x07\xfaB\x04r\x02\x10\x01\x12a\n\x05exact\x18\x02\x20\x01(\x0b\ - 2I.bitdrift_public.protobuf.workflow.v1.Workflow.FeatureFlagExtracted.Ex\ - actH\0R\x05exact\x1a\x07\n\x05ExactB\x11\n\x0fextraction_typeb\x06proto3\ + ic.protobuf.workflow.v1\x1a5bitdrift_public/protobuf/matcher/v1/log_matc\ + her.proto\x1a/bitdrift_public/protobuf/state/v1/matcher.proto\x1a-bitdri\ + ft_public/protobuf/state/v1/scope.proto\x1a\x17validate/validate.proto\"\ + f\n\x16WorkflowsConfiguration\x12L\n\tworkflows\x18\x01\x20\x03(\x0b2..b\ + itdrift_public.protobuf.workflow.v1.WorkflowR\tworkflows\"\xc78\n\x08Wor\ + kflow\x12\x17\n\x02id\x18\x01\x20\x01(\tR\x02idB\x07\xfaB\x04r\x02\x10\ + \x01\x12V\n\x06states\x18\x02\x20\x03(\x0b24.bitdrift_public.protobuf.wo\ + rkflow.v1.Workflow.StateR\x06statesB\x08\xfaB\x05\x92\x01\x02\x08\x01\ + \x12V\n\texecution\x18\x03\x20\x01(\x0b28.bitdrift_public.protobuf.workf\ + low.v1.Workflow.ExecutionR\texecution\x12}\n\x18limit_matched_logs_count\ + \x18\x04\x20\x01(\x0b2D.bitdrift_public.protobuf.workflow.v1.Workflow.Li\ + mitMatchedLogsCountR\x15limitMatchedLogsCount\x12c\n\x0elimit_duration\ + \x18\x05\x20\x01(\x0b2<.bitdrift_public.protobuf.workflow.v1.Workflow.Li\ + mitDurationR\rlimitDuration\x1a\xd9\x01\n\x05State\x12\x17\n\x02id\x18\ + \x01\x20\x01(\tR\x02idB\x07\xfaB\x04r\x02\x10\x01\x12[\n\x0btransitions\ + \x18\x02\x20\x03(\x0b29.bitdrift_public.protobuf.workflow.v1.Workflow.Tr\ + ansitionR\x0btransitions\x12Z\n\x07timeout\x18\x03\x20\x01(\x0b2@.bitdri\ + ft_public.protobuf.workflow.v1.Workflow.TransitionTimeoutR\x07timeout\ + \x1a\xbd\x01\n\x11TransitionTimeout\x12/\n\x0ftarget_state_id\x18\x01\ + \x20\x01(\tR\rtargetStateIdB\x07\xfaB\x04r\x02\x10\x01\x12&\n\ntimeout_m\ + s\x18\x02\x20\x01(\x04R\ttimeoutMsB\x07\xfaB\x042\x02\x20\0\x12O\n\x07ac\ + tions\x18\x03\x20\x03(\x0b25.bitdrift_public.protobuf.workflow.v1.Workfl\ + ow.ActionR\x07actions\x1a\xc5\x02\n\nTransition\x12/\n\x0ftarget_state_i\ + d\x18\x01\x20\x01(\tR\rtargetStateIdB\x07\xfaB\x04r\x02\x10\x01\x12Q\n\ + \x04rule\x18\x02\x20\x01(\x0b23.bitdrift_public.protobuf.workflow.v1.Wor\ + kflow.RuleR\x04ruleB\x08\xfaB\x05\x8a\x01\x02\x10\x01\x12O\n\x07actions\ + \x18\x03\x20\x03(\x0b25.bitdrift_public.protobuf.workflow.v1.Workflow.Ac\ + tionR\x07actions\x12b\n\nextensions\x18\x04\x20\x03(\x0b2B.bitdrift_publ\ + ic.protobuf.workflow.v1.Workflow.TransitionExtensionR\nextensions\x1a\ + \x81\x02\n\x04Rule\x12c\n\x0erule_log_match\x18\x01\x20\x01(\x0b2;.bitdr\ + ift_public.protobuf.workflow.v1.Workflow.RuleLogMatchH\0R\x0cruleLogMatc\ + h\x12|\n\x17rule_state_change_match\x18\x03\x20\x01(\x0b2C.bitdrift_publ\ + ic.protobuf.workflow.v1.Workflow.RuleStateChangeMatchH\0R\x14ruleStateCh\ + angeMatchB\x10\n\trule_type\x12\x03\xf8B\x01J\x04\x08\x02\x10\x03\x1a\ + \xe4\x06\n\x13TransitionExtension\x12\xa8\x01\n\x1fsankey_diagram_value_\ + extraction\x18\x01\x20\x01(\x0b2_.bitdrift_public.protobuf.workflow.v1.W\ + orkflow.TransitionExtension.SankeyDiagramValueExtractionH\0R\x1csankeyDi\ + agramValueExtraction\x12y\n\x0esave_timestamp\x18\x02\x20\x01(\x0b2P.bit\ + drift_public.protobuf.workflow.v1.Workflow.TransitionExtension.SaveTimes\ + tampH\0R\rsaveTimestamp\x12m\n\nsave_field\x18\x03\x20\x01(\x0b2L.bitdri\ + ft_public.protobuf.workflow.v1.Workflow.TransitionExtension.SaveFieldH\0\ + R\tsaveField\x1a\x1f\n\rSaveTimestamp\x12\x0e\n\x02id\x18\x01\x20\x01(\t\ + R\x02id\x1a:\n\tSaveField\x12\x0e\n\x02id\x18\x01\x20\x01(\tR\x02id\x12\ + \x1d\n\nfield_name\x18\x02\x20\x01(\tR\tfieldName\x1a\xc3\x02\n\x1cSanke\ + yDiagramValueExtraction\x123\n\x11sankey_diagram_id\x18\x01\x20\x01(\tR\ + \x0fsankeyDiagramIdB\x07\xfaB\x04r\x02\x10\x01\x12\x1f\n\x05fixed\x18\ + \x02\x20\x01(\tH\0R\x05fixedB\x07\xfaB\x04r\x02\x10\x01\x12h\n\x0ffield_\ + extracted\x18\x03\x20\x01(\x0b2=.bitdrift_public.protobuf.workflow.v1.Wo\ + rkflow.FieldExtractedH\0R\x0efieldExtracted\x12P\n%counts_toward_sankey_\ + extraction_limit\x18\x04\x20\x01(\x08R!countsTowardSankeyExtractionLimit\ + B\x11\n\nvalue_type\x12\x03\xf8B\x01B\x15\n\x0eextension_type\x12\x03\ + \xf8B\x01\x1a\x89\x01\n\x0cRuleLogMatch\x12Z\n\x0blog_matcher\x18\x01\ + \x20\x01(\x0b2/.bitdrift_public.protobuf.matcher.v1.LogMatcherR\nlogMatc\ + herB\x08\xfaB\x05\x8a\x01\x02\x10\x01\x12\x1d\n\x05count\x18\x02\x20\x01\ + (\rR\x05countB\x07\xfaB\x04*\x02\x20\0\x1a\xb6\x02\n\x14RuleStateChangeM\ + atch\x12M\n\x05scope\x18\x01\x20\x01(\x0e2-.bitdrift_public.protobuf.sta\ + te.v1.StateScopeR\x05scopeB\x08\xfaB\x05\x82\x01\x02\x10\x01\x12\x19\n\ + \x03key\x18\x02\x20\x01(\tR\x03keyB\x07\xfaB\x04r\x02\x10\x01\x12Y\n\x0e\ + previous_value\x18\x03\x20\x01(\x0b22.bitdrift_public.protobuf.state.v1.\ + StateValueMatchR\rpreviousValue\x12Y\n\tnew_value\x18\x04\x20\x01(\x0b22\ + .bitdrift_public.protobuf.state.v1.StateValueMatchR\x08newValueB\x08\xfa\ + B\x05\x8a\x01\x02\x10\x01\x1a\xe1\x1d\n\x06Action\x12|\n\x14action_flush\ + _buffers\x18\x01\x20\x01(\x0b2H.bitdrift_public.protobuf.workflow.v1.Wor\ + kflow.Action.ActionFlushBuffersH\0R\x12actionFlushBuffers\x12v\n\x12acti\ + on_emit_metric\x18\x02\x20\x01(\x0b2F.bitdrift_public.protobuf.workflow.\ + v1.Workflow.Action.ActionEmitMetricH\0R\x10actionEmitMetric\x12\x8c\x01\ + \n\x1aaction_emit_sankey_diagram\x18\x03\x20\x01(\x0b2M.bitdrift_public.\ + protobuf.workflow.v1.Workflow.Action.ActionEmitSankeyDiagramH\0R\x17acti\ + onEmitSankeyDiagram\x12\x82\x01\n\x16action_take_screenshot\x18\x04\x20\ + \x01(\x0b2J.bitdrift_public.protobuf.workflow.v1.Workflow.Action.ActionT\ + akeScreenshotH\0R\x14actionTakeScreenshot\x12y\n\x13action_generate_log\ + \x18\x05\x20\x01(\x0b2G.bitdrift_public.protobuf.workflow.v1.Workflow.Ac\ + tion.ActionGenerateLogH\0R\x11actionGenerateLog\x1a\xb1\n\n\x11ActionGen\ + erateLog\x12\x18\n\x07message\x18\x01\x20\x01(\tR\x07message\x12n\n\x06f\ + ields\x18\x02\x20\x03(\x0b2V.bitdrift_public.protobuf.workflow.v1.Workfl\ + ow.Action.ActionGenerateLog.GeneratedFieldR\x06fields\x12\x0e\n\x02id\ + \x18\x03\x20\x01(\tR\x02id\x12\x19\n\x08log_type\x18\x04\x20\x01(\rR\x07\ + logType\x1a\xe5\x01\n\x0eValueReference\x12\x16\n\x05fixed\x18\x01\x20\ + \x01(\tH\0R\x05fixed\x125\n\x16field_from_current_log\x18\x02\x20\x01(\t\ + H\0R\x13fieldFromCurrentLog\x12&\n\x0esaved_field_id\x18\x03\x20\x01(\tH\ + \0R\x0csavedFieldId\x12.\n\x12saved_timestamp_id\x18\x04\x20\x01(\tH\0R\ + \x10savedTimestampId\x12\x14\n\x04uuid\x18\x05\x20\x01(\x08H\0R\x04uuidB\ + \x16\n\x14value_reference_type\x1a\xe8\x01\n\x12ValueReferencePair\x12h\ + \n\x03lhs\x18\x01\x20\x01(\x0b2V.bitdrift_public.protobuf.workflow.v1.Wo\ + rkflow.Action.ActionGenerateLog.ValueReferenceR\x03lhs\x12h\n\x03rhs\x18\ + \x02\x20\x01(\x0b2V.bitdrift_public.protobuf.workflow.v1.Workflow.Action\ + .ActionGenerateLog.ValueReferenceR\x03rhs\x1a\x93\x05\n\x0eGeneratedFiel\ + d\x12\x12\n\x04name\x18\x01\x20\x01(\tR\x04name\x12p\n\x06single\x18\x02\ + \x20\x01(\x0b2V.bitdrift_public.protobuf.workflow.v1.Workflow.Action.Act\ + ionGenerateLog.ValueReferenceH\0R\x06single\x12x\n\x08subtract\x18\x03\ + \x20\x01(\x0b2Z.bitdrift_public.protobuf.workflow.v1.Workflow.Action.Act\ + ionGenerateLog.ValueReferencePairH\0R\x08subtract\x12n\n\x03add\x18\x04\ + \x20\x01(\x0b2Z.bitdrift_public.protobuf.workflow.v1.Workflow.Action.Act\ + ionGenerateLog.ValueReferencePairH\0R\x03add\x12x\n\x08multiply\x18\x05\ + \x20\x01(\x0b2Z.bitdrift_public.protobuf.workflow.v1.Workflow.Action.Act\ + ionGenerateLog.ValueReferencePairH\0R\x08multiply\x12t\n\x06divide\x18\ + \x06\x20\x01(\x0b2Z.bitdrift_public.protobuf.workflow.v1.Workflow.Action\ + .ActionGenerateLog.ValueReferencePairH\0R\x06divideB!\n\x1agenerated_fie\ + ld_value_type\x12\x03\xf8B\x01\x1a\xa9\x05\n\x12ActionFlushBuffers\x12\ + \x1d\n\nbuffer_ids\x18\x01\x20\x03(\tR\tbufferIds\x12\x17\n\x02id\x18\ + \x02\x20\x01(\tR\x02idB\x07\xfaB\x04r\x02\x10\x01\x12p\n\tstreaming\x18\ + \x03\x20\x01(\x0b2R.bitdrift_public.protobuf.workflow.v1.Workflow.Action\ + .ActionFlushBuffers.StreamingR\tstreaming\x1a\xe8\x03\n\tStreaming\x12G\ + \n\x20destination_streaming_buffer_ids\x18\x01\x20\x03(\tR\x1ddestinatio\ + nStreamingBufferIds\x12\x9a\x01\n\x14termination_criteria\x18\x02\x20\ + \x03(\x0b2g.bitdrift_public.protobuf.workflow.v1.Workflow.Action.ActionF\ + lushBuffers.Streaming.TerminationCriterionR\x13terminationCriteria\x1a\ + \xf4\x01\n\x14TerminationCriterion\x12\x92\x01\n\nlogs_count\x18\x01\x20\ + \x01(\x0b2q.bitdrift_public.protobuf.workflow.v1.Workflow.Action.ActionF\ + lushBuffers.Streaming.TerminationCriterion.LogsCountH\0R\tlogsCount\x1a:\ + \n\tLogsCount\x12-\n\x0emax_logs_count\x18\x01\x20\x01(\x04R\x0cmaxLogsC\ + ountB\x07\xfaB\x042\x02\x20\0B\x0b\n\x04type\x12\x03\xf8B\x01\x1a\xa3\ + \x04\n\x10ActionEmitMetric\x12\x17\n\x02id\x18\x01\x20\x01(\tR\x02idB\ + \x07\xfaB\x04r\x02\x10\x01\x12j\n\x07counter\x18\x02\x20\x01(\x0b2N.bitd\ + rift_public.protobuf.workflow.v1.Workflow.Action.ActionEmitMetric.Counte\ + rH\0R\x07counter\x12p\n\thistogram\x18\x05\x20\x01(\x0b2P.bitdrift_publi\ + c.protobuf.workflow.v1.Workflow.Action.ActionEmitMetric.HistogramH\0R\th\ + istogram\x12\x16\n\x05fixed\x18\x03\x20\x01(\rH\x01R\x05fixed\x12h\n\x0f\ + field_extracted\x18\x06\x20\x01(\x0b2=.bitdrift_public.protobuf.workflow\ + .v1.Workflow.FieldExtractedH\x01R\x0efieldExtracted\x12M\n\x04tags\x18\ + \x04\x20\x03(\x0b29.bitdrift_public.protobuf.workflow.v1.Workflow.Action\ + .TagR\x04tags\x1a\t\n\x07Counter\x1a\x0b\n\tHistogramB\x12\n\x0bmetric_t\ + ype\x12\x03\xf8B\x01B\x1b\n\x14value_extractor_type\x12\x03\xf8B\x01\x1a\ + \xa0\x01\n\x17ActionEmitSankeyDiagram\x12\x17\n\x02id\x18\x01\x20\x01(\t\ + R\x02idB\x07\xfaB\x04r\x02\x10\x01\x12\x1d\n\x05limit\x18\x02\x20\x01(\r\ + R\x05limitB\x07\xfaB\x04*\x02\x20\0\x12M\n\x04tags\x18\x03\x20\x03(\x0b2\ + 9.bitdrift_public.protobuf.workflow.v1.Workflow.Action.TagR\x04tags\x1a\ + \xf6\x02\n\x03Tag\x12\x1b\n\x04name\x18\x01\x20\x01(\tR\x04nameB\x07\xfa\ + B\x04r\x02\x10\x01\x12*\n\x0bfixed_value\x18\x02\x20\x01(\tH\0R\nfixedVa\ + lueB\x07\xfaB\x04r\x02\x10\x01\x12h\n\x0ffield_extracted\x18\x03\x20\x01\ + (\x0b2=.bitdrift_public.protobuf.workflow.v1.Workflow.FieldExtractedH\0R\ + \x0efieldExtracted\x12.\n\x12log_body_extracted\x18\x04\x20\x01(\x08H\0R\ + \x10logBodyExtracted\x12{\n\x16feature_flag_extracted\x18\x05\x20\x01(\ + \x0b2C.bitdrift_public.protobuf.workflow.v1.Workflow.FeatureFlagExtracte\ + dH\0R\x14featureFlagExtractedB\x0f\n\x08tag_type\x12\x03\xf8B\x01\x1a\ + \x1c\n\x14ActionTakeScreenshotJ\x04\x08\x01\x10\x02B\x12\n\x0baction_typ\ + e\x12\x03\xf8B\x01\x1a\xb9\x01\n\tExecution\x12~\n\x13execution_exclusiv\ + e\x18\x01\x20\x01(\x0b2K.bitdrift_public.protobuf.workflow.v1.Workflow.E\ + xecution.ExecutionExclusiveH\0R\x12executionExclusive\x1a\x14\n\x12Execu\ + tionExclusiveB\x10\n\x0eexecution_typeJ\x04\x08\x02\x10\x03\x1a6\n\x15Li\ + mitMatchedLogsCount\x12\x1d\n\x05count\x18\x01\x20\x01(\rR\x05countB\x07\ + \xfaB\x04*\x02\x20\0\x1a9\n\rLimitDuration\x12(\n\x0bduration_ms\x18\x02\ + \x20\x01(\x04R\ndurationMsB\x07\xfaB\x042\x02\x20\0\x1a\xb1\x01\n\x0eFie\ + ldExtracted\x12&\n\nfield_name\x18\x01\x20\x01(\tR\tfieldNameB\x07\xfaB\ + \x04r\x02\x10\x01\x12[\n\x05exact\x18\x02\x20\x01(\x0b2C.bitdrift_public\ + .protobuf.workflow.v1.Workflow.FieldExtracted.ExactH\0R\x05exact\x1a\x07\ + \n\x05ExactB\x11\n\x0fextraction_type\x1a\xb2\x01\n\x14FeatureFlagExtrac\ + ted\x12\x1b\n\x04name\x18\x01\x20\x01(\tR\x04nameB\x07\xfaB\x04r\x02\x10\ + \x01\x12a\n\x05exact\x18\x02\x20\x01(\x0b2I.bitdrift_public.protobuf.wor\ + kflow.v1.Workflow.FeatureFlagExtracted.ExactH\0R\x05exact\x1a\x07\n\x05E\ + xactB\x11\n\x0fextraction_typeb\x06proto3\ "; /// `FileDescriptorProto` object which was a source for this generated file @@ -7228,10 +7486,12 @@ pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); file_descriptor.get(|| { let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { - let mut deps = ::std::vec::Vec::with_capacity(2); - deps.push(super::validate::file_descriptor().clone()); + let mut deps = ::std::vec::Vec::with_capacity(4); deps.push(super::log_matcher::file_descriptor().clone()); - let mut messages = ::std::vec::Vec::with_capacity(34); + deps.push(super::matcher::file_descriptor().clone()); + deps.push(super::scope::file_descriptor().clone()); + deps.push(super::validate::file_descriptor().clone()); + let mut messages = ::std::vec::Vec::with_capacity(35); messages.push(WorkflowsConfiguration::generated_message_descriptor_data()); messages.push(Workflow::generated_message_descriptor_data()); messages.push(workflow::State::generated_message_descriptor_data()); @@ -7240,6 +7500,7 @@ pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { messages.push(workflow::Rule::generated_message_descriptor_data()); messages.push(workflow::TransitionExtension::generated_message_descriptor_data()); messages.push(workflow::RuleLogMatch::generated_message_descriptor_data()); + messages.push(workflow::RuleStateChangeMatch::generated_message_descriptor_data()); messages.push(workflow::Action::generated_message_descriptor_data()); messages.push(workflow::Execution::generated_message_descriptor_data()); messages.push(workflow::LimitMatchedLogsCount::generated_message_descriptor_data()); diff --git a/bd-test-helpers/src/workflow/mod.rs b/bd-test-helpers/src/workflow/mod.rs index b3ad1041b..170f29ec7 100644 --- a/bd-test-helpers/src/workflow/mod.rs +++ b/bd-test-helpers/src/workflow/mod.rs @@ -10,7 +10,6 @@ use action_generate_log::value_reference::Value_reference_type; use action_generate_log::{GeneratedField, ValueReference, ValueReferencePair}; use bd_log_primitives::{LogFields, StringOrBytes}; use bd_proto::protos; -use bd_proto::protos::log_matcher::log_matcher::log_matcher; use bd_proto::protos::logging::payload::LogType; use bd_proto::protos::workflow::workflow::workflow::action::action_flush_buffers::Streaming; use bd_proto::protos::workflow::workflow::workflow::action::action_flush_buffers::streaming::{ @@ -41,7 +40,8 @@ use bd_proto::protos::workflow::workflow::workflow::{ TransitionExtension, TransitionTimeout, }; -use log_matcher::base_log_matcher::string_value_match::String_value_match_type; +use protos::value_matcher::value_matcher::string_value_match::String_value_match_type; +use protos::value_matcher::value_matcher::Operator; use protobuf::MessageField; use protos::log_matcher::log_matcher::LogMatcher; use protos::log_matcher::log_matcher::log_matcher::base_log_matcher::Match_type::{ @@ -521,13 +521,13 @@ pub fn make_log_match_rule(matcher: LogMatcher, count: u32) -> Rule { #[must_use] pub fn make_log_message_matcher( value: &str, - operator: log_matcher::base_log_matcher::Operator, + operator: Operator, ) -> LogMatcher { LogMatcher { matcher: Some(Matcher::BaseMatcher(BaseLogMatcher { match_type: Some(MessageMatch(base_log_matcher::MessageMatch { string_value_match: protobuf::MessageField::from_option(Some( - base_log_matcher::StringValueMatch { + protos::value_matcher::value_matcher::StringValueMatch { operator: operator.into(), string_value_match_type: Some(String_value_match_type::MatchValue(value.to_string())), ..Default::default() @@ -548,8 +548,8 @@ pub fn make_log_tag_matcher(name: &str, value: &str) -> LogMatcher { match_type: Some(TagMatch(base_log_matcher::TagMatch { tag_key: name.to_string(), value_match: Some(Value_match::StringValueMatch( - base_log_matcher::StringValueMatch { - operator: log_matcher::base_log_matcher::Operator::OPERATOR_EQUALS.into(), + protos::value_matcher::value_matcher::StringValueMatch { + operator: Operator::OPERATOR_EQUALS.into(), string_value_match_type: Some(String_value_match_type::MatchValue(value.to_string())), ..Default::default() }, diff --git a/bd-workflows/src/config.rs b/bd-workflows/src/config.rs index f3a3b0e28..cdcf3909d 100644 --- a/bd-workflows/src/config.rs +++ b/bd-workflows/src/config.rs @@ -480,6 +480,9 @@ impl Transition { Rule_type::RuleLogMatch(rule) => { Predicate::LogMatch(Tree::new(&rule.log_matcher)?, rule.count) }, + Rule_type::RuleStateChangeMatch(_) => { + return Err(anyhow!("RuleStateChangeMatch is not yet implemented")); + }, }; let actions = transition From 768d85c58789d50a1c4a7fdf72790e25ec4509f7 Mon Sep 17 00:00:00 2001 From: Snow Pettersen Date: Mon, 1 Dec 2025 14:15:27 -0800 Subject: [PATCH 2/5] support any scope --- bd-log-matcher/src/matcher.rs | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/bd-log-matcher/src/matcher.rs b/bd-log-matcher/src/matcher.rs index 270a002d7..7003f07e8 100644 --- a/bd-log-matcher/src/matcher.rs +++ b/bd-log-matcher/src/matcher.rs @@ -23,7 +23,6 @@ use base_log_matcher::tag_match::Value_match::{ SemVerValueMatch, StringValueMatch, }; -use bd_proto::protos::value_matcher::value_matcher::Operator; use bd_log_primitives::tiny_set::TinyMap; use bd_log_primitives::{FieldsRef, LogLevel, LogMessage}; use bd_proto::protos::config::v1::config::log_matcher::base_log_matcher::StringMatchType; @@ -42,8 +41,10 @@ use bd_proto::protos::value_matcher::value_matcher::int_value_match::Int_value_m use bd_proto::protos::value_matcher::value_matcher::string_value_match::String_value_match_type; use bd_proto::protos::value_matcher::value_matcher::{ IntValueMatch as IntValueMatch_type, + Operator, StringValueMatch as StringValueMatch_type, }; +use bd_state::Scope; use log_matcher::LogMatcher; use log_matcher::log_matcher::{BaseLogMatcher, Matcher, base_log_matcher}; use regex::Regex; @@ -429,12 +430,12 @@ impl StringMatch { } } -/// Represents either the log message or the field key-value to match against. +/// Represents either the input type to match against. #[derive(Clone, Debug, PartialEq, Eq)] pub enum InputType { Message, Field(String), - FeatureFlag(String), + State(Scope, String), } impl InputType { @@ -447,9 +448,7 @@ impl InputType { match self { Self::Message => message.as_str().map(Cow::Borrowed), Self::Field(field_key) => fields.field_value(field_key), - Self::FeatureFlag(flag_key) => state - .get(bd_state::Scope::FeatureFlag, flag_key) - .map(Cow::Borrowed), + Self::State(scope, flag_key) => state.get(*scope, flag_key).map(Cow::Borrowed), } } } @@ -599,20 +598,20 @@ impl Leaf { )?, ), StateMatch(state_match) => { - // Get the state key from the match let state_key = state_match.state_key.clone(); - - // Handle state match based on the scope - let input_type = match state_match.scope.enum_value_or_default() { - bd_proto::protos::state::scope::StateScope::FEATURE_FLAG => { - InputType::FeatureFlag(state_key) - }, + let scope = match state_match.scope.enum_value_or_default() { + bd_proto::protos::state::scope::StateScope::FEATURE_FLAG => Scope::FeatureFlag, + bd_proto::protos::state::scope::StateScope::GLOBAL_STATE => Scope::GlobalState, _ => { - // For now, we only support feature flags. Other scopes would need additional handling. + // For now, we only support feature flags. Other scopes would need additional + // handling. + // We'll need to config version guard any new scopes. return Err(anyhow!("Unsupported state scope")); }, }; + let input_type = InputType::State(scope, state_key); + // Handle the value match match state_match .state_value_match From 05c75f8fa29930dd33d75dc35869834886b9f987 Mon Sep 17 00:00:00 2001 From: Snow Pettersen Date: Mon, 1 Dec 2025 14:23:37 -0800 Subject: [PATCH 3/5] fmt --- bd-log-matcher/src/matcher.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bd-log-matcher/src/matcher.rs b/bd-log-matcher/src/matcher.rs index 7003f07e8..5f42dee11 100644 --- a/bd-log-matcher/src/matcher.rs +++ b/bd-log-matcher/src/matcher.rs @@ -36,6 +36,7 @@ use bd_proto::protos::config::v1::config::{ }; use bd_proto::protos::log_matcher::log_matcher; use bd_proto::protos::logging::payload::LogType; +use bd_proto::protos::state::scope::StateScope; use bd_proto::protos::value_matcher::value_matcher::double_value_match::Double_value_match_type; use bd_proto::protos::value_matcher::value_matcher::int_value_match::Int_value_match_type; use bd_proto::protos::value_matcher::value_matcher::string_value_match::String_value_match_type; @@ -600,9 +601,9 @@ impl Leaf { StateMatch(state_match) => { let state_key = state_match.state_key.clone(); let scope = match state_match.scope.enum_value_or_default() { - bd_proto::protos::state::scope::StateScope::FEATURE_FLAG => Scope::FeatureFlag, - bd_proto::protos::state::scope::StateScope::GLOBAL_STATE => Scope::GlobalState, - _ => { + StateScope::FEATURE_FLAG => Scope::FeatureFlag, + StateScope::GLOBAL_STATE => Scope::GlobalState, + StateScope::UNSPECIFIED => { // For now, we only support feature flags. Other scopes would need additional // handling. // We'll need to config version guard any new scopes. From 3e90961f0973f16b1c74599f14be735ebfe5584a Mon Sep 17 00:00:00 2001 From: Snow Pettersen Date: Mon, 1 Dec 2025 14:29:27 -0800 Subject: [PATCH 4/5] fmt --- bd-log-matcher/src/matcher_test.rs | 168 ++++++++++++++++------------ bd-test-helpers/src/workflow/mod.rs | 9 +- 2 files changed, 99 insertions(+), 78 deletions(-) diff --git a/bd-log-matcher/src/matcher_test.rs b/bd-log-matcher/src/matcher_test.rs index 24131400d..f5e6c740b 100644 --- a/bd-log-matcher/src/matcher_test.rs +++ b/bd-log-matcher/src/matcher_test.rs @@ -24,10 +24,10 @@ use bd_proto::protos::log_matcher::log_matcher::{LogMatcher, log_matcher}; use bd_proto::protos::logging::payload::LogType; use bd_proto::protos::state::matcher::state_value_match; use bd_proto::protos::state::scope::StateScope; +use bd_proto::protos::value_matcher::value_matcher::Operator; use bd_proto::protos::value_matcher::value_matcher::double_value_match::Double_value_match_type; use bd_proto::protos::value_matcher::value_matcher::int_value_match::Int_value_match_type; use bd_proto::protos::value_matcher::value_matcher::string_value_match::String_value_match_type; -use bd_proto::protos::value_matcher::value_matcher::Operator; use bd_state::StateReader; use log_matcher::base_log_matcher::Match_type::{MessageMatch, StateMatch, TagMatch}; use log_matcher::base_log_matcher::tag_match::Value_match::{ @@ -280,11 +280,13 @@ fn test_tag_binary_string_eq_matcher() { fn test_extracted_double_matcher() { let config = simple_log_matcher(TagMatch(base_log_matcher::TagMatch { tag_key: "key".to_string(), - value_match: Some(DoubleValueMatch(bd_proto::protos::value_matcher::value_matcher::DoubleValueMatch { - operator: Operator::OPERATOR_EQUALS.into(), - double_value_match_type: Some(Double_value_match_type::SaveFieldId("id1".to_string())), - ..Default::default() - })), + value_match: Some(DoubleValueMatch( + bd_proto::protos::value_matcher::value_matcher::DoubleValueMatch { + operator: Operator::OPERATOR_EQUALS.into(), + double_value_match_type: Some(Double_value_match_type::SaveFieldId("id1".to_string())), + ..Default::default() + }, + )), ..Default::default() })); @@ -319,11 +321,13 @@ fn test_tag_double_matcher() { fn make_config(match_value: f64, operator: Operator) -> LogMatcher { simple_log_matcher(TagMatch(base_log_matcher::TagMatch { tag_key: "key".to_string(), - value_match: Some(DoubleValueMatch(bd_proto::protos::value_matcher::value_matcher::DoubleValueMatch { - operator: operator.into(), - double_value_match_type: Some(Double_value_match_type::MatchValue(match_value)), - ..Default::default() - })), + value_match: Some(DoubleValueMatch( + bd_proto::protos::value_matcher::value_matcher::DoubleValueMatch { + operator: operator.into(), + double_value_match_type: Some(Double_value_match_type::MatchValue(match_value)), + ..Default::default() + }, + )), ..Default::default() })) } @@ -393,11 +397,13 @@ fn test_tag_double_matcher() { fn test_extracted_int_matcher() { let config = simple_log_matcher(TagMatch(base_log_matcher::TagMatch { tag_key: "key".to_string(), - value_match: Some(IntValueMatch(bd_proto::protos::value_matcher::value_matcher::IntValueMatch { - operator: Operator::OPERATOR_EQUALS.into(), - int_value_match_type: Some(Int_value_match_type::SaveFieldId("id1".to_string())), - ..Default::default() - })), + value_match: Some(IntValueMatch( + bd_proto::protos::value_matcher::value_matcher::IntValueMatch { + operator: Operator::OPERATOR_EQUALS.into(), + int_value_match_type: Some(Int_value_match_type::SaveFieldId("id1".to_string())), + ..Default::default() + }, + )), ..Default::default() })); @@ -423,11 +429,13 @@ fn test_extracted_int_matcher() { fn test_tag_int_lte_matcher() { let config = simple_log_matcher(TagMatch(base_log_matcher::TagMatch { tag_key: "key".to_string(), - value_match: Some(IntValueMatch(bd_proto::protos::value_matcher::value_matcher::IntValueMatch { - operator: Operator::OPERATOR_LESS_THAN_OR_EQUAL.into(), - int_value_match_type: Some(Int_value_match_type::MatchValue(12)), - ..Default::default() - })), + value_match: Some(IntValueMatch( + bd_proto::protos::value_matcher::value_matcher::IntValueMatch { + operator: Operator::OPERATOR_LESS_THAN_OR_EQUAL.into(), + int_value_match_type: Some(Int_value_match_type::MatchValue(12)), + ..Default::default() + }, + )), ..Default::default() })); @@ -454,11 +462,13 @@ fn test_tag_int_lte_matcher() { fn test_tag_string_gt_matcher() { let config = simple_log_matcher(TagMatch(base_log_matcher::TagMatch { tag_key: "key".to_string(), - value_match: Some(StringValueMatch(bd_proto::protos::value_matcher::value_matcher::StringValueMatch { - operator: Operator::OPERATOR_GREATER_THAN.into(), - string_value_match_type: Some(String_value_match_type::MatchValue("40".to_string())), - ..Default::default() - })), + value_match: Some(StringValueMatch( + bd_proto::protos::value_matcher::value_matcher::StringValueMatch { + operator: Operator::OPERATOR_GREATER_THAN.into(), + string_value_match_type: Some(String_value_match_type::MatchValue("40".to_string())), + ..Default::default() + }, + )), ..Default::default() })); @@ -482,11 +492,13 @@ fn test_tag_string_gt_matcher() { fn test_tag_int_invalid_regex_matcher() { let config = simple_log_matcher(TagMatch(base_log_matcher::TagMatch { tag_key: "key".to_string(), - value_match: Some(IntValueMatch(bd_proto::protos::value_matcher::value_matcher::IntValueMatch { - operator: Operator::OPERATOR_REGEX.into(), - int_value_match_type: Some(Int_value_match_type::MatchValue(12)), - ..Default::default() - })), + value_match: Some(IntValueMatch( + bd_proto::protos::value_matcher::value_matcher::IntValueMatch { + operator: Operator::OPERATOR_REGEX.into(), + int_value_match_type: Some(Int_value_match_type::MatchValue(12)), + ..Default::default() + }, + )), ..Default::default() })); @@ -500,11 +512,13 @@ fn test_tag_int_invalid_regex_matcher() { fn test_tag_log_type_invalid_config_value() { let config = simple_log_matcher(TagMatch(base_log_matcher::TagMatch { tag_key: "log_type".to_string(), - value_match: Some(IntValueMatch(bd_proto::protos::value_matcher::value_matcher::IntValueMatch { - operator: Operator::OPERATOR_REGEX.into(), // this is ignored - int_value_match_type: Some(Int_value_match_type::MatchValue(-1)), // invalid - ..Default::default() - })), + value_match: Some(IntValueMatch( + bd_proto::protos::value_matcher::value_matcher::IntValueMatch { + operator: Operator::OPERATOR_REGEX.into(), // this is ignored + int_value_match_type: Some(Int_value_match_type::MatchValue(-1)), // invalid + ..Default::default() + }, + )), ..Default::default() })); @@ -518,11 +532,13 @@ fn test_tag_log_type_invalid_config_value() { fn test_tag_log_type() { let config = simple_log_matcher(TagMatch(base_log_matcher::TagMatch { tag_key: "log_type".to_string(), - value_match: Some(IntValueMatch(bd_proto::protos::value_matcher::value_matcher::IntValueMatch { - operator: Operator::OPERATOR_REGEX.into(), // this is ignored - int_value_match_type: Some(Int_value_match_type::MatchValue(3)), - ..Default::default() - })), + value_match: Some(IntValueMatch( + bd_proto::protos::value_matcher::value_matcher::IntValueMatch { + operator: Operator::OPERATOR_REGEX.into(), // this is ignored + int_value_match_type: Some(Int_value_match_type::MatchValue(3)), + ..Default::default() + }, + )), ..Default::default() })); @@ -543,11 +559,13 @@ fn test_tag_log_type() { fn test_tag_log_level() { let config = simple_log_matcher(TagMatch(base_log_matcher::TagMatch { tag_key: "log_level".to_string(), - value_match: Some(IntValueMatch(bd_proto::protos::value_matcher::value_matcher::IntValueMatch { - operator: Operator::OPERATOR_GREATER_THAN_OR_EQUAL.into(), - int_value_match_type: Some(Int_value_match_type::MatchValue(2)), // INFO - ..Default::default() - })), + value_match: Some(IntValueMatch( + bd_proto::protos::value_matcher::value_matcher::IntValueMatch { + operator: Operator::OPERATOR_GREATER_THAN_OR_EQUAL.into(), + int_value_match_type: Some(Int_value_match_type::MatchValue(2)), // INFO + ..Default::default() + }, + )), ..Default::default() })); @@ -566,11 +584,13 @@ fn test_tag_log_level() { fn semver_tag_matcher_config(value: &str, operator: Operator) -> LogMatcher { simple_log_matcher(TagMatch(base_log_matcher::TagMatch { tag_key: "key".to_string(), - value_match: Some(SemVerValueMatch(bd_proto::protos::value_matcher::value_matcher::SemVerValueMatch { - operator: operator.into(), - match_value: value.to_string(), - ..Default::default() - })), + value_match: Some(SemVerValueMatch( + bd_proto::protos::value_matcher::value_matcher::SemVerValueMatch { + operator: operator.into(), + match_value: value.to_string(), + ..Default::default() + }, + )), ..Default::default() })) } @@ -701,11 +721,13 @@ fn tag_semver_neq_matcher() { fn mixed_segment_semver_matcher() { let config = simple_log_matcher(TagMatch(base_log_matcher::TagMatch { tag_key: "key".to_string(), - value_match: Some(SemVerValueMatch(bd_proto::protos::value_matcher::value_matcher::SemVerValueMatch { - operator: Operator::OPERATOR_LESS_THAN_OR_EQUAL.into(), - match_value: "1.5.foo.0".to_string(), - ..Default::default() - })), + value_match: Some(SemVerValueMatch( + bd_proto::protos::value_matcher::value_matcher::SemVerValueMatch { + operator: Operator::OPERATOR_LESS_THAN_OR_EQUAL.into(), + match_value: "1.5.foo.0".to_string(), + ..Default::default() + }, + )), ..Default::default() })); @@ -726,11 +748,13 @@ fn mixed_segment_semver_matcher() { fn test_tag_semver_eq_regex_matcher() { let config = simple_log_matcher(TagMatch(base_log_matcher::TagMatch { tag_key: "key".to_string(), - value_match: Some(SemVerValueMatch(bd_proto::protos::value_matcher::value_matcher::SemVerValueMatch { - operator: Operator::OPERATOR_REGEX.into(), - match_value: "1\\.5\\.*".to_string(), - ..Default::default() - })), + value_match: Some(SemVerValueMatch( + bd_proto::protos::value_matcher::value_matcher::SemVerValueMatch { + operator: Operator::OPERATOR_REGEX.into(), + match_value: "1\\.5\\.*".to_string(), + ..Default::default() + }, + )), ..Default::default() })); @@ -811,7 +835,9 @@ fn test_not_matcher() { fn test_is_set_matcher() { let matcher = TagMatch(base_log_matcher::TagMatch { tag_key: "foo".to_string(), - value_match: Some(IsSetMatch(bd_proto::protos::value_matcher::value_matcher::IsSetMatch::default())), + value_match: Some(IsSetMatch( + bd_proto::protos::value_matcher::value_matcher::IsSetMatch::default(), + )), ..Default::default() }); @@ -1061,11 +1087,13 @@ fn simple_log_matcher(match_type: base_log_matcher::Match_type) -> LogMatcher { fn make_message_match(operator: Operator, match_value: &str) -> base_log_matcher::Match_type { MessageMatch(base_log_matcher::MessageMatch { - string_value_match: MessageField::from_option(Some(bd_proto::protos::value_matcher::value_matcher::StringValueMatch { - operator: operator.into(), - string_value_match_type: Some(String_value_match_type::MatchValue(match_value.to_string())), - ..Default::default() - })), + string_value_match: MessageField::from_option(Some( + bd_proto::protos::value_matcher::value_matcher::StringValueMatch { + operator: operator.into(), + string_value_match_type: Some(String_value_match_type::MatchValue(match_value.to_string())), + ..Default::default() + }, + )), ..Default::default() }) } @@ -1132,11 +1160,7 @@ fn make_int_state_matcher(state_key: &str, operator: Operator, match_value: i32) })) } -fn make_double_state_matcher( - state_key: &str, - operator: Operator, - match_value: f64, -) -> LogMatcher { +fn make_double_state_matcher(state_key: &str, operator: Operator, match_value: f64) -> LogMatcher { simple_log_matcher(StateMatch(base_log_matcher::StateMatch { scope: StateScope::FEATURE_FLAG.into(), state_key: state_key.to_string(), diff --git a/bd-test-helpers/src/workflow/mod.rs b/bd-test-helpers/src/workflow/mod.rs index 170f29ec7..162c11ff0 100644 --- a/bd-test-helpers/src/workflow/mod.rs +++ b/bd-test-helpers/src/workflow/mod.rs @@ -40,8 +40,6 @@ use bd_proto::protos::workflow::workflow::workflow::{ TransitionExtension, TransitionTimeout, }; -use protos::value_matcher::value_matcher::string_value_match::String_value_match_type; -use protos::value_matcher::value_matcher::Operator; use protobuf::MessageField; use protos::log_matcher::log_matcher::LogMatcher; use protos::log_matcher::log_matcher::log_matcher::base_log_matcher::Match_type::{ @@ -50,6 +48,8 @@ use protos::log_matcher::log_matcher::log_matcher::base_log_matcher::Match_type: }; use protos::log_matcher::log_matcher::log_matcher::base_log_matcher::tag_match::Value_match; use protos::log_matcher::log_matcher::log_matcher::{BaseLogMatcher, Matcher, base_log_matcher}; +use protos::value_matcher::value_matcher::Operator; +use protos::value_matcher::value_matcher::string_value_match::String_value_match_type; use protos::workflow::workflow::workflow::action::action_emit_metric::Value_extractor_type; use protos::workflow::workflow::workflow::action::{ Action_type, @@ -519,10 +519,7 @@ pub fn make_log_match_rule(matcher: LogMatcher, count: u32) -> Rule { } #[must_use] -pub fn make_log_message_matcher( - value: &str, - operator: Operator, -) -> LogMatcher { +pub fn make_log_message_matcher(value: &str, operator: Operator) -> LogMatcher { LogMatcher { matcher: Some(Matcher::BaseMatcher(BaseLogMatcher { match_type: Some(MessageMatch(base_log_matcher::MessageMatch { From fb98cdae69bf133e38afda6294124f65ec69d09b Mon Sep 17 00:00:00 2001 From: Snow Pettersen Date: Mon, 1 Dec 2025 15:08:33 -0800 Subject: [PATCH 5/5] api from main --- api | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api b/api index cd74e066e..8a5ee9391 160000 --- a/api +++ b/api @@ -1 +1 @@ -Subproject commit cd74e066ecf9c5c1567191932bc89bea37e64672 +Subproject commit 8a5ee9391bdfb6dd89268cb3894e56c186d752db