Class: Google::Cloud::Dataplex::V1::DataQualityRule

Inherits:
Object
  • Object
show all
Extended by:
Protobuf::MessageExts::ClassMethods
Includes:
Protobuf::MessageExts
Defined in:
proto_docs/google/cloud/dataplex/v1/data_quality.rb

Overview

A rule captures data quality intent about a data source.

Defined Under Namespace

Classes: AttributesEntry, DebugQuery, NonNullExpectation, RangeExpectation, RegexExpectation, RowConditionExpectation, RuleSource, SetExpectation, SqlAssertion, StatisticRangeExpectation, TableConditionExpectation, TemplateReference, UniquenessExpectation

Instance Attribute Summary collapse

Instance Attribute Details

#attributes::Google::Protobuf::Map{::String => ::String}

Returns 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.

Returns:

  • (::Google::Protobuf::Map{::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.



506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
# File 'proto_docs/google/cloud/dataplex/v1/data_quality.rb', line 506

class DataQualityRule
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Evaluates whether each column value lies between a specified range.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly greater than ('>') the
  #     minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly lesser than ('<') the
  #     maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class RangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is null.
  class NonNullExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is contained by a specified set.
  # @!attribute [rw] values
  #   @return [::Array<::String>]
  #     Optional. Expected values for the column value.
  class SetExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value matches a specified regex.
  # @!attribute [rw] regex
  #   @return [::String]
  #     Optional. A regular expression the column value is expected to match.
  class RegexExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column has duplicates.
  class UniquenessExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column aggregate statistic lies between a specified
  # range.
  # @!attribute [rw] statistic
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::StatisticRangeExpectation::ColumnStatistic]
  #     Optional. The aggregate metric to evaluate.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly greater than
  #     ('>') the minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly lesser than ('<')
  #     the maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class StatisticRangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The list of aggregate metrics a rule can be evaluated against.
    module ColumnStatistic
      # Unspecified statistic type
      STATISTIC_UNDEFINED = 0

      # Evaluate the column mean
      MEAN = 1

      # Evaluate the column min
      MIN = 2

      # Evaluate the column max
      MAX = 3
    end
  end

  # Evaluates whether each row passes the specified condition.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a boolean value per row as the result.
  #
  # Example: col1 >= 0 AND col2 < 10
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class RowConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the provided expression is true.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a scalar boolean result.
  #
  # Example: MIN(col1) >= 0
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class TableConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A SQL statement that is evaluated to return rows that match an invalid
  # state. If any rows are are returned, this rule fails.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # Example: `SELECT * FROM ${data()} WHERE price < 0`
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Optional. The SQL statement.
  class SqlAssertion
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A rule that constructs a SQL statement to evaluate using a rule template
  # and parameter values. If the constructed statement returns any rows, this
  # rule fails
  # @!attribute [rw] name
  #   @return [::String]
  #     Required. The template entry name. Entry must be of EntryType
  #     `projects/dataplex-types/locations/global/entryTypes/data-quality-rule-template`
  #     and contains top-level aspect of AspectType
  #     `projects/dataplex-types/locations/global/aspectTypes/data-quality-rule-template`.
  #     The format is:
  #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
  # @!attribute [rw] values
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue}]
  #     Optional. Provides the map of parameter name and value.
  #     The maximum size of the field is 120KB (encoded as UTF-8).
  # @!attribute [r] resolved_sql
  #   @return [::String]
  #     Output only. The resolved SQL statement generated from the template with
  #     parameters substituted. It is only populated in the result.
  # @!attribute [r] rule_template
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRuleTemplate]
  #     Output only. The rule template used to resolve the rule. It is only
  #     populated in the result.
  class TemplateReference
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Represents a parameter value.
    # @!attribute [rw] value
    #   @return [::String]
    #     Required. Represents the string value of the parameter.
    class ParameterValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue]
    class ValuesEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Represents the rule source information from Catalog.
  # @!attribute [r] rule_path_elements
  #   @return [::Array<::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement>]
  #     Output only. Rule path elements represent information about the
  #     individual items in the relationship path between the scan resource and
  #     rule origin in that order.
  class RuleSource
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Path Element represents the direct relationship between the rule origin
    # (aspects) to the BigQuery Entry. Ordering of the rule relationship will
    # be maintained such that the first entry in the list is the closest
    # ancestor (BigQuery table itself). A blank source denotes that the rule is
    # derived directly from the DataScan itself.
    # @!attribute [r] entry_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntrySource]
    #     Output only. Entry source represents information about the related
    #     source entry.
    #
    #     Note: The following fields are mutually exclusive: `entry_source`, `entry_link_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [r] entry_link_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntryLinkSource]
    #     Output only. Entry link source represents information about the entry
    #     link.
    #
    #     Note: The following fields are mutually exclusive: `entry_link_source`, `entry_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RulePathElement
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Entry source represents information about the related source entry.
      # @!attribute [r] entry_type
      #   @return [::String]
      #     Output only. The entry type to represent the current characteristics
      #     of the entry in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryTypes/{entry-type-id}`.
      # @!attribute [r] entry
      #   @return [::String]
      #     Output only. The entry name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
      # @!attribute [r] display_name
      #   @return [::String]
      #     Output only. The display name of the entry.
      class EntrySource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Entry link source represents information about the entry link.
      # @!attribute [r] entry_link_type
      #   @return [::String]
      #     Output only. The entry link type to represent the current
      #     relationship between the entry and the next entry in the path.
      #     In the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryLinkTypes/{entry_link_type_id}`
      # @!attribute [r] entry_link
      #   @return [::String]
      #     Output only. The entry link name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entryLinks/{entry_link_id}`
      class EntryLinkSource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end
  end

  # Specifies a SQL statement that is evaluated to return up to 10 scalar
  # values that are used to debug rules. If the rule fails, the values can help
  # diagnose the cause of the failure.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # You can also name results with an explicit alias using `[AS] alias`. For
  # more information, see [BigQuery explicit
  # aliases](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#explicit_alias_syntax).
  #
  # Example: `SELECT MIN(col1) AS min_col1, MAX(col1) AS max_col1 FROM
  # $\\{data()}`
  # @!attribute [rw] description
  #   @return [::String]
  #     Optional. Specifies the description of the debug query.
  #
  #     * The maximum length is 1,024 characters.
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Required. Specifies the SQL statement to be executed.
  class DebugQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class AttributesEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#column::String

Returns Optional. The unnested column which this rule is evaluated against.

Returns:

  • (::String)

    Optional. The unnested column which this rule is evaluated against.



506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
# File 'proto_docs/google/cloud/dataplex/v1/data_quality.rb', line 506

class DataQualityRule
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Evaluates whether each column value lies between a specified range.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly greater than ('>') the
  #     minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly lesser than ('<') the
  #     maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class RangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is null.
  class NonNullExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is contained by a specified set.
  # @!attribute [rw] values
  #   @return [::Array<::String>]
  #     Optional. Expected values for the column value.
  class SetExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value matches a specified regex.
  # @!attribute [rw] regex
  #   @return [::String]
  #     Optional. A regular expression the column value is expected to match.
  class RegexExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column has duplicates.
  class UniquenessExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column aggregate statistic lies between a specified
  # range.
  # @!attribute [rw] statistic
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::StatisticRangeExpectation::ColumnStatistic]
  #     Optional. The aggregate metric to evaluate.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly greater than
  #     ('>') the minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly lesser than ('<')
  #     the maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class StatisticRangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The list of aggregate metrics a rule can be evaluated against.
    module ColumnStatistic
      # Unspecified statistic type
      STATISTIC_UNDEFINED = 0

      # Evaluate the column mean
      MEAN = 1

      # Evaluate the column min
      MIN = 2

      # Evaluate the column max
      MAX = 3
    end
  end

  # Evaluates whether each row passes the specified condition.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a boolean value per row as the result.
  #
  # Example: col1 >= 0 AND col2 < 10
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class RowConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the provided expression is true.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a scalar boolean result.
  #
  # Example: MIN(col1) >= 0
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class TableConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A SQL statement that is evaluated to return rows that match an invalid
  # state. If any rows are are returned, this rule fails.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # Example: `SELECT * FROM ${data()} WHERE price < 0`
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Optional. The SQL statement.
  class SqlAssertion
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A rule that constructs a SQL statement to evaluate using a rule template
  # and parameter values. If the constructed statement returns any rows, this
  # rule fails
  # @!attribute [rw] name
  #   @return [::String]
  #     Required. The template entry name. Entry must be of EntryType
  #     `projects/dataplex-types/locations/global/entryTypes/data-quality-rule-template`
  #     and contains top-level aspect of AspectType
  #     `projects/dataplex-types/locations/global/aspectTypes/data-quality-rule-template`.
  #     The format is:
  #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
  # @!attribute [rw] values
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue}]
  #     Optional. Provides the map of parameter name and value.
  #     The maximum size of the field is 120KB (encoded as UTF-8).
  # @!attribute [r] resolved_sql
  #   @return [::String]
  #     Output only. The resolved SQL statement generated from the template with
  #     parameters substituted. It is only populated in the result.
  # @!attribute [r] rule_template
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRuleTemplate]
  #     Output only. The rule template used to resolve the rule. It is only
  #     populated in the result.
  class TemplateReference
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Represents a parameter value.
    # @!attribute [rw] value
    #   @return [::String]
    #     Required. Represents the string value of the parameter.
    class ParameterValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue]
    class ValuesEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Represents the rule source information from Catalog.
  # @!attribute [r] rule_path_elements
  #   @return [::Array<::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement>]
  #     Output only. Rule path elements represent information about the
  #     individual items in the relationship path between the scan resource and
  #     rule origin in that order.
  class RuleSource
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Path Element represents the direct relationship between the rule origin
    # (aspects) to the BigQuery Entry. Ordering of the rule relationship will
    # be maintained such that the first entry in the list is the closest
    # ancestor (BigQuery table itself). A blank source denotes that the rule is
    # derived directly from the DataScan itself.
    # @!attribute [r] entry_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntrySource]
    #     Output only. Entry source represents information about the related
    #     source entry.
    #
    #     Note: The following fields are mutually exclusive: `entry_source`, `entry_link_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [r] entry_link_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntryLinkSource]
    #     Output only. Entry link source represents information about the entry
    #     link.
    #
    #     Note: The following fields are mutually exclusive: `entry_link_source`, `entry_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RulePathElement
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Entry source represents information about the related source entry.
      # @!attribute [r] entry_type
      #   @return [::String]
      #     Output only. The entry type to represent the current characteristics
      #     of the entry in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryTypes/{entry-type-id}`.
      # @!attribute [r] entry
      #   @return [::String]
      #     Output only. The entry name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
      # @!attribute [r] display_name
      #   @return [::String]
      #     Output only. The display name of the entry.
      class EntrySource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Entry link source represents information about the entry link.
      # @!attribute [r] entry_link_type
      #   @return [::String]
      #     Output only. The entry link type to represent the current
      #     relationship between the entry and the next entry in the path.
      #     In the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryLinkTypes/{entry_link_type_id}`
      # @!attribute [r] entry_link
      #   @return [::String]
      #     Output only. The entry link name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entryLinks/{entry_link_id}`
      class EntryLinkSource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end
  end

  # Specifies a SQL statement that is evaluated to return up to 10 scalar
  # values that are used to debug rules. If the rule fails, the values can help
  # diagnose the cause of the failure.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # You can also name results with an explicit alias using `[AS] alias`. For
  # more information, see [BigQuery explicit
  # aliases](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#explicit_alias_syntax).
  #
  # Example: `SELECT MIN(col1) AS min_col1, MAX(col1) AS max_col1 FROM
  # $\\{data()}`
  # @!attribute [rw] description
  #   @return [::String]
  #     Optional. Specifies the description of the debug query.
  #
  #     * The maximum length is 1,024 characters.
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Required. Specifies the SQL statement to be executed.
  class DebugQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class AttributesEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#debug_queries::Array<::Google::Cloud::Dataplex::V1::DataQualityRule::DebugQuery>

Returns Optional. Specifies the debug queries for this rule. Currently, only one query is supported, but this may be expanded in the future.

Returns:



506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
# File 'proto_docs/google/cloud/dataplex/v1/data_quality.rb', line 506

class DataQualityRule
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Evaluates whether each column value lies between a specified range.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly greater than ('>') the
  #     minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly lesser than ('<') the
  #     maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class RangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is null.
  class NonNullExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is contained by a specified set.
  # @!attribute [rw] values
  #   @return [::Array<::String>]
  #     Optional. Expected values for the column value.
  class SetExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value matches a specified regex.
  # @!attribute [rw] regex
  #   @return [::String]
  #     Optional. A regular expression the column value is expected to match.
  class RegexExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column has duplicates.
  class UniquenessExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column aggregate statistic lies between a specified
  # range.
  # @!attribute [rw] statistic
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::StatisticRangeExpectation::ColumnStatistic]
  #     Optional. The aggregate metric to evaluate.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly greater than
  #     ('>') the minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly lesser than ('<')
  #     the maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class StatisticRangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The list of aggregate metrics a rule can be evaluated against.
    module ColumnStatistic
      # Unspecified statistic type
      STATISTIC_UNDEFINED = 0

      # Evaluate the column mean
      MEAN = 1

      # Evaluate the column min
      MIN = 2

      # Evaluate the column max
      MAX = 3
    end
  end

  # Evaluates whether each row passes the specified condition.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a boolean value per row as the result.
  #
  # Example: col1 >= 0 AND col2 < 10
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class RowConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the provided expression is true.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a scalar boolean result.
  #
  # Example: MIN(col1) >= 0
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class TableConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A SQL statement that is evaluated to return rows that match an invalid
  # state. If any rows are are returned, this rule fails.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # Example: `SELECT * FROM ${data()} WHERE price < 0`
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Optional. The SQL statement.
  class SqlAssertion
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A rule that constructs a SQL statement to evaluate using a rule template
  # and parameter values. If the constructed statement returns any rows, this
  # rule fails
  # @!attribute [rw] name
  #   @return [::String]
  #     Required. The template entry name. Entry must be of EntryType
  #     `projects/dataplex-types/locations/global/entryTypes/data-quality-rule-template`
  #     and contains top-level aspect of AspectType
  #     `projects/dataplex-types/locations/global/aspectTypes/data-quality-rule-template`.
  #     The format is:
  #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
  # @!attribute [rw] values
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue}]
  #     Optional. Provides the map of parameter name and value.
  #     The maximum size of the field is 120KB (encoded as UTF-8).
  # @!attribute [r] resolved_sql
  #   @return [::String]
  #     Output only. The resolved SQL statement generated from the template with
  #     parameters substituted. It is only populated in the result.
  # @!attribute [r] rule_template
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRuleTemplate]
  #     Output only. The rule template used to resolve the rule. It is only
  #     populated in the result.
  class TemplateReference
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Represents a parameter value.
    # @!attribute [rw] value
    #   @return [::String]
    #     Required. Represents the string value of the parameter.
    class ParameterValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue]
    class ValuesEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Represents the rule source information from Catalog.
  # @!attribute [r] rule_path_elements
  #   @return [::Array<::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement>]
  #     Output only. Rule path elements represent information about the
  #     individual items in the relationship path between the scan resource and
  #     rule origin in that order.
  class RuleSource
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Path Element represents the direct relationship between the rule origin
    # (aspects) to the BigQuery Entry. Ordering of the rule relationship will
    # be maintained such that the first entry in the list is the closest
    # ancestor (BigQuery table itself). A blank source denotes that the rule is
    # derived directly from the DataScan itself.
    # @!attribute [r] entry_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntrySource]
    #     Output only. Entry source represents information about the related
    #     source entry.
    #
    #     Note: The following fields are mutually exclusive: `entry_source`, `entry_link_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [r] entry_link_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntryLinkSource]
    #     Output only. Entry link source represents information about the entry
    #     link.
    #
    #     Note: The following fields are mutually exclusive: `entry_link_source`, `entry_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RulePathElement
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Entry source represents information about the related source entry.
      # @!attribute [r] entry_type
      #   @return [::String]
      #     Output only. The entry type to represent the current characteristics
      #     of the entry in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryTypes/{entry-type-id}`.
      # @!attribute [r] entry
      #   @return [::String]
      #     Output only. The entry name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
      # @!attribute [r] display_name
      #   @return [::String]
      #     Output only. The display name of the entry.
      class EntrySource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Entry link source represents information about the entry link.
      # @!attribute [r] entry_link_type
      #   @return [::String]
      #     Output only. The entry link type to represent the current
      #     relationship between the entry and the next entry in the path.
      #     In the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryLinkTypes/{entry_link_type_id}`
      # @!attribute [r] entry_link
      #   @return [::String]
      #     Output only. The entry link name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entryLinks/{entry_link_id}`
      class EntryLinkSource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end
  end

  # Specifies a SQL statement that is evaluated to return up to 10 scalar
  # values that are used to debug rules. If the rule fails, the values can help
  # diagnose the cause of the failure.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # You can also name results with an explicit alias using `[AS] alias`. For
  # more information, see [BigQuery explicit
  # aliases](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#explicit_alias_syntax).
  #
  # Example: `SELECT MIN(col1) AS min_col1, MAX(col1) AS max_col1 FROM
  # $\\{data()}`
  # @!attribute [rw] description
  #   @return [::String]
  #     Optional. Specifies the description of the debug query.
  #
  #     * The maximum length is 1,024 characters.
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Required. Specifies the SQL statement to be executed.
  class DebugQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class AttributesEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#description::String

