# 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.GoogleCloudDataplexV1DataQualityScanRuleResult do
  @moduledoc """
  Information about the result of a data quality rule for data quality scan. The monitored resource is 'DataScan'.

  ## Attributes

  *   `assertionRowCount` (*type:* `String.t`, *default:* `nil`) - The number of rows returned by the SQL statement in a SQL assertion rule. This field is only valid for SQL assertion rules.
  *   `column` (*type:* `String.t`, *default:* `nil`) - The column which this rule is evaluated against.
  *   `dataSource` (*type:* `String.t`, *default:* `nil`) - The data source of the data scan (e.g. BigQuery table name).
  *   `evaluatedRowCount` (*type:* `String.t`, *default:* `nil`) - The number of rows evaluated against the data quality rule. This field is only valid for rules of PER_ROW evaluation type.
  *   `evalutionType` (*type:* `String.t`, *default:* `nil`) - The evaluation type of the data quality rule.
  *   `jobId` (*type:* `String.t`, *default:* `nil`) - Identifier of the specific data scan job this log entry is for.
  *   `nullRowCount` (*type:* `String.t`, *default:* `nil`) - The number of rows with null values in the specified column.
  *   `passedRowCount` (*type:* `String.t`, *default:* `nil`) - The number of rows which passed a rule evaluation. This field is only valid for rules of PER_ROW evaluation type.
  *   `result` (*type:* `String.t`, *default:* `nil`) - The result of the data quality rule.
  *   `ruleDimension` (*type:* `String.t`, *default:* `nil`) - The dimension of the data quality rule.
  *   `ruleName` (*type:* `String.t`, *default:* `nil`) - The name of the data quality rule.
  *   `ruleType` (*type:* `String.t`, *default:* `nil`) - The type of the data quality rule.
  *   `thresholdPercent` (*type:* `float()`, *default:* `nil`) - The passing threshold (0.0, 100.0) of the data quality rule.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :assertionRowCount => String.t() | nil,
          :column => String.t() | nil,
          :dataSource => String.t() | nil,
          :evaluatedRowCount => String.t() | nil,
          :evalutionType => String.t() | nil,
          :jobId => String.t() | nil,
          :nullRowCount => String.t() | nil,
          :passedRowCount => String.t() | nil,
          :result => String.t() | nil,
          :ruleDimension => String.t() | nil,
          :ruleName => String.t() | nil,
          :ruleType => String.t() | nil,
          :thresholdPercent => float() | nil
        }

  field(:assertionRowCount)
  field(:column)
  field(:dataSource)
  field(:evaluatedRowCount)
  field(:evalutionType)
  field(:jobId)
  field(:nullRowCount)
  field(:passedRowCount)
  field(:result)
  field(:ruleDimension)
  field(:ruleName)
  field(:ruleType)
  field(:thresholdPercent)
end

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

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