# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DataQualityRuleResult do
  @moduledoc """
  DataQualityRuleResult provides a more detailed, per-rule view of the results.

  ## Attributes

  *   `assertionRowCount` (*type:* `String.t`, *default:* `nil`) - Output only. The number of rows returned by the SQL statement in a SQL assertion rule.This field is only valid for SQL assertion rules.
  *   `evaluatedCount` (*type:* `String.t`, *default:* `nil`) - Output only. The number of rows a rule was evaluated against.This field is only valid for row-level type rules.Evaluated count can be configured to either include all rows (default) - with null rows automatically failing rule evaluation, or exclude null rows from the evaluated_count, by setting ignore_nulls = true.This field is not set for rule SqlAssertion.
  *   `failingRowsQuery` (*type:* `String.t`, *default:* `nil`) - Output only. The query to find rows that did not pass this rule.This field is only valid for row-level type rules.
  *   `nullCount` (*type:* `String.t`, *default:* `nil`) - Output only. The number of rows with null values in the specified column.
  *   `passRatio` (*type:* `float()`, *default:* `nil`) - Output only. The ratio of passed_count / evaluated_count.This field is only valid for row-level type rules.
  *   `passed` (*type:* `boolean()`, *default:* `nil`) - Output only. Whether the rule passed or failed.
  *   `passedCount` (*type:* `String.t`, *default:* `nil`) - Output only. The number of rows which passed a rule evaluation.This field is only valid for row-level type rules.This field is not set for rule SqlAssertion.
  *   `rule` (*type:* `GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DataQualityRule.t`, *default:* `nil`) - Output only. The rule specified in the DataQualitySpec, as is.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :assertionRowCount => String.t() | nil,
          :evaluatedCount => String.t() | nil,
          :failingRowsQuery => String.t() | nil,
          :nullCount => String.t() | nil,
          :passRatio => float() | nil,
          :passed => boolean() | nil,
          :passedCount => String.t() | nil,
          :rule => GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DataQualityRule.t() | nil
        }

  field(:assertionRowCount)
  field(:evaluatedCount)
  field(:failingRowsQuery)
  field(:nullCount)
  field(:passRatio)
  field(:passed)
  field(:passedCount)
  field(:rule, as: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DataQualityRule)
end

defimpl Poison.Decoder,
  for: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DataQualityRuleResult do
  def decode(value, options) do
    GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DataQualityRuleResult.decode(value, options)
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DataQualityRuleResult do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