Returns Optional. Description of the rule.

  • The maximum length is 1,024 characters.

Returns:

  • (::String)

    Optional. Description of the rule.

    • The maximum length is 1,024 characters.


506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
# File 'proto_docs/google/cloud/dataplex/v1/data_quality.rb', line 506

class DataQualityRule
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Evaluates whether each column value lies between a specified range.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly greater than ('>') the
  #     minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly lesser than ('<') the
  #     maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class RangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is null.
  class NonNullExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is contained by a specified set.
  # @!attribute [rw] values
  #   @return [::Array<::String>]
  #     Optional. Expected values for the column value.
  class SetExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value matches a specified regex.
  # @!attribute [rw] regex
  #   @return [::String]
  #     Optional. A regular expression the column value is expected to match.
  class RegexExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column has duplicates.
  class UniquenessExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column aggregate statistic lies between a specified
  # range.
  # @!attribute [rw] statistic
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::StatisticRangeExpectation::ColumnStatistic]
  #     Optional. The aggregate metric to evaluate.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly greater than
  #     ('>') the minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly lesser than ('<')
  #     the maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class StatisticRangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The list of aggregate metrics a rule can be evaluated against.
    module ColumnStatistic
      # Unspecified statistic type
      STATISTIC_UNDEFINED = 0

      # Evaluate the column mean
      MEAN = 1

      # Evaluate the column min
      MIN = 2

      # Evaluate the column max
      MAX = 3
    end
  end

  # Evaluates whether each row passes the specified condition.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a boolean value per row as the result.
  #
  # Example: col1 >= 0 AND col2 < 10
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class RowConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the provided expression is true.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a scalar boolean result.
  #
  # Example: MIN(col1) >= 0
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class TableConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A SQL statement that is evaluated to return rows that match an invalid
  # state. If any rows are are returned, this rule fails.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # Example: `SELECT * FROM ${data()} WHERE price < 0`
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Optional. The SQL statement.
  class SqlAssertion
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A rule that constructs a SQL statement to evaluate using a rule template
  # and parameter values. If the constructed statement returns any rows, this
  # rule fails
  # @!attribute [rw] name
  #   @return [::String]
  #     Required. The template entry name. Entry must be of EntryType
  #     `projects/dataplex-types/locations/global/entryTypes/data-quality-rule-template`
  #     and contains top-level aspect of AspectType
  #     `projects/dataplex-types/locations/global/aspectTypes/data-quality-rule-template`.
  #     The format is:
  #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
  # @!attribute [rw] values
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue}]
  #     Optional. Provides the map of parameter name and value.
  #     The maximum size of the field is 120KB (encoded as UTF-8).
  # @!attribute [r] resolved_sql
  #   @return [::String]
  #     Output only. The resolved SQL statement generated from the template with
  #     parameters substituted. It is only populated in the result.
  # @!attribute [r] rule_template
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRuleTemplate]
  #     Output only. The rule template used to resolve the rule. It is only
  #     populated in the result.
  class TemplateReference
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Represents a parameter value.
    # @!attribute [rw] value
    #   @return [::String]
    #     Required. Represents the string value of the parameter.
    class ParameterValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue]
    class ValuesEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Represents the rule source information from Catalog.
  # @!attribute [r] rule_path_elements
  #   @return [::Array<::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement>]
  #     Output only. Rule path elements represent information about the
  #     individual items in the relationship path between the scan resource and
  #     rule origin in that order.
  class RuleSource
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Path Element represents the direct relationship between the rule origin
    # (aspects) to the BigQuery Entry. Ordering of the rule relationship will
    # be maintained such that the first entry in the list is the closest
    # ancestor (BigQuery table itself). A blank source denotes that the rule is
    # derived directly from the DataScan itself.
    # @!attribute [r] entry_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntrySource]
    #     Output only. Entry source represents information about the related
    #     source entry.
    #
    #     Note: The following fields are mutually exclusive: `entry_source`, `entry_link_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [r] entry_link_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntryLinkSource]
    #     Output only. Entry link source represents information about the entry
    #     link.
    #
    #     Note: The following fields are mutually exclusive: `entry_link_source`, `entry_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RulePathElement
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Entry source represents information about the related source entry.
      # @!attribute [r] entry_type
      #   @return [::String]
      #     Output only. The entry type to represent the current characteristics
      #     of the entry in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryTypes/{entry-type-id}`.
      # @!attribute [r] entry
      #   @return [::String]
      #     Output only. The entry name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
      # @!attribute [r] display_name
      #   @return [::String]
      #     Output only. The display name of the entry.
      class EntrySource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Entry link source represents information about the entry link.
      # @!attribute [r] entry_link_type
      #   @return [::String]
      #     Output only. The entry link type to represent the current
      #     relationship between the entry and the next entry in the path.
      #     In the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryLinkTypes/{entry_link_type_id}`
      # @!attribute [r] entry_link
      #   @return [::String]
      #     Output only. The entry link name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entryLinks/{entry_link_id}`
      class EntryLinkSource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end
  end

  # Specifies a SQL statement that is evaluated to return up to 10 scalar
  # values that are used to debug rules. If the rule fails, the values can help
  # diagnose the cause of the failure.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # You can also name results with an explicit alias using `[AS] alias`. For
  # more information, see [BigQuery explicit
  # aliases](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#explicit_alias_syntax).
  #
  # Example: `SELECT MIN(col1) AS min_col1, MAX(col1) AS max_col1 FROM
  # $\\{data()}`
  # @!attribute [rw] description
  #   @return [::String]
  #     Optional. Specifies the description of the debug query.
  #
  #     * The maximum length is 1,024 characters.
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Required. Specifies the SQL statement to be executed.
  class DebugQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class AttributesEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#dimension::String

Returns Optional. 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.

Returns:

  • (::String)

    Optional. 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.



506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
# File 'proto_docs/google/cloud/dataplex/v1/data_quality.rb', line 506

class DataQualityRule
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Evaluates whether each column value lies between a specified range.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly greater than ('>') the
  #     minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly lesser than ('<') the
  #     maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class RangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is null.
  class NonNullExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is contained by a specified set.
  # @!attribute [rw] values
  #   @return [::Array<::String>]
  #     Optional. Expected values for the column value.
  class SetExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value matches a specified regex.
  # @!attribute [rw] regex
  #   @return [::String]
  #     Optional. A regular expression the column value is expected to match.
  class RegexExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column has duplicates.
  class UniquenessExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column aggregate statistic lies between a specified
  # range.
  # @!attribute [rw] statistic
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::StatisticRangeExpectation::ColumnStatistic]
  #     Optional. The aggregate metric to evaluate.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly greater than
  #     ('>') the minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly lesser than ('<')
  #     the maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class StatisticRangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The list of aggregate metrics a rule can be evaluated against.
    module ColumnStatistic
      # Unspecified statistic type
      STATISTIC_UNDEFINED = 0

      # Evaluate the column mean
      MEAN = 1

      # Evaluate the column min
      MIN = 2

      # Evaluate the column max
      MAX = 3
    end
  end

  # Evaluates whether each row passes the specified condition.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a boolean value per row as the result.
  #
  # Example: col1 >= 0 AND col2 < 10
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class RowConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the provided expression is true.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a scalar boolean result.
  #
  # Example: MIN(col1) >= 0
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class TableConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A SQL statement that is evaluated to return rows that match an invalid
  # state. If any rows are are returned, this rule fails.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # Example: `SELECT * FROM ${data()} WHERE price < 0`
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Optional. The SQL statement.
  class SqlAssertion
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A rule that constructs a SQL statement to evaluate using a rule template
  # and parameter values. If the constructed statement returns any rows, this
  # rule fails
  # @!attribute [rw] name
  #   @return [::String]
  #     Required. The template entry name. Entry must be of EntryType
  #     `projects/dataplex-types/locations/global/entryTypes/data-quality-rule-template`
  #     and contains top-level aspect of AspectType
  #     `projects/dataplex-types/locations/global/aspectTypes/data-quality-rule-template`.
  #     The format is:
  #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
  # @!attribute [rw] values
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue}]
  #     Optional. Provides the map of parameter name and value.
  #     The maximum size of the field is 120KB (encoded as UTF-8).
  # @!attribute [r] resolved_sql
  #   @return [::String]
  #     Output only. The resolved SQL statement generated from the template with
  #     parameters substituted. It is only populated in the result.
  # @!attribute [r] rule_template
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRuleTemplate]
  #     Output only. The rule template used to resolve the rule. It is only
  #     populated in the result.
  class TemplateReference
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Represents a parameter value.
    # @!attribute [rw] value
    #   @return [::String]
    #     Required. Represents the string value of the parameter.
    class ParameterValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue]
    class ValuesEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Represents the rule source information from Catalog.
  # @!attribute [r] rule_path_elements
  #   @return [::Array<::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement>]
  #     Output only. Rule path elements represent information about the
  #     individual items in the relationship path between the scan resource and
  #     rule origin in that order.
  class RuleSource
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Path Element represents the direct relationship between the rule origin
    # (aspects) to the BigQuery Entry. Ordering of the rule relationship will
    # be maintained such that the first entry in the list is the closest
    # ancestor (BigQuery table itself). A blank source denotes that the rule is
    # derived directly from the DataScan itself.
    # @!attribute [r] entry_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntrySource]
    #     Output only. Entry source represents information about the related
    #     source entry.
    #
    #     Note: The following fields are mutually exclusive: `entry_source`, `entry_link_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [r] entry_link_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntryLinkSource]
    #     Output only. Entry link source represents information about the entry
    #     link.
    #
    #     Note: The following fields are mutually exclusive: `entry_link_source`, `entry_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RulePathElement
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Entry source represents information about the related source entry.
      # @!attribute [r] entry_type
      #   @return [::String]
      #     Output only. The entry type to represent the current characteristics
      #     of the entry in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryTypes/{entry-type-id}`.
      # @!attribute [r] entry
      #   @return [::String]
      #     Output only. The entry name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
      # @!attribute [r] display_name
      #   @return [::String]
      #     Output only. The display name of the entry.
      class EntrySource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Entry link source represents information about the entry link.
      # @!attribute [r] entry_link_type
      #   @return [::String]
      #     Output only. The entry link type to represent the current
      #     relationship between the entry and the next entry in the path.
      #     In the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryLinkTypes/{entry_link_type_id}`
      # @!attribute [r] entry_link
      #   @return [::String]
      #     Output only. The entry link name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entryLinks/{entry_link_id}`
      class EntryLinkSource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end
  end

  # Specifies a SQL statement that is evaluated to return up to 10 scalar
  # values that are used to debug rules. If the rule fails, the values can help
  # diagnose the cause of the failure.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # You can also name results with an explicit alias using `[AS] alias`. For
  # more information, see [BigQuery explicit
  # aliases](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#explicit_alias_syntax).
  #
  # Example: `SELECT MIN(col1) AS min_col1, MAX(col1) AS max_col1 FROM
  # $\\{data()}`
  # @!attribute [rw] description
  #   @return [::String]
  #     Optional. Specifies the description of the debug query.
  #
  #     * The maximum length is 1,024 characters.
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Required. Specifies the SQL statement to be executed.
  class DebugQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class AttributesEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#ignore_null::Boolean

Returns Optional. 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.

Returns:

  • (::Boolean)

    Optional. 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


506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
# File 'proto_docs/google/cloud/dataplex/v1/data_quality.rb', line 506

