#[non_exhaustive]pub struct DataQualityRule {
pub column: String,
pub ignore_null: bool,
pub dimension: String,
pub threshold: f64,
pub name: String,
pub description: String,
pub suspended: bool,
pub attributes: HashMap<String, String>,
pub rule_source: Option<RuleSource>,
pub debug_queries: Vec<DebugQuery>,
pub rule_type: Option<RuleType>,
/* private fields */
}Expand description
A rule captures data quality intent about a data source.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.column: StringOptional. The unnested column which this rule is evaluated against.
ignore_null: boolOptional. Rows with null values will automatically fail a rule, unless
ignore_null is true. In that case, such null rows are trivially
considered passing.
This field is only valid for the following type of rules:
- RangeExpectation
- RegexExpectation
- SetExpectation
- UniquenessExpectation
dimension: StringOptional. The dimension a rule belongs to. Results are also aggregated at the dimension level. Custom dimension name is supported with all uppercase letters and maximum length of 30 characters.
threshold: f64Optional. The minimum ratio of passing_rows / total_rows required to pass this rule, with a range of [0.0, 1.0].
0 indicates default value (i.e. 1.0).
This field is only valid for row-level type rules.
name: StringOptional. A mutable name for the rule.
- The name must contain only letters (a-z, A-Z), numbers (0-9), or hyphens (-).
- The maximum length is 63 characters.
- Must start with a letter.
- Must end with a number or a letter.
description: StringOptional. Description of the rule.
- The maximum length is 1,024 characters.
suspended: boolOptional. Whether the Rule is active or suspended. Default is false.
attributes: HashMap<String, String>Optional. Map of attribute name and value linked to the rule. The rules to evaluate can be filtered based on attributes provided here and a filter expression provided in the DataQualitySpec.filter field.
rule_source: Option<RuleSource>Output only. Contains information about the source of the rule and its relationship with the BigQuery table, where applicable.
debug_queries: Vec<DebugQuery>Optional. Specifies the debug queries for this rule. Currently, only one query is supported, but this may be expanded in the future.
rule_type: Option<RuleType>The rule-specific configuration.
Implementations§
Source§impl DataQualityRule
impl DataQualityRule
Sourcepub fn set_column<T: Into<String>>(self, v: T) -> Self
pub fn set_column<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_ignore_null<T: Into<bool>>(self, v: T) -> Self
pub fn set_ignore_null<T: Into<bool>>(self, v: T) -> Self
Sourcepub fn set_dimension<T: Into<String>>(self, v: T) -> Self
pub fn set_dimension<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_threshold<T: Into<f64>>(self, v: T) -> Self
pub fn set_threshold<T: Into<f64>>(self, v: T) -> Self
Sourcepub fn set_description<T: Into<String>>(self, v: T) -> Self
pub fn set_description<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_suspended<T: Into<bool>>(self, v: T) -> Self
pub fn set_suspended<T: Into<bool>>(self, v: T) -> Self
Sourcepub fn set_attributes<T, K, V>(self, v: T) -> Self
pub fn set_attributes<T, K, V>(self, v: T) -> Self
Sets the value of attributes.
§Example
let x = DataQualityRule::new().set_attributes([
("key0", "abc"),
("key1", "xyz"),
]);Sourcepub fn set_rule_source<T>(self, v: T) -> Selfwhere
T: Into<RuleSource>,
pub fn set_rule_source<T>(self, v: T) -> Selfwhere
T: Into<RuleSource>,
Sets the value of rule_source.
§Example
use google_cloud_dataplex_v1::model::data_quality_rule::RuleSource;
let x = DataQualityRule::new().set_rule_source(RuleSource::default()/* use setters */);Sourcepub fn set_or_clear_rule_source<T>(self, v: Option<T>) -> Selfwhere
T: Into<RuleSource>,
pub fn set_or_clear_rule_source<T>(self, v: Option<T>) -> Selfwhere
T: Into<RuleSource>,
Sets or clears the value of rule_source.
§Example
use google_cloud_dataplex_v1::model::data_quality_rule::RuleSource;
let x = DataQualityRule::new().set_or_clear_rule_source(Some(RuleSource::default()/* use setters */));
let x = DataQualityRule::new().set_or_clear_rule_source(None::<RuleSource>);Sourcepub fn set_debug_queries<T, V>(self, v: T) -> Self
pub fn set_debug_queries<T, V>(self, v: T) -> Self
Sets the value of debug_queries.
§Example
use google_cloud_dataplex_v1::model::data_quality_rule::DebugQuery;
let x = DataQualityRule::new()
.set_debug_queries([
DebugQuery::default()/* use setters */,
DebugQuery::default()/* use (different) setters */,
]);Sourcepub fn set_rule_type<T: Into<Option<RuleType>>>(self, v: T) -> Self
pub fn set_rule_type<T: Into<Option<RuleType>>>(self, v: T) -> Self
Sets the value of rule_type.
Note that all the setters affecting rule_type are mutually
exclusive.
§Example
use google_cloud_dataplex_v1::model::data_quality_rule::RangeExpectation;
let x = DataQualityRule::new().set_rule_type(Some(
google_cloud_dataplex_v1::model::data_quality_rule::RuleType::RangeExpectation(RangeExpectation::default().into())));Sourcepub fn range_expectation(&self) -> Option<&Box<RangeExpectation>>
pub fn range_expectation(&self) -> Option<&Box<RangeExpectation>>
The value of rule_type
if it holds a RangeExpectation, None if the field is not set or
holds a different branch.
Sourcepub fn set_range_expectation<T: Into<Box<RangeExpectation>>>(self, v: T) -> Self
pub fn set_range_expectation<T: Into<Box<RangeExpectation>>>(self, v: T) -> Self
Sets the value of rule_type
to hold a RangeExpectation.
Note that all the setters affecting rule_type are
mutually exclusive.
§Example
use google_cloud_dataplex_v1::model::data_quality_rule::RangeExpectation;
let x = DataQualityRule::new().set_range_expectation(RangeExpectation::default()/* use setters */);
assert!(x.range_expectation().is_some());
assert!(x.non_null_expectation().is_none());
assert!(x.set_expectation().is_none());
assert!(x.regex_expectation().is_none());
assert!(x.uniqueness_expectation().is_none());
assert!(x.statistic_range_expectation().is_none());
assert!(x.row_condition_expectation().is_none());
assert!(x.table_condition_expectation().is_none());
assert!(x.sql_assertion().is_none());
assert!(x.template_reference().is_none());Sourcepub fn non_null_expectation(&self) -> Option<&Box<NonNullExpectation>>
pub fn non_null_expectation(&self) -> Option<&Box<NonNullExpectation>>
The value of rule_type
if it holds a NonNullExpectation, None if the field is not set or
holds a different branch.
Sourcepub fn set_non_null_expectation<T: Into<Box<NonNullExpectation>>>(
self,
v: T,
) -> Self
pub fn set_non_null_expectation<T: Into<Box<NonNullExpectation>>>( self, v: T, ) -> Self
Sets the value of rule_type
to hold a NonNullExpectation.
Note that all the setters affecting rule_type are
mutually exclusive.
§Example
use google_cloud_dataplex_v1::model::data_quality_rule::NonNullExpectation;
let x = DataQualityRule::new().set_non_null_expectation(NonNullExpectation::default()/* use setters */);
assert!(x.non_null_expectation().is_some());
assert!(x.range_expectation().is_none());
assert!(x.set_expectation().is_none());
assert!(x.regex_expectation().is_none());
assert!(x.uniqueness_expectation().is_none());
assert!(x.statistic_range_expectation().is_none());
assert!(x.row_condition_expectation().is_none());
assert!(x.table_condition_expectation().is_none());
assert!(x.sql_assertion().is_none());
assert!(x.template_reference().is_none());Sourcepub fn set_expectation(&self) -> Option<&Box<SetExpectation>>
pub fn set_expectation(&self) -> Option<&Box<SetExpectation>>
The value of rule_type
if it holds a SetExpectation, None if the field is not set or
holds a different branch.
Sourcepub fn set_set_expectation<T: Into<Box<SetExpectation>>>(self, v: T) -> Self
pub fn set_set_expectation<T: Into<Box<SetExpectation>>>(self, v: T) -> Self
Sets the value of rule_type
to hold a SetExpectation.
Note that all the setters affecting rule_type are
mutually exclusive.
§Example
use google_cloud_dataplex_v1::model::data_quality_rule::SetExpectation;
let x = DataQualityRule::new().set_set_expectation(SetExpectation::default()/* use setters */);
assert!(x.set_expectation().is_some());
assert!(x.range_expectation().is_none());
assert!(x.non_null_expectation().is_none());
assert!(x.regex_expectation().is_none());
assert!(x.uniqueness_expectation().is_none());
assert!(x.statistic_range_expectation().is_none());
assert!(x.row_condition_expectation().is_none());
assert!(x.table_condition_expectation().is_none());
assert!(x.sql_assertion().is_none());
assert!(x.template_reference().is_none());Sourcepub fn regex_expectation(&self) -> Option<&Box<RegexExpectation>>
pub fn regex_expectation(&self) -> Option<&Box<RegexExpectation>>
The value of rule_type
if it holds a RegexExpectation, None if the field is not set or
holds a different branch.
Sourcepub fn set_regex_expectation<T: Into<Box<RegexExpectation>>>(self, v: T) -> Self
pub fn set_regex_expectation<T: Into<Box<RegexExpectation>>>(self, v: T) -> Self
Sets the value of rule_type
to hold a RegexExpectation.
Note that all the setters affecting rule_type are
mutually exclusive.
§Example
use google_cloud_dataplex_v1::model::data_quality_rule::RegexExpectation;
let x = DataQualityRule::new().set_regex_expectation(RegexExpectation::default()/* use setters */);
assert!(x.regex_expectation().is_some());
assert!(x.range_expectation().is_none());
assert!(x.non_null_expectation().is_none());
assert!(x.set_expectation().is_none());
assert!(x.uniqueness_expectation().is_none());
assert!(x.statistic_range_expectation().is_none());
assert!(x.row_condition_expectation().is_none());
assert!(x.table_condition_expectation().is_none());
assert!(x.sql_assertion().is_none());
assert!(x.template_reference().is_none());Sourcepub fn uniqueness_expectation(&self) -> Option<&Box<UniquenessExpectation>>
pub fn uniqueness_expectation(&self) -> Option<&Box<UniquenessExpectation>>
The value of rule_type
if it holds a UniquenessExpectation, None if the field is not set or
holds a different branch.
Sourcepub fn set_uniqueness_expectation<T: Into<Box<UniquenessExpectation>>>(
self,
v: T,
) -> Self
pub fn set_uniqueness_expectation<T: Into<Box<UniquenessExpectation>>>( self, v: T, ) -> Self
Sets the value of rule_type
to hold a UniquenessExpectation.
Note that all the setters affecting rule_type are
mutually exclusive.
§Example
use google_cloud_dataplex_v1::model::data_quality_rule::UniquenessExpectation;
let x = DataQualityRule::new().set_uniqueness_expectation(UniquenessExpectation::default()/* use setters */);
assert!(x.uniqueness_expectation().is_some());
assert!(x.range_expectation().is_none());
assert!(x.non_null_expectation().is_none());
assert!(x.set_expectation().is_none());
assert!(x.regex_expectation().is_none());
assert!(x.statistic_range_expectation().is_none());
assert!(x.row_condition_expectation().is_none());
assert!(x.table_condition_expectation().is_none());
assert!(x.sql_assertion().is_none());
assert!(x.template_reference().is_none());Sourcepub fn statistic_range_expectation(
&self,
) -> Option<&Box<StatisticRangeExpectation>>
pub fn statistic_range_expectation( &self, ) -> Option<&Box<StatisticRangeExpectation>>
The value of rule_type
if it holds a StatisticRangeExpectation, None if the field is not set or
holds a different branch.
Sourcepub fn set_statistic_range_expectation<T: Into<Box<StatisticRangeExpectation>>>(
self,
v: T,
) -> Self
pub fn set_statistic_range_expectation<T: Into<Box<StatisticRangeExpectation>>>( self, v: T, ) -> Self
Sets the value of rule_type
to hold a StatisticRangeExpectation.
Note that all the setters affecting rule_type are
mutually exclusive.
§Example
use google_cloud_dataplex_v1::model::data_quality_rule::StatisticRangeExpectation;
let x = DataQualityRule::new().set_statistic_range_expectation(StatisticRangeExpectation::default()/* use setters */);
assert!(x.statistic_range_expectation().is_some());
assert!(x.range_expectation().is_none());
assert!(x.non_null_expectation().is_none());
assert!(x.set_expectation().is_none());
assert!(x.regex_expectation().is_none());
assert!(x.uniqueness_expectation().is_none());
assert!(x.row_condition_expectation().is_none());
assert!(x.table_condition_expectation().is_none());
assert!(x.sql_assertion().is_none());
assert!(x.template_reference().is_none());Sourcepub fn row_condition_expectation(&self) -> Option<&Box<RowConditionExpectation>>
pub fn row_condition_expectation(&self) -> Option<&Box<RowConditionExpectation>>
The value of rule_type
if it holds a RowConditionExpectation, None if the field is not set or
holds a different branch.
Sourcepub fn set_row_condition_expectation<T: Into<Box<RowConditionExpectation>>>(
self,
v: T,
) -> Self
pub fn set_row_condition_expectation<T: Into<Box<RowConditionExpectation>>>( self, v: T, ) -> Self
Sets the value of rule_type
to hold a RowConditionExpectation.
Note that all the setters affecting rule_type are
mutually exclusive.
§Example
use google_cloud_dataplex_v1::model::data_quality_rule::RowConditionExpectation;
let x = DataQualityRule::new().set_row_condition_expectation(RowConditionExpectation::default()/* use setters */);
assert!(x.row_condition_expectation().is_some());
assert!(x.range_expectation().is_none());
assert!(x.non_null_expectation().is_none());
assert!(x.set_expectation().is_none());
assert!(x.regex_expectation().is_none());
assert!(x.uniqueness_expectation().is_none());
assert!(x.statistic_range_expectation().is_none());
assert!(x.table_condition_expectation().is_none());
assert!(x.sql_assertion().is_none());
assert!(x.template_reference().is_none());Sourcepub fn table_condition_expectation(
&self,
) -> Option<&Box<TableConditionExpectation>>
pub fn table_condition_expectation( &self, ) -> Option<&Box<TableConditionExpectation>>
The value of rule_type
if it holds a TableConditionExpectation, None if the field is not set or
holds a different branch.
Sourcepub fn set_table_condition_expectation<T: Into<Box<TableConditionExpectation>>>(
self,
v: T,
) -> Self
pub fn set_table_condition_expectation<T: Into<Box<TableConditionExpectation>>>( self, v: T, ) -> Self
Sets the value of rule_type
to hold a TableConditionExpectation.
Note that all the setters affecting rule_type are
mutually exclusive.
§Example
use google_cloud_dataplex_v1::model::data_quality_rule::TableConditionExpectation;
let x = DataQualityRule::new().set_table_condition_expectation(TableConditionExpectation::default()/* use setters */);
assert!(x.table_condition_expectation().is_some());
assert!(x.range_expectation().is_none());
assert!(x.non_null_expectation().is_none());
assert!(x.set_expectation().is_none());
assert!(x.regex_expectation().is_none());
assert!(x.uniqueness_expectation().is_none());
assert!(x.statistic_range_expectation().is_none());
assert!(x.row_condition_expectation().is_none());
assert!(x.sql_assertion().is_none());
assert!(x.template_reference().is_none());Sourcepub fn sql_assertion(&self) -> Option<&Box<SqlAssertion>>
pub fn sql_assertion(&self) -> Option<&Box<SqlAssertion>>
The value of rule_type
if it holds a SqlAssertion, None if the field is not set or
holds a different branch.
Sourcepub fn set_sql_assertion<T: Into<Box<SqlAssertion>>>(self, v: T) -> Self
pub fn set_sql_assertion<T: Into<Box<SqlAssertion>>>(self, v: T) -> Self
Sets the value of rule_type
to hold a SqlAssertion.
Note that all the setters affecting rule_type are
mutually exclusive.
§Example
use google_cloud_dataplex_v1::model::data_quality_rule::SqlAssertion;
let x = DataQualityRule::new().set_sql_assertion(SqlAssertion::default()/* use setters */);
assert!(x.sql_assertion().is_some());
assert!(x.range_expectation().is_none());
assert!(x.non_null_expectation().is_none());
assert!(x.set_expectation().is_none());
assert!(x.regex_expectation().is_none());
assert!(x.uniqueness_expectation().is_none());
assert!(x.statistic_range_expectation().is_none());
assert!(x.row_condition_expectation().is_none());
assert!(x.table_condition_expectation().is_none());
assert!(x.template_reference().is_none());Sourcepub fn template_reference(&self) -> Option<&Box<TemplateReference>>
pub fn template_reference(&self) -> Option<&Box<TemplateReference>>
The value of rule_type
if it holds a TemplateReference, None if the field is not set or
holds a different branch.
Sourcepub fn set_template_reference<T: Into<Box<TemplateReference>>>(
self,
v: T,
) -> Self
pub fn set_template_reference<T: Into<Box<TemplateReference>>>( self, v: T, ) -> Self
Sets the value of rule_type
to hold a TemplateReference.
Note that all the setters affecting rule_type are
mutually exclusive.
§Example
use google_cloud_dataplex_v1::model::data_quality_rule::TemplateReference;
let x = DataQualityRule::new().set_template_reference(TemplateReference::default()/* use setters */);
assert!(x.template_reference().is_some());
assert!(x.range_expectation().is_none());
assert!(x.non_null_expectation().is_none());
assert!(x.set_expectation().is_none());
assert!(x.regex_expectation().is_none());
assert!(x.uniqueness_expectation().is_none());
assert!(x.statistic_range_expectation().is_none());
assert!(x.row_condition_expectation().is_none());
assert!(x.table_condition_expectation().is_none());
assert!(x.sql_assertion().is_none());Trait Implementations§
Source§impl Clone for DataQualityRule
impl Clone for DataQualityRule
Source§fn clone(&self) -> DataQualityRule
fn clone(&self) -> DataQualityRule
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DataQualityRule
impl Debug for DataQualityRule
Source§impl Default for DataQualityRule
impl Default for DataQualityRule
Source§fn default() -> DataQualityRule
fn default() -> DataQualityRule
Source§impl Message for DataQualityRule
impl Message for DataQualityRule
Source§impl PartialEq for DataQualityRule
impl PartialEq for DataQualityRule
impl StructuralPartialEq for DataQualityRule
Auto Trait Implementations§
impl Freeze for DataQualityRule
impl RefUnwindSafe for DataQualityRule
impl Send for DataQualityRule
impl Sync for DataQualityRule
impl Unpin for DataQualityRule
impl UnsafeUnpin for DataQualityRule
impl UnwindSafe for DataQualityRule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request