class DataQualityRule
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Evaluates whether each column value lies between a specified range.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly greater than ('>') the
  #     minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly lesser than ('<') the
  #     maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class RangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is null.
  class NonNullExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is contained by a specified set.
  # @!attribute [rw] values
  #   @return [::Array<::String>]
  #     Optional. Expected values for the column value.
  class SetExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value matches a specified regex.
  # @!attribute [rw] regex
  #   @return [::String]
  #     Optional. A regular expression the column value is expected to match.
  class RegexExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column has duplicates.
  class UniquenessExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column aggregate statistic lies between a specified
  # range.
  # @!attribute [rw] statistic
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::StatisticRangeExpectation::ColumnStatistic]
  #     Optional. The aggregate metric to evaluate.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly greater than
  #     ('>') the minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly lesser than ('<')
  #     the maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class StatisticRangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The list of aggregate metrics a rule can be evaluated against.
    module ColumnStatistic
      # Unspecified statistic type
      STATISTIC_UNDEFINED = 0

      # Evaluate the column mean
      MEAN = 1

      # Evaluate the column min
      MIN = 2

      # Evaluate the column max
      MAX = 3
    end
  end

  # Evaluates whether each row passes the specified condition.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a boolean value per row as the result.
  #
  # Example: col1 >= 0 AND col2 < 10
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class RowConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the provided expression is true.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a scalar boolean result.
  #
  # Example: MIN(col1) >= 0
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class TableConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A SQL statement that is evaluated to return rows that match an invalid
  # state. If any rows are are returned, this rule fails.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # Example: `SELECT * FROM ${data()} WHERE price < 0`
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Optional. The SQL statement.
  class SqlAssertion
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A rule that constructs a SQL statement to evaluate using a rule template
  # and parameter values. If the constructed statement returns any rows, this
  # rule fails
  # @!attribute [rw] name
  #   @return [::String]
  #     Required. The template entry name. Entry must be of EntryType
  #     `projects/dataplex-types/locations/global/entryTypes/data-quality-rule-template`
  #     and contains top-level aspect of AspectType
  #     `projects/dataplex-types/locations/global/aspectTypes/data-quality-rule-template`.
  #     The format is:
  #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
  # @!attribute [rw] values
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue}]
  #     Optional. Provides the map of parameter name and value.
  #     The maximum size of the field is 120KB (encoded as UTF-8).
  # @!attribute [r] resolved_sql
  #   @return [::String]
  #     Output only. The resolved SQL statement generated from the template with
  #     parameters substituted. It is only populated in the result.
  # @!attribute [r] rule_template
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRuleTemplate]
  #     Output only. The rule template used to resolve the rule. It is only
  #     populated in the result.
  class TemplateReference
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Represents a parameter value.
    # @!attribute [rw] value
    #   @return [::String]
    #     Required. Represents the string value of the parameter.
    class ParameterValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue]
    class ValuesEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Represents the rule source information from Catalog.
  # @!attribute [r] rule_path_elements
  #   @return [::Array<::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement>]
  #     Output only. Rule path elements represent information about the
  #     individual items in the relationship path between the scan resource and
  #     rule origin in that order.
  class RuleSource
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Path Element represents the direct relationship between the rule origin
    # (aspects) to the BigQuery Entry. Ordering of the rule relationship will
    # be maintained such that the first entry in the list is the closest
    # ancestor (BigQuery table itself). A blank source denotes that the rule is
    # derived directly from the DataScan itself.
    # @!attribute [r] entry_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntrySource]
    #     Output only. Entry source represents information about the related
    #     source entry.
    #
    #     Note: The following fields are mutually exclusive: `entry_source`, `entry_link_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [r] entry_link_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntryLinkSource]
    #     Output only. Entry link source represents information about the entry
    #     link.
    #
    #     Note: The following fields are mutually exclusive: `entry_link_source`, `entry_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RulePathElement
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Entry source represents information about the related source entry.
      # @!attribute [r] entry_type
      #   @return [::String]
      #     Output only. The entry type to represent the current characteristics
      #     of the entry in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryTypes/{entry-type-id}`.
      # @!attribute [r] entry
      #   @return [::String]
      #     Output only. The entry name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
      # @!attribute [r] display_name
      #   @return [::String]
      #     Output only. The display name of the entry.
      class EntrySource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Entry link source represents information about the entry link.
      # @!attribute [r] entry_link_type
      #   @return [::String]
      #     Output only. The entry link type to represent the current
      #     relationship between the entry and the next entry in the path.
      #     In the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryLinkTypes/{entry_link_type_id}`
      # @!attribute [r] entry_link
      #   @return [::String]
      #     Output only. The entry link name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entryLinks/{entry_link_id}`
      class EntryLinkSource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end
  end

  # Specifies a SQL statement that is evaluated to return up to 10 scalar
  # values that are used to debug rules. If the rule fails, the values can help
  # diagnose the cause of the failure.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # You can also name results with an explicit alias using `[AS] alias`. For
  # more information, see [BigQuery explicit
  # aliases](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#explicit_alias_syntax).
  #
  # Example: `SELECT MIN(col1) AS min_col1, MAX(col1) AS max_col1 FROM
  # $\\{data()}`
  # @!attribute [rw] description
  #   @return [::String]
  #     Optional. Specifies the description of the debug query.
  #
  #     * The maximum length is 1,024 characters.
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Required. Specifies the SQL statement to be executed.
  class DebugQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class AttributesEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#name::String

Returns Optional. 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.

Returns:

  • (::String)

    Optional. 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.


506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
# File 'proto_docs/google/cloud/dataplex/v1/data_quality.rb', line 506

class DataQualityRule
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Evaluates whether each column value lies between a specified range.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly greater than ('>') the
  #     minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly lesser than ('<') the
  #     maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class RangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is null.
  class NonNullExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is contained by a specified set.
  # @!attribute [rw] values
  #   @return [::Array<::String>]
  #     Optional. Expected values for the column value.
  class SetExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value matches a specified regex.
  # @!attribute [rw] regex
  #   @return [::String]
  #     Optional. A regular expression the column value is expected to match.
  class RegexExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column has duplicates.
  class UniquenessExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column aggregate statistic lies between a specified
  # range.
  # @!attribute [rw] statistic
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::StatisticRangeExpectation::ColumnStatistic]
  #     Optional. The aggregate metric to evaluate.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly greater than
  #     ('>') the minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly lesser than ('<')
  #     the maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class StatisticRangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The list of aggregate metrics a rule can be evaluated against.
    module ColumnStatistic
      # Unspecified statistic type
      STATISTIC_UNDEFINED = 0

      # Evaluate the column mean
      MEAN = 1

      # Evaluate the column min
      MIN = 2

      # Evaluate the column max
      MAX = 3
    end
  end

  # Evaluates whether each row passes the specified condition.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a boolean value per row as the result.
  #
  # Example: col1 >= 0 AND col2 < 10
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class RowConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the provided expression is true.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a scalar boolean result.
  #
  # Example: MIN(col1) >= 0
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class TableConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A SQL statement that is evaluated to return rows that match an invalid
  # state. If any rows are are returned, this rule fails.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # Example: `SELECT * FROM ${data()} WHERE price < 0`
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Optional. The SQL statement.
  class SqlAssertion
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A rule that constructs a SQL statement to evaluate using a rule template
  # and parameter values. If the constructed statement returns any rows, this
  # rule fails
  # @!attribute [rw] name
  #   @return [::String]
  #     Required. The template entry name. Entry must be of EntryType
  #     `projects/dataplex-types/locations/global/entryTypes/data-quality-rule-template`
  #     and contains top-level aspect of AspectType
  #     `projects/dataplex-types/locations/global/aspectTypes/data-quality-rule-template`.
  #     The format is:
  #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
  # @!attribute [rw] values
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue}]
  #     Optional. Provides the map of parameter name and value.
  #     The maximum size of the field is 120KB (encoded as UTF-8).
  # @!attribute [r] resolved_sql
  #   @return [::String]
  #     Output only. The resolved SQL statement generated from the template with
  #     parameters substituted. It is only populated in the result.
  # @!attribute [r] rule_template
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRuleTemplate]
  #     Output only. The rule template used to resolve the rule. It is only
  #     populated in the result.
  class TemplateReference
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Represents a parameter value.
    # @!attribute [rw] value
    #   @return [::String]
    #     Required. Represents the string value of the parameter.
    class ParameterValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue]
    class ValuesEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Represents the rule source information from Catalog.
  # @!attribute [r] rule_path_elements
  #   @return [::Array<::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement>]
  #     Output only. Rule path elements represent information about the
  #     individual items in the relationship path between the scan resource and
  #     rule origin in that order.
  class RuleSource
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Path Element represents the direct relationship between the rule origin
    # (aspects) to the BigQuery Entry. Ordering of the rule relationship will
    # be maintained such that the first entry in the list is the closest
    # ancestor (BigQuery table itself). A blank source denotes that the rule is
    # derived directly from the DataScan itself.
    # @!attribute [r] entry_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntrySource]
    #     Output only. Entry source represents information about the related
    #     source entry.
    #
    #     Note: The following fields are mutually exclusive: `entry_source`, `entry_link_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [r] entry_link_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntryLinkSource]
    #     Output only. Entry link source represents information about the entry
    #     link.
    #
    #     Note: The following fields are mutually exclusive: `entry_link_source`, `entry_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RulePathElement
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Entry source represents information about the related source entry.
      # @!attribute [r] entry_type
      #   @return [::String]
      #     Output only. The entry type to represent the current characteristics
      #     of the entry in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryTypes/{entry-type-id}`.
      # @!attribute [r] entry
      #   @return [::String]
      #     Output only. The entry name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
      # @!attribute [r] display_name
      #   @return [::String]
      #     Output only. The display name of the entry.
      class EntrySource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Entry link source represents information about the entry link.
      # @!attribute [r] entry_link_type
      #   @return [::String]
      #     Output only. The entry link type to represent the current
      #     relationship between the entry and the next entry in the path.
      #     In the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryLinkTypes/{entry_link_type_id}`
      # @!attribute [r] entry_link
      #   @return [::String]
      #     Output only. The entry link name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entryLinks/{entry_link_id}`
      class EntryLinkSource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end
  end

  # Specifies a SQL statement that is evaluated to return up to 10 scalar
  # values that are used to debug rules. If the rule fails, the values can help
  # diagnose the cause of the failure.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # You can also name results with an explicit alias using `[AS] alias`. For
  # more information, see [BigQuery explicit
  # aliases](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#explicit_alias_syntax).
  #
  # Example: `SELECT MIN(col1) AS min_col1, MAX(col1) AS max_col1 FROM
  # $\\{data()}`
  # @!attribute [rw] description
  #   @return [::String]
  #     Optional. Specifies the description of the debug query.
  #
  #     * The maximum length is 1,024 characters.
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Required. Specifies the SQL statement to be executed.
  class DebugQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class AttributesEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#non_null_expectation::Google::Cloud::Dataplex::V1::DataQualityRule::NonNullExpectation

Returns Row-level rule which evaluates whether each column value is null.

Note: The following fields are mutually exclusive: non_null_expectation, range_expectation, set_expectation, regex_expectation, uniqueness_expectation, statistic_range_expectation, row_condition_expectation, table_condition_expectation, sql_assertion, template_reference. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns:

  • (::Google::Cloud::Dataplex::V1::DataQualityRule::NonNullExpectation)

    Row-level rule which evaluates whether each column value is null.

    Note: The following fields are mutually exclusive: non_null_expectation, range_expectation, set_expectation, regex_expectation, uniqueness_expectation, statistic_range_expectation, row_condition_expectation, table_condition_expectation, sql_assertion, template_reference. If a field in that set is populated, all other fields in the set will automatically be cleared.



506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
# File 'proto_docs/google/cloud/dataplex/v1/data_quality.rb', line 506

class DataQualityRule
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Evaluates whether each column value lies between a specified range.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly greater than ('>') the
  #     minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly lesser than ('<') the
  #     maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class RangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is null.
  class NonNullExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is contained by a specified set.
  # @!attribute [rw] values
  #   @return [::Array<::String>]
  #     Optional. Expected values for the column value.
  class SetExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value matches a specified regex.
  # @!attribute [rw] regex
  #   @return [::String]
  #     Optional. A regular expression the column value is expected to match.
  class RegexExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column has duplicates.
  class UniquenessExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column aggregate statistic lies between a specified
  # range.
  # @!attribute [rw] statistic
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::StatisticRangeExpectation::ColumnStatistic]
  #     Optional. The aggregate metric to evaluate.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly greater than
  #     ('>') the minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly lesser than ('<')
  #     the maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class StatisticRangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The list of aggregate metrics a rule can be evaluated against.
    module ColumnStatistic
      # Unspecified statistic type
      STATISTIC_UNDEFINED = 0

      # Evaluate the column mean
      MEAN = 1

      # Evaluate the column min
      MIN = 2

      # Evaluate the column max
      MAX = 3
    end
  end

  # Evaluates whether each row passes the specified condition.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a boolean value per row as the result.
  #
  # Example: col1 >= 0 AND col2 < 10
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class RowConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the provided expression is true.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a scalar boolean result.
  #
  # Example: MIN(col1) >= 0
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class TableConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A SQL statement that is evaluated to return rows that match an invalid
  # state. If any rows are are returned, this rule fails.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # Example: `SELECT * FROM ${data()} WHERE price < 0`
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Optional. The SQL statement.
  class SqlAssertion
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A rule that constructs a SQL statement to evaluate using a rule template
  # and parameter values. If the constructed statement returns any rows, this
  # rule fails
  # @!attribute [rw] name
  #   @return [::String]
  #     Required. The template entry name. Entry must be of EntryType
  #     `projects/dataplex-types/locations/global/entryTypes/data-quality-rule-template`
  #     and contains top-level aspect of AspectType
  #     `projects/dataplex-types/locations/global/aspectTypes/data-quality-rule-template`.
  #     The format is:
  #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
  # @!attribute [rw] values
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue}]
  #     Optional. Provides the map of parameter name and value.
  #     The maximum size of the field is 120KB (encoded as UTF-8).
  # @!attribute [r] resolved_sql
  #   @return [::String]
  #     Output only. The resolved SQL statement generated from the template with
  #     parameters substituted. It is only populated in the result.
  # @!attribute [r] rule_template
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRuleTemplate]
  #     Output only. The rule template used to resolve the rule. It is only
  #     populated in the result.
  class TemplateReference
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Represents a parameter value.
    # @!attribute [rw] value
    #   @return [::String]
    #     Required. Represents the string value of the parameter.
    class ParameterValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue]
    class ValuesEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Represents the rule source information from Catalog.
  # @!attribute [r] rule_path_elements
  #   @return [::Array<::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement>]
  #     Output only. Rule path elements represent information about the
  #     individual items in the relationship path between the scan resource and
  #     rule origin in that order.
  class RuleSource
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Path Element represents the direct relationship between the rule origin
    # (aspects) to the BigQuery Entry. Ordering of the rule relationship will
    # be maintained such that the first entry in the list is the closest
    # ancestor (BigQuery table itself). A blank source denotes that the rule is
    # derived directly from the DataScan itself.
    # @!attribute [r] entry_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntrySource]
    #     Output only. Entry source represents information about the related
    #     source entry.
    #
    #     Note: The following fields are mutually exclusive: `entry_source`, `entry_link_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [r] entry_link_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntryLinkSource]
    #     Output only. Entry link source represents information about the entry
    #     link.
    #
    #     Note: The following fields are mutually exclusive: `entry_link_source`, `entry_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RulePathElement
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Entry source represents information about the related source entry.
      # @!attribute [r] entry_type
      #   @return [::String]
      #     Output only. The entry type to represent the current characteristics
      #     of the entry in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryTypes/{entry-type-id}`.
      # @!attribute [r] entry
      #   @return [::String]
      #     Output only. The entry name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
      # @!attribute [r] display_name
      #   @return [::String]
      #     Output only. The display name of the entry.
      class EntrySource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Entry link source represents information about the entry link.
      # @!attribute [r] entry_link_type
      #   @return [::String]
      #     Output only. The entry link type to represent the current
      #     relationship between the entry and the next entry in the path.
      #     In the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryLinkTypes/{entry_link_type_id}`
      # @!attribute [r] entry_link
      #   @return [::String]
      #     Output only. The entry link name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entryLinks/{entry_link_id}`
      class EntryLinkSource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end
  end

  # Specifies a SQL statement that is evaluated to return up to 10 scalar
  # values that are used to debug rules. If the rule fails, the values can help
  # diagnose the cause of the failure.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # You can also name results with an explicit alias using `[AS] alias`. For
  # more information, see [BigQuery explicit
  # aliases](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#explicit_alias_syntax).
  #
  # Example: `SELECT MIN(col1) AS min_col1, MAX(col1) AS max_col1 FROM
  # $\\{data()}`
  # @!attribute [rw] description
  #   @return [::String]
  #     Optional. Specifies the description of the debug query.
  #
  #     * The maximum length is 1,024 characters.
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Required. Specifies the SQL statement to be executed.
  class DebugQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class AttributesEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#range_expectation::Google::Cloud::Dataplex::V1::DataQualityRule::RangeExpectation

Returns Row-level rule which evaluates whether each column value lies between a specified range.

Note: The following fields are mutually exclusive: range_expectation, non_null_expectation, set_expectation, regex_expectation, uniqueness_expectation, statistic_range_expectation, row_condition_expectation, table_condition_expectation, sql_assertion, template_reference. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns:

  • (::Google::Cloud::Dataplex::V1::DataQualityRule::RangeExpectation)

    Row-level rule which evaluates whether each column value lies between a specified range.

    Note: The following fields are mutually exclusive: range_expectation, non_null_expectation, set_expectation, regex_expectation, uniqueness_expectation, statistic_range_expectation, row_condition_expectation, table_condition_expectation, sql_assertion, template_reference. If a field in that set is populated, all other fields in the set will automatically be cleared.



506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
# File 'proto_docs/google/cloud/dataplex/v1/data_quality.rb', line 506

class DataQualityRule
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Evaluates whether each column value lies between a specified range.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly greater than ('>') the
  #     minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly lesser than ('<') the
  #     maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class RangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is null.
  class NonNullExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is contained by a specified set.
  # @!attribute [rw] values
  #   @return [::Array<::String>]
  #     Optional. Expected values for the column value.
  class SetExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value matches a specified regex.
  # @!attribute [rw] regex
  #   @return [::String]
  #     Optional. A regular expression the column value is expected to match.
  class RegexExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column has duplicates.
  class UniquenessExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column aggregate statistic lies between a specified
  # range.
  # @!attribute [rw] statistic
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::StatisticRangeExpectation::ColumnStatistic]
  #     Optional. The aggregate metric to evaluate.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly greater than
  #     ('>') the minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly lesser than ('<')
  #     the maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class StatisticRangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The list of aggregate metrics a rule can be evaluated against.
    module ColumnStatistic
      # Unspecified statistic type
      STATISTIC_UNDEFINED = 0

      # Evaluate the column mean
      MEAN = 1

      # Evaluate the column min
      MIN = 2

      # Evaluate the column max
      MAX = 3
    end
  end

  # Evaluates whether each row passes the specified condition.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a boolean value per row as the result.
  #
  # Example: col1 >= 0 AND col2 < 10
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class RowConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the provided expression is true.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a scalar boolean result.
  #
  # Example: MIN(col1) >= 0
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class TableConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A SQL statement that is evaluated to return rows that match an invalid
  # state. If any rows are are returned, this rule fails.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # Example: `SELECT * FROM ${data()} WHERE price < 0`
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Optional. The SQL statement.
  class SqlAssertion
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A rule that constructs a SQL statement to evaluate using a rule template
  # and parameter values. If the constructed statement returns any rows, this
  # rule fails
  # @!attribute [rw] name
  #   @return [::String]
  #     Required. The template entry name. Entry must be of EntryType
  #     `projects/dataplex-types/locations/global/entryTypes/data-quality-rule-template`
  #     and contains top-level aspect of AspectType
  #     `projects/dataplex-types/locations/global/aspectTypes/data-quality-rule-template`.
  #     The format is:
  #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
  # @!attribute [rw] values
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue}]
  #     Optional. Provides the map of parameter name and value.
  #     The maximum size of the field is 120KB (encoded as UTF-8).
  # @!attribute [r] resolved_sql
  #   @return [::String]
  #     Output only. The resolved SQL statement generated from the template with
  #     parameters substituted. It is only populated in the result.
  # @!attribute [r] rule_template
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRuleTemplate]
  #     Output only. The rule template used to resolve the rule. It is only
  #     populated in the result.
  class TemplateReference
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Represents a parameter value.
    # @!attribute [rw] value
    #   @return [::String]
    #     Required. Represents the string value of the parameter.
    class ParameterValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue]
    class ValuesEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Represents the rule source information from Catalog.
  # @!attribute [r] rule_path_elements
  #   @return [::Array<::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement>]
  #     Output only. Rule path elements represent information about the
  #     individual items in the relationship path between the scan resource and
  #     rule origin in that order.
  class RuleSource
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Path Element represents the direct relationship between the rule origin
    # (aspects) to the BigQuery Entry. Ordering of the rule relationship will
    # be maintained such that the first entry in the list is the closest
    # ancestor (BigQuery table itself). A blank source denotes that the rule is
    # derived directly from the DataScan itself.
    # @!attribute [r] entry_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntrySource]
    #     Output only. Entry source represents information about the related
    #     source entry.
    #
    #     Note: The following fields are mutually exclusive: `entry_source`, `entry_link_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [r] entry_link_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntryLinkSource]
    #     Output only. Entry link source represents information about the entry
    #     link.
    #
    #     Note: The following fields are mutually exclusive: `entry_link_source`, `entry_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RulePathElement
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Entry source represents information about the related source entry.
      # @!attribute [r] entry_type
      #   @return [::String]
      #     Output only. The entry type to represent the current characteristics
      #     of the entry in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryTypes/{entry-type-id}`.
      # @!attribute [r] entry
      #   @return [::String]
      #     Output only. The entry name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
      # @!attribute [r] display_name
      #   @return [::String]
      #     Output only. The display name of the entry.
      class EntrySource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Entry link source represents information about the entry link.
      # @!attribute [r] entry_link_type
      #   @return [::String]
      #     Output only. The entry link type to represent the current
      #     relationship between the entry and the next entry in the path.
      #     In the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryLinkTypes/{entry_link_type_id}`
      # @!attribute [r] entry_link
      #   @return [::String]
      #     Output only. The entry link name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entryLinks/{entry_link_id}`
      class EntryLinkSource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end
  end

  # Specifies a SQL statement that is evaluated to return up to 10 scalar
  # values that are used to debug rules. If the rule fails, the values can help
  # diagnose the cause of the failure.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # You can also name results with an explicit alias using `[AS] alias`. For
  # more information, see [BigQuery explicit
  # aliases](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#explicit_alias_syntax).
  #
  # Example: `SELECT MIN(col1) AS min_col1, MAX(col1) AS max_col1 FROM
  # $\\{data()}`
  # @!attribute [rw] description
  #   @return [::String]
  #     Optional. Specifies the description of the debug query.
  #
  #     * The maximum length is 1,024 characters.
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Required. Specifies the SQL statement to be executed.
  class DebugQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class AttributesEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#regex_expectation::Google::Cloud::Dataplex::V1::DataQualityRule::RegexExpectation

Returns Row-level rule which evaluates whether each column value matches a specified regex.

Note: The following fields are mutually exclusive: regex_expectation, range_expectation, non_null_expectation, set_expectation, uniqueness_expectation, statistic_range_expectation, row_condition_expectation, table_condition_expectation, sql_assertion, template_reference. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns:

  • (::Google::Cloud::Dataplex::V1::DataQualityRule::RegexExpectation)

    Row-level rule which evaluates whether each column value matches a specified regex.

    Note: The following fields are mutually exclusive: regex_expectation, range_expectation, non_null_expectation, set_expectation, uniqueness_expectation, statistic_range_expectation, row_condition_expectation, table_condition_expectation, sql_assertion, template_reference. If a field in that set is populated, all other fields in the set will automatically be cleared.



506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
# File 'proto_docs/google/cloud/dataplex/v1/data_quality.rb', line 506

class DataQualityRule
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Evaluates whether each column value lies between a specified range.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly greater than ('>') the
  #     minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly lesser than ('<') the
  #     maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class RangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is null.
  class NonNullExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is contained by a specified set.
  # @!attribute [rw] values
  #   @return [::Array<::String>]
  #     Optional. Expected values for the column value.
  class SetExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value matches a specified regex.
  # @!attribute [rw] regex
  #   @return [::String]
  #     Optional. A regular expression the column value is expected to match.
  class RegexExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column has duplicates.
  class UniquenessExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column aggregate statistic lies between a specified
  # range.
  # @!attribute [rw] statistic
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::StatisticRangeExpectation::ColumnStatistic]
  #     Optional. The aggregate metric to evaluate.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly greater than
  #     ('>') the minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly lesser than ('<')
  #     the maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class StatisticRangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The list of aggregate metrics a rule can be evaluated against.
    module ColumnStatistic
      # Unspecified statistic type
      STATISTIC_UNDEFINED = 0

      # Evaluate the column mean
      MEAN = 1

      # Evaluate the column min
      MIN = 2

      # Evaluate the column max
      MAX = 3
    end
  end

  # Evaluates whether each row passes the specified condition.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a boolean value per row as the result.
  #
  # Example: col1 >= 0 AND col2 < 10
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class RowConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the provided expression is true.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a scalar boolean result.
  #
  # Example: MIN(col1) >= 0
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class TableConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A SQL statement that is evaluated to return rows that match an invalid
  # state. If any rows are are returned, this rule fails.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # Example: `SELECT * FROM ${data()} WHERE price < 0`
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Optional. The SQL statement.
  class SqlAssertion
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A rule that constructs a SQL statement to evaluate using a rule template
  # and parameter values. If the constructed statement returns any rows, this
  # rule fails
  # @!attribute [rw] name
  #   @return [::String]
  #     Required. The template entry name. Entry must be of EntryType
  #     `projects/dataplex-types/locations/global/entryTypes/data-quality-rule-template`
  #     and contains top-level aspect of AspectType
  #     `projects/dataplex-types/locations/global/aspectTypes/data-quality-rule-template`.
  #     The format is:
  #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
  # @!attribute [rw] values
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue}]
  #     Optional. Provides the map of parameter name and value.
  #     The maximum size of the field is 120KB (encoded as UTF-8).
  # @!attribute [r] resolved_sql
  #   @return [::String]
  #     Output only. The resolved SQL statement generated from the template with
  #     parameters substituted. It is only populated in the result.
  # @!attribute [r] rule_template
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRuleTemplate]
  #     Output only. The rule template used to resolve the rule. It is only
  #     populated in the result.
  class TemplateReference
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Represents a parameter value.
    # @!attribute [rw] value
    #   @return [::String]
    #     Required. Represents the string value of the parameter.
    class ParameterValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue]
    class ValuesEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Represents the rule source information from Catalog.
  # @!attribute [r] rule_path_elements
  #   @return [::Array<::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement>]
  #     Output only. Rule path elements represent information about the
  #     individual items in the relationship path between the scan resource and
  #     rule origin in that order.
  class RuleSource
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Path Element represents the direct relationship between the rule origin
    # (aspects) to the BigQuery Entry. Ordering of the rule relationship will
    # be maintained such that the first entry in the list is the closest
    # ancestor (BigQuery table itself). A blank source denotes that the rule is
    # derived directly from the DataScan itself.
    # @!attribute [r] entry_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntrySource]
    #     Output only. Entry source represents information about the related
    #     source entry.
    #
    #     Note: The following fields are mutually exclusive: `entry_source`, `entry_link_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [r] entry_link_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntryLinkSource]
    #     Output only. Entry link source represents information about the entry
    #     link.
    #
    #     Note: The following fields are mutually exclusive: `entry_link_source`, `entry_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RulePathElement
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Entry source represents information about the related source entry.
      # @!attribute [r] entry_type
      #   @return [::String]
      #     Output only. The entry type to represent the current characteristics
      #     of the entry in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryTypes/{entry-type-id}`.
      # @!attribute [r] entry
      #   @return [::String]
      #     Output only. The entry name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
      # @!attribute [r] display_name
      #   @return [::String]
      #     Output only. The display name of the entry.
      class EntrySource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Entry link source represents information about the entry link.
      # @!attribute [r] entry_link_type
      #   @return [::String]
      #     Output only. The entry link type to represent the current
      #     relationship between the entry and the next entry in the path.
      #     In the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryLinkTypes/{entry_link_type_id}`
      # @!attribute [r] entry_link
      #   @return [::String]
      #     Output only. The entry link name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entryLinks/{entry_link_id}`
      class EntryLinkSource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end
  end

  # Specifies a SQL statement that is evaluated to return up to 10 scalar
  # values that are used to debug rules. If the rule fails, the values can help
  # diagnose the cause of the failure.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # You can also name results with an explicit alias using `[AS] alias`. For
  # more information, see [BigQuery explicit
  # aliases](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#explicit_alias_syntax).
  #
  # Example: `SELECT MIN(col1) AS min_col1, MAX(col1) AS max_col1 FROM
  # $\\{data()}`
  # @!attribute [rw] description
  #   @return [::String]
  #     Optional. Specifies the description of the debug query.
  #
  #     * The maximum length is 1,024 characters.
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Required. Specifies the SQL statement to be executed.
  class DebugQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class AttributesEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#row_condition_expectation::Google::Cloud::Dataplex::V1::DataQualityRule::RowConditionExpectation

Returns Row-level rule which evaluates whether each row in a table passes the specified condition.

Note: The following fields are mutually exclusive: row_condition_expectation, range_expectation, non_null_expectation, set_expectation, regex_expectation, uniqueness_expectation, statistic_range_expectation, table_condition_expectation, sql_assertion, template_reference. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns:

  • (::Google::Cloud::Dataplex::V1::DataQualityRule::RowConditionExpectation)

    Row-level rule which evaluates whether each row in a table passes the specified condition.

    Note: The following fields are mutually exclusive: row_condition_expectation, range_expectation, non_null_expectation, set_expectation, regex_expectation, uniqueness_expectation, statistic_range_expectation, table_condition_expectation, sql_assertion, template_reference. If a field in that set is populated, all other fields in the set will automatically be cleared.



506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
# File 'proto_docs/google/cloud/dataplex/v1/data_quality.rb', line 506

class DataQualityRule
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Evaluates whether each column value lies between a specified range.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly greater than ('>') the
  #     minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly lesser than ('<') the
  #     maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class RangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is null.
  class NonNullExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is contained by a specified set.
  # @!attribute [rw] values
  #   @return [::Array<::String>]
  #     Optional. Expected values for the column value.
  class SetExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value matches a specified regex.
  # @!attribute [rw] regex
  #   @return [::String]
  #     Optional. A regular expression the column value is expected to match.
  class RegexExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column has duplicates.
  class UniquenessExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column aggregate statistic lies between a specified
  # range.
  # @!attribute [rw] statistic
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::StatisticRangeExpectation::ColumnStatistic]
  #     Optional. The aggregate metric to evaluate.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly greater than
  #     ('>') the minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly lesser than ('<')
  #     the maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class StatisticRangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The list of aggregate metrics a rule can be evaluated against.
    module ColumnStatistic
      # Unspecified statistic type
      STATISTIC_UNDEFINED = 0

      # Evaluate the column mean
      MEAN = 1

      # Evaluate the column min
      MIN = 2

      # Evaluate the column max
      MAX = 3
    end
  end

  # Evaluates whether each row passes the specified condition.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a boolean value per row as the result.
  #
  # Example: col1 >= 0 AND col2 < 10
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class RowConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the provided expression is true.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a scalar boolean result.
  #
  # Example: MIN(col1) >= 0
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class TableConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A SQL statement that is evaluated to return rows that match an invalid
  # state. If any rows are are returned, this rule fails.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # Example: `SELECT * FROM ${data()} WHERE price < 0`
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Optional. The SQL statement.
  class SqlAssertion
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A rule that constructs a SQL statement to evaluate using a rule template
  # and parameter values. If the constructed statement returns any rows, this
  # rule fails
  # @!attribute [rw] name
  #   @return [::String]
  #     Required. The template entry name. Entry must be of EntryType
  #     `projects/dataplex-types/locations/global/entryTypes/data-quality-rule-template`
  #     and contains top-level aspect of AspectType
  #     `projects/dataplex-types/locations/global/aspectTypes/data-quality-rule-template`.
  #     The format is:
  #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
  # @!attribute [rw] values
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue}]
  #     Optional. Provides the map of parameter name and value.
  #     The maximum size of the field is 120KB (encoded as UTF-8).
  # @!attribute [r] resolved_sql
  #   @return [::String]
  #     Output only. The resolved SQL statement generated from the template with
  #     parameters substituted. It is only populated in the result.
  # @!attribute [r] rule_template
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRuleTemplate]
  #     Output only. The rule template used to resolve the rule. It is only
  #     populated in the result.
  class TemplateReference
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Represents a parameter value.
    # @!attribute [rw] value
    #   @return [::String]
    #     Required. Represents the string value of the parameter.
    class ParameterValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue]
    class ValuesEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Represents the rule source information from Catalog.
  # @!attribute [r] rule_path_elements
  #   @return [::Array<::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement>]
  #     Output only. Rule path elements represent information about the
  #     individual items in the relationship path between the scan resource and
  #     rule origin in that order.
  class RuleSource
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Path Element represents the direct relationship between the rule origin
    # (aspects) to the BigQuery Entry. Ordering of the rule relationship will
    # be maintained such that the first entry in the list is the closest
    # ancestor (BigQuery table itself). A blank source denotes that the rule is
    # derived directly from the DataScan itself.
    # @!attribute [r] entry_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntrySource]
    #     Output only. Entry source represents information about the related
    #     source entry.
    #
    #     Note: The following fields are mutually exclusive: `entry_source`, `entry_link_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [r] entry_link_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntryLinkSource]
    #     Output only. Entry link source represents information about the entry
    #     link.
    #
    #     Note: The following fields are mutually exclusive: `entry_link_source`, `entry_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RulePathElement
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Entry source represents information about the related source entry.
      # @!attribute [r] entry_type
      #   @return [::String]
      #     Output only. The entry type to represent the current characteristics
      #     of the entry in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryTypes/{entry-type-id}`.
      # @!attribute [r] entry
      #   @return [::String]
      #     Output only. The entry name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
      # @!attribute [r] display_name
      #   @return [::String]
      #     Output only. The display name of the entry.
      class EntrySource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Entry link source represents information about the entry link.
      # @!attribute [r] entry_link_type
      #   @return [::String]
      #     Output only. The entry link type to represent the current
      #     relationship between the entry and the next entry in the path.
      #     In the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryLinkTypes/{entry_link_type_id}`
      # @!attribute [r] entry_link
      #   @return [::String]
      #     Output only. The entry link name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entryLinks/{entry_link_id}`
      class EntryLinkSource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end
  end

  # Specifies a SQL statement that is evaluated to return up to 10 scalar
  # values that are used to debug rules. If the rule fails, the values can help
  # diagnose the cause of the failure.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # You can also name results with an explicit alias using `[AS] alias`. For
  # more information, see [BigQuery explicit
  # aliases](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#explicit_alias_syntax).
  #
  # Example: `SELECT MIN(col1) AS min_col1, MAX(col1) AS max_col1 FROM
  # $\\{data()}`
  # @!attribute [rw] description
  #   @return [::String]
  #     Optional. Specifies the description of the debug query.
  #
  #     * The maximum length is 1,024 characters.
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Required. Specifies the SQL statement to be executed.
  class DebugQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class AttributesEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#rule_source::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource (readonly)

Returns Output only. Contains information about the source of the rule and its relationship with the BigQuery table, where applicable.

Returns:



506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
# File 'proto_docs/google/cloud/dataplex/v1/data_quality.rb', line 506

class DataQualityRule
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Evaluates whether each column value lies between a specified range.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly greater than ('>') the
  #     minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly lesser than ('<') the
  #     maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class RangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is null.
  class NonNullExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is contained by a specified set.
  # @!attribute [rw] values
  #   @return [::Array<::String>]
  #     Optional. Expected values for the column value.
  class SetExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value matches a specified regex.
  # @!attribute [rw] regex
  #   @return [::String]
  #     Optional. A regular expression the column value is expected to match.
  class RegexExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column has duplicates.
  class UniquenessExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column aggregate statistic lies between a specified
  # range.
  # @!attribute [rw] statistic
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::StatisticRangeExpectation::ColumnStatistic]
  #     Optional. The aggregate metric to evaluate.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly greater than
  #     ('>') the minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly lesser than ('<')
  #     the maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class StatisticRangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The list of aggregate metrics a rule can be evaluated against.
    module ColumnStatistic
      # Unspecified statistic type
      STATISTIC_UNDEFINED = 0

      # Evaluate the column mean
      MEAN = 1

      # Evaluate the column min
      MIN = 2

      # Evaluate the column max
      MAX = 3
    end
  end

  # Evaluates whether each row passes the specified condition.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a boolean value per row as the result.
  #
  # Example: col1 >= 0 AND col2 < 10
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class RowConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the provided expression is true.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a scalar boolean result.
  #
  # Example: MIN(col1) >= 0
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class TableConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A SQL statement that is evaluated to return rows that match an invalid
  # state. If any rows are are returned, this rule fails.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # Example: `SELECT * FROM ${data()} WHERE price < 0`
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Optional. The SQL statement.
  class SqlAssertion
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A rule that constructs a SQL statement to evaluate using a rule template
  # and parameter values. If the constructed statement returns any rows, this
  # rule fails
  # @!attribute [rw] name
  #   @return [::String]
  #     Required. The template entry name. Entry must be of EntryType
  #     `projects/dataplex-types/locations/global/entryTypes/data-quality-rule-template`
  #     and contains top-level aspect of AspectType
  #     `projects/dataplex-types/locations/global/aspectTypes/data-quality-rule-template`.
  #     The format is:
  #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
  # @!attribute [rw] values
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue}]
  #     Optional. Provides the map of parameter name and value.
  #     The maximum size of the field is 120KB (encoded as UTF-8).
  # @!attribute [r] resolved_sql
  #   @return [::String]
  #     Output only. The resolved SQL statement generated from the template with
  #     parameters substituted. It is only populated in the result.
  # @!attribute [r] rule_template
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRuleTemplate]
  #     Output only. The rule template used to resolve the rule. It is only
  #     populated in the result.
  class TemplateReference
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Represents a parameter value.
    # @!attribute [rw] value
    #   @return [::String]
    #     Required. Represents the string value of the parameter.
    class ParameterValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue]
    class ValuesEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Represents the rule source information from Catalog.
  # @!attribute [r] rule_path_elements
  #   @return [::Array<::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement>]
  #     Output only. Rule path elements represent information about the
  #     individual items in the relationship path between the scan resource and
  #     rule origin in that order.
  class RuleSource
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Path Element represents the direct relationship between the rule origin
    # (aspects) to the BigQuery Entry. Ordering of the rule relationship will
    # be maintained such that the first entry in the list is the closest
    # ancestor (BigQuery table itself). A blank source denotes that the rule is
    # derived directly from the DataScan itself.
    # @!attribute [r] entry_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntrySource]
    #     Output only. Entry source represents information about the related
    #     source entry.
    #
    #     Note: The following fields are mutually exclusive: `entry_source`, `entry_link_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [r] entry_link_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntryLinkSource]
    #     Output only. Entry link source represents information about the entry
    #     link.
    #
    #     Note: The following fields are mutually exclusive: `entry_link_source`, `entry_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RulePathElement
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Entry source represents information about the related source entry.
      # @!attribute [r] entry_type
      #   @return [::String]
      #     Output only. The entry type to represent the current characteristics
      #     of the entry in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryTypes/{entry-type-id}`.
      # @!attribute [r] entry
      #   @return [::String]
      #     Output only. The entry name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
      # @!attribute [r] display_name
      #   @return [::String]
      #     Output only. The display name of the entry.
      class EntrySource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Entry link source represents information about the entry link.
      # @!attribute [r] entry_link_type
      #   @return [::String]
      #     Output only. The entry link type to represent the current
      #     relationship between the entry and the next entry in the path.
      #     In the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryLinkTypes/{entry_link_type_id}`
      # @!attribute [r] entry_link
      #   @return [::String]
      #     Output only. The entry link name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entryLinks/{entry_link_id}`
      class EntryLinkSource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end
  end

  # Specifies a SQL statement that is evaluated to return up to 10 scalar
  # values that are used to debug rules. If the rule fails, the values can help
  # diagnose the cause of the failure.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # You can also name results with an explicit alias using `[AS] alias`. For
  # more information, see [BigQuery explicit
  # aliases](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#explicit_alias_syntax).
  #
  # Example: `SELECT MIN(col1) AS min_col1, MAX(col1) AS max_col1 FROM
  # $\\{data()}`
  # @!attribute [rw] description
  #   @return [::String]
  #     Optional. Specifies the description of the debug query.
  #
  #     * The maximum length is 1,024 characters.
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Required. Specifies the SQL statement to be executed.
  class DebugQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class AttributesEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#set_expectation::Google::Cloud::Dataplex::V1::DataQualityRule::SetExpectation

Returns Row-level rule which evaluates whether each column value is contained by a specified set.

Note: The following fields are mutually exclusive: set_expectation, range_expectation, non_null_expectation, regex_expectation, uniqueness_expectation, statistic_range_expectation, row_condition_expectation, table_condition_expectation, sql_assertion, template_reference. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns:

  • (::Google::Cloud::Dataplex::V1::DataQualityRule::SetExpectation)

    Row-level rule which evaluates whether each column value is contained by a specified set.

    Note: The following fields are mutually exclusive: set_expectation, range_expectation, non_null_expectation, regex_expectation, uniqueness_expectation, statistic_range_expectation, row_condition_expectation, table_condition_expectation, sql_assertion, template_reference. If a field in that set is populated, all other fields in the set will automatically be cleared.



506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
# File 'proto_docs/google/cloud/dataplex/v1/data_quality.rb', line 506

class DataQualityRule
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Evaluates whether each column value lies between a specified range.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly greater than ('>') the
  #     minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly lesser than ('<') the
  #     maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class RangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is null.
  class NonNullExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is contained by a specified set.
  # @!attribute [rw] values
  #   @return [::Array<::String>]
  #     Optional. Expected values for the column value.
  class SetExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value matches a specified regex.
  # @!attribute [rw] regex
  #   @return [::String]
  #     Optional. A regular expression the column value is expected to match.
  class RegexExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column has duplicates.
  class UniquenessExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column aggregate statistic lies between a specified
  # range.
  # @!attribute [rw] statistic
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::StatisticRangeExpectation::ColumnStatistic]
  #     Optional. The aggregate metric to evaluate.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly greater than
  #     ('>') the minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly lesser than ('<')
  #     the maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class StatisticRangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The list of aggregate metrics a rule can be evaluated against.
    module ColumnStatistic
      # Unspecified statistic type
      STATISTIC_UNDEFINED = 0

      # Evaluate the column mean
      MEAN = 1

      # Evaluate the column min
      MIN = 2

      # Evaluate the column max
      MAX = 3
    end
  end

  # Evaluates whether each row passes the specified condition.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a boolean value per row as the result.
  #
  # Example: col1 >= 0 AND col2 < 10
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class RowConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the provided expression is true.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a scalar boolean result.
  #
  # Example: MIN(col1) >= 0
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class TableConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A SQL statement that is evaluated to return rows that match an invalid
  # state. If any rows are are returned, this rule fails.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # Example: `SELECT * FROM ${data()} WHERE price < 0`
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Optional. The SQL statement.
  class SqlAssertion
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A rule that constructs a SQL statement to evaluate using a rule template
  # and parameter values. If the constructed statement returns any rows, this
  # rule fails
  # @!attribute [rw] name
  #   @return [::String]
  #     Required. The template entry name. Entry must be of EntryType
  #     `projects/dataplex-types/locations/global/entryTypes/data-quality-rule-template`
  #     and contains top-level aspect of AspectType
  #     `projects/dataplex-types/locations/global/aspectTypes/data-quality-rule-template`.
  #     The format is:
  #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
  # @!attribute [rw] values
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue}]
  #     Optional. Provides the map of parameter name and value.
  #     The maximum size of the field is 120KB (encoded as UTF-8).
  # @!attribute [r] resolved_sql
  #   @return [::String]
  #     Output only. The resolved SQL statement generated from the template with
  #     parameters substituted. It is only populated in the result.
  # @!attribute [r] rule_template
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRuleTemplate]
  #     Output only. The rule template used to resolve the rule. It is only
  #     populated in the result.
  class TemplateReference
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Represents a parameter value.
    # @!attribute [rw] value
    #   @return [::String]
    #     Required. Represents the string value of the parameter.
    class ParameterValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue]
    class ValuesEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Represents the rule source information from Catalog.
  # @!attribute [r] rule_path_elements
  #   @return [::Array<::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement>]
  #     Output only. Rule path elements represent information about the
  #     individual items in the relationship path between the scan resource and
  #     rule origin in that order.
  class RuleSource
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Path Element represents the direct relationship between the rule origin
    # (aspects) to the BigQuery Entry. Ordering of the rule relationship will
    # be maintained such that the first entry in the list is the closest
    # ancestor (BigQuery table itself). A blank source denotes that the rule is
    # derived directly from the DataScan itself.
    # @!attribute [r] entry_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntrySource]
    #     Output only. Entry source represents information about the related
    #     source entry.
    #
    #     Note: The following fields are mutually exclusive: `entry_source`, `entry_link_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [r] entry_link_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntryLinkSource]
    #     Output only. Entry link source represents information about the entry
    #     link.
    #
    #     Note: The following fields are mutually exclusive: `entry_link_source`, `entry_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RulePathElement
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Entry source represents information about the related source entry.
      # @!attribute [r] entry_type
      #   @return [::String]
      #     Output only. The entry type to represent the current characteristics
      #     of the entry in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryTypes/{entry-type-id}`.
      # @!attribute [r] entry
      #   @return [::String]
      #     Output only. The entry name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
      # @!attribute [r] display_name
      #   @return [::String]
      #     Output only. The display name of the entry.
      class EntrySource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Entry link source represents information about the entry link.
      # @!attribute [r] entry_link_type
      #   @return [::String]
      #     Output only. The entry link type to represent the current
      #     relationship between the entry and the next entry in the path.
      #     In the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryLinkTypes/{entry_link_type_id}`
      # @!attribute [r] entry_link
      #   @return [::String]
      #     Output only. The entry link name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entryLinks/{entry_link_id}`
      class EntryLinkSource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end
  end

  # Specifies a SQL statement that is evaluated to return up to 10 scalar
  # values that are used to debug rules. If the rule fails, the values can help
  # diagnose the cause of the failure.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # You can also name results with an explicit alias using `[AS] alias`. For
  # more information, see [BigQuery explicit
  # aliases](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#explicit_alias_syntax).
  #
  # Example: `SELECT MIN(col1) AS min_col1, MAX(col1) AS max_col1 FROM
  # $\\{data()}`
  # @!attribute [rw] description
  #   @return [::String]
  #     Optional. Specifies the description of the debug query.
  #
  #     * The maximum length is 1,024 characters.
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Required. Specifies the SQL statement to be executed.
  class DebugQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class AttributesEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#sql_assertion::Google::Cloud::Dataplex::V1::DataQualityRule::SqlAssertion

Returns Aggregate rule which evaluates the number of rows returned for the provided statement. If any rows are returned, this rule fails.

Note: The following fields are mutually exclusive: sql_assertion, range_expectation, non_null_expectation, set_expectation, regex_expectation, uniqueness_expectation, statistic_range_expectation, row_condition_expectation, table_condition_expectation, template_reference. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns:

  • (::Google::Cloud::Dataplex::V1::DataQualityRule::SqlAssertion)

    Aggregate rule which evaluates the number of rows returned for the provided statement. If any rows are returned, this rule fails.

    Note: The following fields are mutually exclusive: sql_assertion, range_expectation, non_null_expectation, set_expectation, regex_expectation, uniqueness_expectation, statistic_range_expectation, row_condition_expectation, table_condition_expectation, template_reference. If a field in that set is populated, all other fields in the set will automatically be cleared.



506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
# File 'proto_docs/google/cloud/dataplex/v1/data_quality.rb', line 506

class DataQualityRule
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Evaluates whether each column value lies between a specified range.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly greater than ('>') the
  #     minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly lesser than ('<') the
  #     maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class RangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is null.
  class NonNullExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is contained by a specified set.
  # @!attribute [rw] values
  #   @return [::Array<::String>]
  #     Optional. Expected values for the column value.
  class SetExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value matches a specified regex.
  # @!attribute [rw] regex
  #   @return [::String]
  #     Optional. A regular expression the column value is expected to match.
  class RegexExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column has duplicates.
  class UniquenessExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column aggregate statistic lies between a specified
  # range.
  # @!attribute [rw] statistic
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::StatisticRangeExpectation::ColumnStatistic]
  #     Optional. The aggregate metric to evaluate.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly greater than
  #     ('>') the minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly lesser than ('<')
  #     the maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class StatisticRangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The list of aggregate metrics a rule can be evaluated against.
    module ColumnStatistic
      # Unspecified statistic type
      STATISTIC_UNDEFINED = 0

      # Evaluate the column mean
      MEAN = 1

      # Evaluate the column min
      MIN = 2

      # Evaluate the column max
      MAX = 3
    end
  end

  # Evaluates whether each row passes the specified condition.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a boolean value per row as the result.
  #
  # Example: col1 >= 0 AND col2 < 10
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class RowConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the provided expression is true.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a scalar boolean result.
  #
  # Example: MIN(col1) >= 0
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class TableConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A SQL statement that is evaluated to return rows that match an invalid
  # state. If any rows are are returned, this rule fails.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # Example: `SELECT * FROM ${data()} WHERE price < 0`
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Optional. The SQL statement.
  class SqlAssertion
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A rule that constructs a SQL statement to evaluate using a rule template
  # and parameter values. If the constructed statement returns any rows, this
  # rule fails
  # @!attribute [rw] name
  #   @return [::String]
  #     Required. The template entry name. Entry must be of EntryType
  #     `projects/dataplex-types/locations/global/entryTypes/data-quality-rule-template`
  #     and contains top-level aspect of AspectType
  #     `projects/dataplex-types/locations/global/aspectTypes/data-quality-rule-template`.
  #     The format is:
  #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
  # @!attribute [rw] values
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue}]
  #     Optional. Provides the map of parameter name and value.
  #     The maximum size of the field is 120KB (encoded as UTF-8).
  # @!attribute [r] resolved_sql
  #   @return [::String]
  #     Output only. The resolved SQL statement generated from the template with
  #     parameters substituted. It is only populated in the result.
  # @!attribute [r] rule_template
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRuleTemplate]
  #     Output only. The rule template used to resolve the rule. It is only
  #     populated in the result.
  class TemplateReference
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Represents a parameter value.
    # @!attribute [rw] value
    #   @return [::String]
    #     Required. Represents the string value of the parameter.
    class ParameterValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue]
    class ValuesEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Represents the rule source information from Catalog.
  # @!attribute [r] rule_path_elements
  #   @return [::Array<::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement>]
  #     Output only. Rule path elements represent information about the
  #     individual items in the relationship path between the scan resource and
  #     rule origin in that order.
  class RuleSource
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Path Element represents the direct relationship between the rule origin
    # (aspects) to the BigQuery Entry. Ordering of the rule relationship will
    # be maintained such that the first entry in the list is the closest
    # ancestor (BigQuery table itself). A blank source denotes that the rule is
    # derived directly from the DataScan itself.
    # @!attribute [r] entry_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntrySource]
    #     Output only. Entry source represents information about the related
    #     source entry.
    #
    #     Note: The following fields are mutually exclusive: `entry_source`, `entry_link_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [r] entry_link_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntryLinkSource]
    #     Output only. Entry link source represents information about the entry
    #     link.
    #
    #     Note: The following fields are mutually exclusive: `entry_link_source`, `entry_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RulePathElement
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Entry source represents information about the related source entry.
      # @!attribute [r] entry_type
      #   @return [::String]
      #     Output only. The entry type to represent the current characteristics
      #     of the entry in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryTypes/{entry-type-id}`.
      # @!attribute [r] entry
      #   @return [::String]
      #     Output only. The entry name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
      # @!attribute [r] display_name
      #   @return [::String]
      #     Output only. The display name of the entry.
      class EntrySource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Entry link source represents information about the entry link.
      # @!attribute [r] entry_link_type
      #   @return [::String]
      #     Output only. The entry link type to represent the current
      #     relationship between the entry and the next entry in the path.
      #     In the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryLinkTypes/{entry_link_type_id}`
      # @!attribute [r] entry_link
      #   @return [::String]
      #     Output only. The entry link name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entryLinks/{entry_link_id}`
      class EntryLinkSource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end
  end

  # Specifies a SQL statement that is evaluated to return up to 10 scalar
  # values that are used to debug rules. If the rule fails, the values can help
  # diagnose the cause of the failure.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # You can also name results with an explicit alias using `[AS] alias`. For
  # more information, see [BigQuery explicit
  # aliases](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#explicit_alias_syntax).
  #
  # Example: `SELECT MIN(col1) AS min_col1, MAX(col1) AS max_col1 FROM
  # $\\{data()}`
  # @!attribute [rw] description
  #   @return [::String]
  #     Optional. Specifies the description of the debug query.
  #
  #     * The maximum length is 1,024 characters.
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Required. Specifies the SQL statement to be executed.
  class DebugQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class AttributesEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#statistic_range_expectation::Google::Cloud::Dataplex::V1::DataQualityRule::StatisticRangeExpectation

Returns Aggregate rule which evaluates whether the column aggregate statistic lies between a specified range.

Note: The following fields are mutually exclusive: statistic_range_expectation, range_expectation, non_null_expectation, set_expectation, regex_expectation, uniqueness_expectation, row_condition_expectation, table_condition_expectation, sql_assertion, template_reference. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns:

  • (::Google::Cloud::Dataplex::V1::DataQualityRule::StatisticRangeExpectation)

    Aggregate rule which evaluates whether the column aggregate statistic lies between a specified range.

    Note: The following fields are mutually exclusive: statistic_range_expectation, range_expectation, non_null_expectation, set_expectation, regex_expectation, uniqueness_expectation, row_condition_expectation, table_condition_expectation, sql_assertion, template_reference. If a field in that set is populated, all other fields in the set will automatically be cleared.



506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
# File 'proto_docs/google/cloud/dataplex/v1/data_quality.rb', line 506

class DataQualityRule
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Evaluates whether each column value lies between a specified range.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly greater than ('>') the
  #     minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly lesser than ('<') the
  #     maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class RangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is null.
  class NonNullExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is contained by a specified set.
  # @!attribute [rw] values
  #   @return [::Array<::String>]
  #     Optional. Expected values for the column value.
  class SetExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value matches a specified regex.
  # @!attribute [rw] regex
  #   @return [::String]
  #     Optional. A regular expression the column value is expected to match.
  class RegexExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column has duplicates.
  class UniquenessExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column aggregate statistic lies between a specified
  # range.
  # @!attribute [rw] statistic
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::StatisticRangeExpectation::ColumnStatistic]
  #     Optional. The aggregate metric to evaluate.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly greater than
  #     ('>') the minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly lesser than ('<')
  #     the maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class StatisticRangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The list of aggregate metrics a rule can be evaluated against.
    module ColumnStatistic
      # Unspecified statistic type
      STATISTIC_UNDEFINED = 0

      # Evaluate the column mean
      MEAN = 1

      # Evaluate the column min
      MIN = 2

      # Evaluate the column max
      MAX = 3
    end
  end

  # Evaluates whether each row passes the specified condition.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a boolean value per row as the result.
  #
  # Example: col1 >= 0 AND col2 < 10
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class RowConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the provided expression is true.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a scalar boolean result.
  #
  # Example: MIN(col1) >= 0
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class TableConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A SQL statement that is evaluated to return rows that match an invalid
  # state. If any rows are are returned, this rule fails.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # Example: `SELECT * FROM ${data()} WHERE price < 0`
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Optional. The SQL statement.
  class SqlAssertion
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A rule that constructs a SQL statement to evaluate using a rule template
  # and parameter values. If the constructed statement returns any rows, this
  # rule fails
  # @!attribute [rw] name
  #   @return [::String]
  #     Required. The template entry name. Entry must be of EntryType
  #     `projects/dataplex-types/locations/global/entryTypes/data-quality-rule-template`
  #     and contains top-level aspect of AspectType
  #     `projects/dataplex-types/locations/global/aspectTypes/data-quality-rule-template`.
  #     The format is:
  #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
  # @!attribute [rw] values
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue}]
  #     Optional. Provides the map of parameter name and value.
  #     The maximum size of the field is 120KB (encoded as UTF-8).
  # @!attribute [r] resolved_sql
  #   @return [::String]
  #     Output only. The resolved SQL statement generated from the template with
  #     parameters substituted. It is only populated in the result.
  # @!attribute [r] rule_template
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRuleTemplate]
  #     Output only. The rule template used to resolve the rule. It is only
  #     populated in the result.
  class TemplateReference
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Represents a parameter value.
    # @!attribute [rw] value
    #   @return [::String]
    #     Required. Represents the string value of the parameter.
    class ParameterValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue]
    class ValuesEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Represents the rule source information from Catalog.
  # @!attribute [r] rule_path_elements
  #   @return [::Array<::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement>]
  #     Output only. Rule path elements represent information about the
  #     individual items in the relationship path between the scan resource and
  #     rule origin in that order.
  class RuleSource
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Path Element represents the direct relationship between the rule origin
    # (aspects) to the BigQuery Entry. Ordering of the rule relationship will
    # be maintained such that the first entry in the list is the closest
    # ancestor (BigQuery table itself). A blank source denotes that the rule is
    # derived directly from the DataScan itself.
    # @!attribute [r] entry_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntrySource]
    #     Output only. Entry source represents information about the related
    #     source entry.
    #
    #     Note: The following fields are mutually exclusive: `entry_source`, `entry_link_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [r] entry_link_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntryLinkSource]
    #     Output only. Entry link source represents information about the entry
    #     link.
    #
    #     Note: The following fields are mutually exclusive: `entry_link_source`, `entry_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RulePathElement
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Entry source represents information about the related source entry.
      # @!attribute [r] entry_type
      #   @return [::String]
      #     Output only. The entry type to represent the current characteristics
      #     of the entry in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryTypes/{entry-type-id}`.
      # @!attribute [r] entry
      #   @return [::String]
      #     Output only. The entry name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
      # @!attribute [r] display_name
      #   @return [::String]
      #     Output only. The display name of the entry.
      class EntrySource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Entry link source represents information about the entry link.
      # @!attribute [r] entry_link_type
      #   @return [::String]
      #     Output only. The entry link type to represent the current
      #     relationship between the entry and the next entry in the path.
      #     In the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryLinkTypes/{entry_link_type_id}`
      # @!attribute [r] entry_link
      #   @return [::String]
      #     Output only. The entry link name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entryLinks/{entry_link_id}`
      class EntryLinkSource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end
  end

  # Specifies a SQL statement that is evaluated to return up to 10 scalar
  # values that are used to debug rules. If the rule fails, the values can help
  # diagnose the cause of the failure.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # You can also name results with an explicit alias using `[AS] alias`. For
  # more information, see [BigQuery explicit
  # aliases](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#explicit_alias_syntax).
  #
  # Example: `SELECT MIN(col1) AS min_col1, MAX(col1) AS max_col1 FROM
  # $\\{data()}`
  # @!attribute [rw] description
  #   @return [::String]
  #     Optional. Specifies the description of the debug query.
  #
  #     * The maximum length is 1,024 characters.
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Required. Specifies the SQL statement to be executed.
  class DebugQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class AttributesEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#suspended::Boolean

Returns Optional. Whether the Rule is active or suspended. Default is false.

Returns:

  • (::Boolean)

    Optional. Whether the Rule is active or suspended. Default is false.



506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
# File 'proto_docs/google/cloud/dataplex/v1/data_quality.rb', line 506

class DataQualityRule
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Evaluates whether each column value lies between a specified range.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly greater than ('>') the
  #     minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly lesser than ('<') the
  #     maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class RangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is null.
  class NonNullExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is contained by a specified set.
  # @!attribute [rw] values
  #   @return [::Array<::String>]
  #     Optional. Expected values for the column value.
  class SetExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value matches a specified regex.
  # @!attribute [rw] regex
  #   @return [::String]
  #     Optional. A regular expression the column value is expected to match.
  class RegexExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column has duplicates.
  class UniquenessExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column aggregate statistic lies between a specified
  # range.
  # @!attribute [rw] statistic
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::StatisticRangeExpectation::ColumnStatistic]
  #     Optional. The aggregate metric to evaluate.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly greater than
  #     ('>') the minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly lesser than ('<')
  #     the maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class StatisticRangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The list of aggregate metrics a rule can be evaluated against.
    module ColumnStatistic
      # Unspecified statistic type
      STATISTIC_UNDEFINED = 0

      # Evaluate the column mean
      MEAN = 1

      # Evaluate the column min
      MIN = 2

      # Evaluate the column max
      MAX = 3
    end
  end

  # Evaluates whether each row passes the specified condition.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a boolean value per row as the result.
  #
  # Example: col1 >= 0 AND col2 < 10
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class RowConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the provided expression is true.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a scalar boolean result.
  #
  # Example: MIN(col1) >= 0
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class TableConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A SQL statement that is evaluated to return rows that match an invalid
  # state. If any rows are are returned, this rule fails.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # Example: `SELECT * FROM ${data()} WHERE price < 0`
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Optional. The SQL statement.
  class SqlAssertion
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A rule that constructs a SQL statement to evaluate using a rule template
  # and parameter values. If the constructed statement returns any rows, this
  # rule fails
  # @!attribute [rw] name
  #   @return [::String]
  #     Required. The template entry name. Entry must be of EntryType
  #     `projects/dataplex-types/locations/global/entryTypes/data-quality-rule-template`
  #     and contains top-level aspect of AspectType
  #     `projects/dataplex-types/locations/global/aspectTypes/data-quality-rule-template`.
  #     The format is:
  #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
  # @!attribute [rw] values
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue}]
  #     Optional. Provides the map of parameter name and value.
  #     The maximum size of the field is 120KB (encoded as UTF-8).
  # @!attribute [r] resolved_sql
  #   @return [::String]
  #     Output only. The resolved SQL statement generated from the template with
  #     parameters substituted. It is only populated in the result.
  # @!attribute [r] rule_template
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRuleTemplate]
  #     Output only. The rule template used to resolve the rule. It is only
  #     populated in the result.
  class TemplateReference
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Represents a parameter value.
    # @!attribute [rw] value
    #   @return [::String]
    #     Required. Represents the string value of the parameter.
    class ParameterValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue]
    class ValuesEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Represents the rule source information from Catalog.
  # @!attribute [r] rule_path_elements
  #   @return [::Array<::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement>]
  #     Output only. Rule path elements represent information about the
  #     individual items in the relationship path between the scan resource and
  #     rule origin in that order.
  class RuleSource
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Path Element represents the direct relationship between the rule origin
    # (aspects) to the BigQuery Entry. Ordering of the rule relationship will
    # be maintained such that the first entry in the list is the closest
    # ancestor (BigQuery table itself). A blank source denotes that the rule is
    # derived directly from the DataScan itself.
    # @!attribute [r] entry_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntrySource]
    #     Output only. Entry source represents information about the related
    #     source entry.
    #
    #     Note: The following fields are mutually exclusive: `entry_source`, `entry_link_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [r] entry_link_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntryLinkSource]
    #     Output only. Entry link source represents information about the entry
    #     link.
    #
    #     Note: The following fields are mutually exclusive: `entry_link_source`, `entry_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RulePathElement
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Entry source represents information about the related source entry.
      # @!attribute [r] entry_type
      #   @return [::String]
      #     Output only. The entry type to represent the current characteristics
      #     of the entry in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryTypes/{entry-type-id}`.
      # @!attribute [r] entry
      #   @return [::String]
      #     Output only. The entry name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
      # @!attribute [r] display_name
      #   @return [::String]
      #     Output only. The display name of the entry.
      class EntrySource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Entry link source represents information about the entry link.
      # @!attribute [r] entry_link_type
      #   @return [::String]
      #     Output only. The entry link type to represent the current
      #     relationship between the entry and the next entry in the path.
      #     In the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryLinkTypes/{entry_link_type_id}`
      # @!attribute [r] entry_link
      #   @return [::String]
      #     Output only. The entry link name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entryLinks/{entry_link_id}`
      class EntryLinkSource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end
  end

  # Specifies a SQL statement that is evaluated to return up to 10 scalar
  # values that are used to debug rules. If the rule fails, the values can help
  # diagnose the cause of the failure.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # You can also name results with an explicit alias using `[AS] alias`. For
  # more information, see [BigQuery explicit
  # aliases](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#explicit_alias_syntax).
  #
  # Example: `SELECT MIN(col1) AS min_col1, MAX(col1) AS max_col1 FROM
  # $\\{data()}`
  # @!attribute [rw] description
  #   @return [::String]
  #     Optional. Specifies the description of the debug query.
  #
  #     * The maximum length is 1,024 characters.
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Required. Specifies the SQL statement to be executed.
  class DebugQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class AttributesEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#table_condition_expectation::Google::Cloud::Dataplex::V1::DataQualityRule::TableConditionExpectation

Returns Aggregate rule which evaluates whether the provided expression is true for a table.

Note: The following fields are mutually exclusive: table_condition_expectation, range_expectation, non_null_expectation, set_expectation, regex_expectation, uniqueness_expectation, statistic_range_expectation, row_condition_expectation, sql_assertion, template_reference. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns:

  • (::Google::Cloud::Dataplex::V1::DataQualityRule::TableConditionExpectation)

    Aggregate rule which evaluates whether the provided expression is true for a table.

    Note: The following fields are mutually exclusive: table_condition_expectation, range_expectation, non_null_expectation, set_expectation, regex_expectation, uniqueness_expectation, statistic_range_expectation, row_condition_expectation, sql_assertion, template_reference. If a field in that set is populated, all other fields in the set will automatically be cleared.



506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
# File 'proto_docs/google/cloud/dataplex/v1/data_quality.rb', line 506

class DataQualityRule
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Evaluates whether each column value lies between a specified range.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly greater than ('>') the
  #     minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly lesser than ('<') the
  #     maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class RangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is null.
  class NonNullExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is contained by a specified set.
  # @!attribute [rw] values
  #   @return [::Array<::String>]
  #     Optional. Expected values for the column value.
  class SetExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value matches a specified regex.
  # @!attribute [rw] regex
  #   @return [::String]
  #     Optional. A regular expression the column value is expected to match.
  class RegexExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column has duplicates.
  class UniquenessExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column aggregate statistic lies between a specified
  # range.
  # @!attribute [rw] statistic
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::StatisticRangeExpectation::ColumnStatistic]
  #     Optional. The aggregate metric to evaluate.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly greater than
  #     ('>') the minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly lesser than ('<')
  #     the maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class StatisticRangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The list of aggregate metrics a rule can be evaluated against.
    module ColumnStatistic
      # Unspecified statistic type
      STATISTIC_UNDEFINED = 0

      # Evaluate the column mean
      MEAN = 1

      # Evaluate the column min
      MIN = 2

      # Evaluate the column max
      MAX = 3
    end
  end

  # Evaluates whether each row passes the specified condition.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a boolean value per row as the result.
  #
  # Example: col1 >= 0 AND col2 < 10
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class RowConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the provided expression is true.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a scalar boolean result.
  #
  # Example: MIN(col1) >= 0
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class TableConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A SQL statement that is evaluated to return rows that match an invalid
  # state. If any rows are are returned, this rule fails.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # Example: `SELECT * FROM ${data()} WHERE price < 0`
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Optional. The SQL statement.
  class SqlAssertion
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A rule that constructs a SQL statement to evaluate using a rule template
  # and parameter values. If the constructed statement returns any rows, this
  # rule fails
  # @!attribute [rw] name
  #   @return [::String]
  #     Required. The template entry name. Entry must be of EntryType
  #     `projects/dataplex-types/locations/global/entryTypes/data-quality-rule-template`
  #     and contains top-level aspect of AspectType
  #     `projects/dataplex-types/locations/global/aspectTypes/data-quality-rule-template`.
  #     The format is:
  #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
  # @!attribute [rw] values
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue}]
  #     Optional. Provides the map of parameter name and value.
  #     The maximum size of the field is 120KB (encoded as UTF-8).
  # @!attribute [r] resolved_sql
  #   @return [::String]
  #     Output only. The resolved SQL statement generated from the template with
  #     parameters substituted. It is only populated in the result.
  # @!attribute [r] rule_template
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRuleTemplate]
  #     Output only. The rule template used to resolve the rule. It is only
  #     populated in the result.
  class TemplateReference
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Represents a parameter value.
    # @!attribute [rw] value
    #   @return [::String]
    #     Required. Represents the string value of the parameter.
    class ParameterValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue]
    class ValuesEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Represents the rule source information from Catalog.
  # @!attribute [r] rule_path_elements
  #   @return [::Array<::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement>]
  #     Output only. Rule path elements represent information about the
  #     individual items in the relationship path between the scan resource and
  #     rule origin in that order.
  class RuleSource
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Path Element represents the direct relationship between the rule origin
    # (aspects) to the BigQuery Entry. Ordering of the rule relationship will
    # be maintained such that the first entry in the list is the closest
    # ancestor (BigQuery table itself). A blank source denotes that the rule is
    # derived directly from the DataScan itself.
    # @!attribute [r] entry_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntrySource]
    #     Output only. Entry source represents information about the related
    #     source entry.
    #
    #     Note: The following fields are mutually exclusive: `entry_source`, `entry_link_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [r] entry_link_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntryLinkSource]
    #     Output only. Entry link source represents information about the entry
    #     link.
    #
    #     Note: The following fields are mutually exclusive: `entry_link_source`, `entry_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RulePathElement
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Entry source represents information about the related source entry.
      # @!attribute [r] entry_type
      #   @return [::String]
      #     Output only. The entry type to represent the current characteristics
      #     of the entry in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryTypes/{entry-type-id}`.
      # @!attribute [r] entry
      #   @return [::String]
      #     Output only. The entry name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
      # @!attribute [r] display_name
      #   @return [::String]
      #     Output only. The display name of the entry.
      class EntrySource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Entry link source represents information about the entry link.
      # @!attribute [r] entry_link_type
      #   @return [::String]
      #     Output only. The entry link type to represent the current
      #     relationship between the entry and the next entry in the path.
      #     In the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryLinkTypes/{entry_link_type_id}`
      # @!attribute [r] entry_link
      #   @return [::String]
      #     Output only. The entry link name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entryLinks/{entry_link_id}`
      class EntryLinkSource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end
  end

  # Specifies a SQL statement that is evaluated to return up to 10 scalar
  # values that are used to debug rules. If the rule fails, the values can help
  # diagnose the cause of the failure.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # You can also name results with an explicit alias using `[AS] alias`. For
  # more information, see [BigQuery explicit
  # aliases](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#explicit_alias_syntax).
  #
  # Example: `SELECT MIN(col1) AS min_col1, MAX(col1) AS max_col1 FROM
  # $\\{data()}`
  # @!attribute [rw] description
  #   @return [::String]
  #     Optional. Specifies the description of the debug query.
  #
  #     * The maximum length is 1,024 characters.
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Required. Specifies the SQL statement to be executed.
  class DebugQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class AttributesEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#template_reference::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference

Returns Aggregate rule which references a rule template and provides the parameters to be substituted in the template. If any rows are returned, this rule fails.

Note: The following fields are mutually exclusive: template_reference, range_expectation, non_null_expectation, set_expectation, regex_expectation, uniqueness_expectation, statistic_range_expectation, row_condition_expectation, table_condition_expectation, sql_assertion. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns:

  • (::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference)

    Aggregate rule which references a rule template and provides the parameters to be substituted in the template. If any rows are returned, this rule fails.

    Note: The following fields are mutually exclusive: template_reference, range_expectation, non_null_expectation, set_expectation, regex_expectation, uniqueness_expectation, statistic_range_expectation, row_condition_expectation, table_condition_expectation, sql_assertion. If a field in that set is populated, all other fields in the set will automatically be cleared.



506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
# File 'proto_docs/google/cloud/dataplex/v1/data_quality.rb', line 506

class DataQualityRule
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Evaluates whether each column value lies between a specified range.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly greater than ('>') the
  #     minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly lesser than ('<') the
  #     maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class RangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is null.
  class NonNullExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is contained by a specified set.
  # @!attribute [rw] values
  #   @return [::Array<::String>]
  #     Optional. Expected values for the column value.
  class SetExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value matches a specified regex.
  # @!attribute [rw] regex
  #   @return [::String]
  #     Optional. A regular expression the column value is expected to match.
  class RegexExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column has duplicates.
  class UniquenessExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column aggregate statistic lies between a specified
  # range.
  # @!attribute [rw] statistic
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::StatisticRangeExpectation::ColumnStatistic]
  #     Optional. The aggregate metric to evaluate.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly greater than
  #     ('>') the minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly lesser than ('<')
  #     the maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class StatisticRangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The list of aggregate metrics a rule can be evaluated against.
    module ColumnStatistic
      # Unspecified statistic type
      STATISTIC_UNDEFINED = 0

      # Evaluate the column mean
      MEAN = 1

      # Evaluate the column min
      MIN = 2

      # Evaluate the column max
      MAX = 3
    end
  end

  # Evaluates whether each row passes the specified condition.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a boolean value per row as the result.
  #
  # Example: col1 >= 0 AND col2 < 10
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class RowConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the provided expression is true.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a scalar boolean result.
  #
  # Example: MIN(col1) >= 0
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class TableConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A SQL statement that is evaluated to return rows that match an invalid
  # state. If any rows are are returned, this rule fails.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # Example: `SELECT * FROM ${data()} WHERE price < 0`
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Optional. The SQL statement.
  class SqlAssertion
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A rule that constructs a SQL statement to evaluate using a rule template
  # and parameter values. If the constructed statement returns any rows, this
  # rule fails
  # @!attribute [rw] name
  #   @return [::String]
  #     Required. The template entry name. Entry must be of EntryType
  #     `projects/dataplex-types/locations/global/entryTypes/data-quality-rule-template`
  #     and contains top-level aspect of AspectType
  #     `projects/dataplex-types/locations/global/aspectTypes/data-quality-rule-template`.
  #     The format is:
  #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
  # @!attribute [rw] values
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue}]
  #     Optional. Provides the map of parameter name and value.
  #     The maximum size of the field is 120KB (encoded as UTF-8).
  # @!attribute [r] resolved_sql
  #   @return [::String]
  #     Output only. The resolved SQL statement generated from the template with
  #     parameters substituted. It is only populated in the result.
  # @!attribute [r] rule_template
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRuleTemplate]
  #     Output only. The rule template used to resolve the rule. It is only
  #     populated in the result.
  class TemplateReference
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Represents a parameter value.
    # @!attribute [rw] value
    #   @return [::String]
    #     Required. Represents the string value of the parameter.
    class ParameterValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue]
    class ValuesEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Represents the rule source information from Catalog.
  # @!attribute [r] rule_path_elements
  #   @return [::Array<::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement>]
  #     Output only. Rule path elements represent information about the
  #     individual items in the relationship path between the scan resource and
  #     rule origin in that order.
  class RuleSource
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Path Element represents the direct relationship between the rule origin
    # (aspects) to the BigQuery Entry. Ordering of the rule relationship will
    # be maintained such that the first entry in the list is the closest
    # ancestor (BigQuery table itself). A blank source denotes that the rule is
    # derived directly from the DataScan itself.
    # @!attribute [r] entry_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntrySource]
    #     Output only. Entry source represents information about the related
    #     source entry.
    #
    #     Note: The following fields are mutually exclusive: `entry_source`, `entry_link_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [r] entry_link_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntryLinkSource]
    #     Output only. Entry link source represents information about the entry
    #     link.
    #
    #     Note: The following fields are mutually exclusive: `entry_link_source`, `entry_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RulePathElement
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Entry source represents information about the related source entry.
      # @!attribute [r] entry_type
      #   @return [::String]
      #     Output only. The entry type to represent the current characteristics
      #     of the entry in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryTypes/{entry-type-id}`.
      # @!attribute [r] entry
      #   @return [::String]
      #     Output only. The entry name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
      # @!attribute [r] display_name
      #   @return [::String]
      #     Output only. The display name of the entry.
      class EntrySource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Entry link source represents information about the entry link.
      # @!attribute [r] entry_link_type
      #   @return [::String]
      #     Output only. The entry link type to represent the current
      #     relationship between the entry and the next entry in the path.
      #     In the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryLinkTypes/{entry_link_type_id}`
      # @!attribute [r] entry_link
      #   @return [::String]
      #     Output only. The entry link name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entryLinks/{entry_link_id}`
      class EntryLinkSource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end
  end

  # Specifies a SQL statement that is evaluated to return up to 10 scalar
  # values that are used to debug rules. If the rule fails, the values can help
  # diagnose the cause of the failure.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # You can also name results with an explicit alias using `[AS] alias`. For
  # more information, see [BigQuery explicit
  # aliases](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#explicit_alias_syntax).
  #
  # Example: `SELECT MIN(col1) AS min_col1, MAX(col1) AS max_col1 FROM
  # $\\{data()}`
  # @!attribute [rw] description
  #   @return [::String]
  #     Optional. Specifies the description of the debug query.
  #
  #     * The maximum length is 1,024 characters.
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Required. Specifies the SQL statement to be executed.
  class DebugQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class AttributesEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#threshold::Float

Returns Optional. 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.

Returns:

  • (::Float)

    Optional. 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.



506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
# File 'proto_docs/google/cloud/dataplex/v1/data_quality.rb', line 506

class DataQualityRule
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Evaluates whether each column value lies between a specified range.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly greater than ('>') the
  #     minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly lesser than ('<') the
  #     maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class RangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is null.
  class NonNullExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is contained by a specified set.
  # @!attribute [rw] values
  #   @return [::Array<::String>]
  #     Optional. Expected values for the column value.
  class SetExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value matches a specified regex.
  # @!attribute [rw] regex
  #   @return [::String]
  #     Optional. A regular expression the column value is expected to match.
  class RegexExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column has duplicates.
  class UniquenessExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column aggregate statistic lies between a specified
  # range.
  # @!attribute [rw] statistic
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::StatisticRangeExpectation::ColumnStatistic]
  #     Optional. The aggregate metric to evaluate.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly greater than
  #     ('>') the minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly lesser than ('<')
  #     the maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class StatisticRangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The list of aggregate metrics a rule can be evaluated against.
    module ColumnStatistic
      # Unspecified statistic type
      STATISTIC_UNDEFINED = 0

      # Evaluate the column mean
      MEAN = 1

      # Evaluate the column min
      MIN = 2

      # Evaluate the column max
      MAX = 3
    end
  end

  # Evaluates whether each row passes the specified condition.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a boolean value per row as the result.
  #
  # Example: col1 >= 0 AND col2 < 10
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class RowConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the provided expression is true.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a scalar boolean result.
  #
  # Example: MIN(col1) >= 0
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class TableConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A SQL statement that is evaluated to return rows that match an invalid
  # state. If any rows are are returned, this rule fails.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # Example: `SELECT * FROM ${data()} WHERE price < 0`
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Optional. The SQL statement.
  class SqlAssertion
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A rule that constructs a SQL statement to evaluate using a rule template
  # and parameter values. If the constructed statement returns any rows, this
  # rule fails
  # @!attribute [rw] name
  #   @return [::String]
  #     Required. The template entry name. Entry must be of EntryType
  #     `projects/dataplex-types/locations/global/entryTypes/data-quality-rule-template`
  #     and contains top-level aspect of AspectType
  #     `projects/dataplex-types/locations/global/aspectTypes/data-quality-rule-template`.
  #     The format is:
  #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
  # @!attribute [rw] values
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue}]
  #     Optional. Provides the map of parameter name and value.
  #     The maximum size of the field is 120KB (encoded as UTF-8).
  # @!attribute [r] resolved_sql
  #   @return [::String]
  #     Output only. The resolved SQL statement generated from the template with
  #     parameters substituted. It is only populated in the result.
  # @!attribute [r] rule_template
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRuleTemplate]
  #     Output only. The rule template used to resolve the rule. It is only
  #     populated in the result.
  class TemplateReference
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Represents a parameter value.
    # @!attribute [rw] value
    #   @return [::String]
    #     Required. Represents the string value of the parameter.
    class ParameterValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue]
    class ValuesEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Represents the rule source information from Catalog.
  # @!attribute [r] rule_path_elements
  #   @return [::Array<::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement>]
  #     Output only. Rule path elements represent information about the
  #     individual items in the relationship path between the scan resource and
  #     rule origin in that order.
  class RuleSource
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Path Element represents the direct relationship between the rule origin
    # (aspects) to the BigQuery Entry. Ordering of the rule relationship will
    # be maintained such that the first entry in the list is the closest
    # ancestor (BigQuery table itself). A blank source denotes that the rule is
    # derived directly from the DataScan itself.
    # @!attribute [r] entry_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntrySource]
    #     Output only. Entry source represents information about the related
    #     source entry.
    #
    #     Note: The following fields are mutually exclusive: `entry_source`, `entry_link_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [r] entry_link_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntryLinkSource]
    #     Output only. Entry link source represents information about the entry
    #     link.
    #
    #     Note: The following fields are mutually exclusive: `entry_link_source`, `entry_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RulePathElement
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Entry source represents information about the related source entry.
      # @!attribute [r] entry_type
      #   @return [::String]
      #     Output only. The entry type to represent the current characteristics
      #     of the entry in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryTypes/{entry-type-id}`.
      # @!attribute [r] entry
      #   @return [::String]
      #     Output only. The entry name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
      # @!attribute [r] display_name
      #   @return [::String]
      #     Output only. The display name of the entry.
      class EntrySource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Entry link source represents information about the entry link.
      # @!attribute [r] entry_link_type
      #   @return [::String]
      #     Output only. The entry link type to represent the current
      #     relationship between the entry and the next entry in the path.
      #     In the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryLinkTypes/{entry_link_type_id}`
      # @!attribute [r] entry_link
      #   @return [::String]
      #     Output only. The entry link name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entryLinks/{entry_link_id}`
      class EntryLinkSource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end
  end

  # Specifies a SQL statement that is evaluated to return up to 10 scalar
  # values that are used to debug rules. If the rule fails, the values can help
  # diagnose the cause of the failure.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # You can also name results with an explicit alias using `[AS] alias`. For
  # more information, see [BigQuery explicit
  # aliases](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#explicit_alias_syntax).
  #
  # Example: `SELECT MIN(col1) AS min_col1, MAX(col1) AS max_col1 FROM
  # $\\{data()}`
  # @!attribute [rw] description
  #   @return [::String]
  #     Optional. Specifies the description of the debug query.
  #
  #     * The maximum length is 1,024 characters.
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Required. Specifies the SQL statement to be executed.
  class DebugQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class AttributesEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#uniqueness_expectation::Google::Cloud::Dataplex::V1::DataQualityRule::UniquenessExpectation

Returns Row-level rule which evaluates whether each column value is unique.

Note: The following fields are mutually exclusive: uniqueness_expectation, range_expectation, non_null_expectation, set_expectation, regex_expectation, statistic_range_expectation, row_condition_expectation, table_condition_expectation, sql_assertion, template_reference. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns:

  • (::Google::Cloud::Dataplex::V1::DataQualityRule::UniquenessExpectation)

    Row-level rule which evaluates whether each column value is unique.

    Note: The following fields are mutually exclusive: uniqueness_expectation, range_expectation, non_null_expectation, set_expectation, regex_expectation, statistic_range_expectation, row_condition_expectation, table_condition_expectation, sql_assertion, template_reference. If a field in that set is populated, all other fields in the set will automatically be cleared.



506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
# File 'proto_docs/google/cloud/dataplex/v1/data_quality.rb', line 506

class DataQualityRule
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Evaluates whether each column value lies between a specified range.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column value allowed for a row to pass this
  #     validation. At least one of `min_value` and `max_value` need to be
  #     provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly greater than ('>') the
  #     minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether each value needs to be strictly lesser than ('<') the
  #     maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class RangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is null.
  class NonNullExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value is contained by a specified set.
  # @!attribute [rw] values
  #   @return [::Array<::String>]
  #     Optional. Expected values for the column value.
  class SetExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether each column value matches a specified regex.
  # @!attribute [rw] regex
  #   @return [::String]
  #     Optional. A regular expression the column value is expected to match.
  class RegexExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column has duplicates.
  class UniquenessExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the column aggregate statistic lies between a specified
  # range.
  # @!attribute [rw] statistic
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::StatisticRangeExpectation::ColumnStatistic]
  #     Optional. The aggregate metric to evaluate.
  # @!attribute [rw] min_value
  #   @return [::String]
  #     Optional. The minimum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] max_value
  #   @return [::String]
  #     Optional. The maximum column statistic value allowed for a row to pass
  #     this validation.
  #
  #     At least one of `min_value` and `max_value` need to be provided.
  # @!attribute [rw] strict_min_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly greater than
  #     ('>') the minimum, or if equality is allowed.
  #
  #     Only relevant if a `min_value` has been defined. Default = false.
  # @!attribute [rw] strict_max_enabled
  #   @return [::Boolean]
  #     Optional. Whether column statistic needs to be strictly lesser than ('<')
  #     the maximum, or if equality is allowed.
  #
  #     Only relevant if a `max_value` has been defined. Default = false.
  class StatisticRangeExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The list of aggregate metrics a rule can be evaluated against.
    module ColumnStatistic
      # Unspecified statistic type
      STATISTIC_UNDEFINED = 0

      # Evaluate the column mean
      MEAN = 1

      # Evaluate the column min
      MIN = 2

      # Evaluate the column max
      MAX = 3
    end
  end

  # Evaluates whether each row passes the specified condition.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a boolean value per row as the result.
  #
  # Example: col1 >= 0 AND col2 < 10
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class RowConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Evaluates whether the provided expression is true.
  #
  # The SQL expression needs to use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax)
  # and should produce a scalar boolean result.
  #
  # Example: MIN(col1) >= 0
  # @!attribute [rw] sql_expression
  #   @return [::String]
  #     Optional. The SQL expression.
  class TableConditionExpectation
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A SQL statement that is evaluated to return rows that match an invalid
  # state. If any rows are are returned, this rule fails.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # Example: `SELECT * FROM ${data()} WHERE price < 0`
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Optional. The SQL statement.
  class SqlAssertion
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A rule that constructs a SQL statement to evaluate using a rule template
  # and parameter values. If the constructed statement returns any rows, this
  # rule fails
  # @!attribute [rw] name
  #   @return [::String]
  #     Required. The template entry name. Entry must be of EntryType
  #     `projects/dataplex-types/locations/global/entryTypes/data-quality-rule-template`
  #     and contains top-level aspect of AspectType
  #     `projects/dataplex-types/locations/global/aspectTypes/data-quality-rule-template`.
  #     The format is:
  #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
  # @!attribute [rw] values
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue}]
  #     Optional. Provides the map of parameter name and value.
  #     The maximum size of the field is 120KB (encoded as UTF-8).
  # @!attribute [r] resolved_sql
  #   @return [::String]
  #     Output only. The resolved SQL statement generated from the template with
  #     parameters substituted. It is only populated in the result.
  # @!attribute [r] rule_template
  #   @return [::Google::Cloud::Dataplex::V1::DataQualityRuleTemplate]
  #     Output only. The rule template used to resolve the rule. It is only
  #     populated in the result.
  class TemplateReference
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Represents a parameter value.
    # @!attribute [rw] value
    #   @return [::String]
    #     Required. Represents the string value of the parameter.
    class ParameterValue
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::TemplateReference::ParameterValue]
    class ValuesEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Represents the rule source information from Catalog.
  # @!attribute [r] rule_path_elements
  #   @return [::Array<::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement>]
  #     Output only. Rule path elements represent information about the
  #     individual items in the relationship path between the scan resource and
  #     rule origin in that order.
  class RuleSource
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Path Element represents the direct relationship between the rule origin
    # (aspects) to the BigQuery Entry. Ordering of the rule relationship will
    # be maintained such that the first entry in the list is the closest
    # ancestor (BigQuery table itself). A blank source denotes that the rule is
    # derived directly from the DataScan itself.
    # @!attribute [r] entry_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntrySource]
    #     Output only. Entry source represents information about the related
    #     source entry.
    #
    #     Note: The following fields are mutually exclusive: `entry_source`, `entry_link_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    # @!attribute [r] entry_link_source
    #   @return [::Google::Cloud::Dataplex::V1::DataQualityRule::RuleSource::RulePathElement::EntryLinkSource]
    #     Output only. Entry link source represents information about the entry
    #     link.
    #
    #     Note: The following fields are mutually exclusive: `entry_link_source`, `entry_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
    class RulePathElement
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Entry source represents information about the related source entry.
      # @!attribute [r] entry_type
      #   @return [::String]
      #     Output only. The entry type to represent the current characteristics
      #     of the entry in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryTypes/{entry-type-id}`.
      # @!attribute [r] entry
      #   @return [::String]
      #     Output only. The entry name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
      # @!attribute [r] display_name
      #   @return [::String]
      #     Output only. The display name of the entry.
      class EntrySource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end

      # Entry link source represents information about the entry link.
      # @!attribute [r] entry_link_type
      #   @return [::String]
      #     Output only. The entry link type to represent the current
      #     relationship between the entry and the next entry in the path.
      #     In the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryLinkTypes/{entry_link_type_id}`
      # @!attribute [r] entry_link
      #   @return [::String]
      #     Output only. The entry link name in the form of:
      #     `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entryLinks/{entry_link_id}`
      class EntryLinkSource
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end
  end

  # Specifies a SQL statement that is evaluated to return up to 10 scalar
  # values that are used to debug rules. If the rule fails, the values can help
  # diagnose the cause of the failure.
  #
  # The SQL statement must use [GoogleSQL
  # syntax](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax),
  # and must not contain any semicolons.
  #
  # You can use the data reference parameter `${data()}` to reference the
  # source table with all of its precondition filters applied. Examples of
  # precondition filters include row filters, incremental data filters, and
  # sampling. For more information, see [Data reference
  # parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter).
  #
  # You can also name results with an explicit alias using `[AS] alias`. For
  # more information, see [BigQuery explicit
  # aliases](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#explicit_alias_syntax).
  #
  # Example: `SELECT MIN(col1) AS min_col1, MAX(col1) AS max_col1 FROM
  # $\\{data()}`
  # @!attribute [rw] description
  #   @return [::String]
  #     Optional. Specifies the description of the debug query.
  #
  #     * The maximum length is 1,024 characters.
  # @!attribute [rw] sql_statement
  #   @return [::String]
  #     Required. Specifies the SQL statement to be executed.
  class DebugQuery
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class AttributesEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end