# 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.GoogleCloudDataplexV1DataQualityResult do
  @moduledoc """
  The output of a DataQualityScan.

  ## Attributes

  *   `columns` (*type:* `list(GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DataQualityColumnResult.t)`, *default:* `nil`) - Output only. A list of results at the column level.A column will have a corresponding DataQualityColumnResult if and only if there is at least one rule with the 'column' field set to it.
  *   `dimensions` (*type:* `list(GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DataQualityDimensionResult.t)`, *default:* `nil`) - Output only. A list of results at the dimension level.A dimension will have a corresponding DataQualityDimensionResult if and only if there is at least one rule with the 'dimension' field set to it.
  *   `passed` (*type:* `boolean()`, *default:* `nil`) - Output only. Overall data quality result -- true if all rules passed.
  *   `postScanActionsResult` (*type:* `GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DataQualityResultPostScanActionsResult.t`, *default:* `nil`) - Output only. The result of post scan actions.
  *   `rowCount` (*type:* `String.t`, *default:* `nil`) - Output only. The count of rows processed.
  *   `rules` (*type:* `list(GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DataQualityRuleResult.t)`, *default:* `nil`) - Output only. A list of all the rules in a job, and their results.
  *   `scannedData` (*type:* `GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ScannedData.t`, *default:* `nil`) - Output only. The data scanned for this result.
  *   `score` (*type:* `number()`, *default:* `nil`) - Output only. The overall data quality score.The score ranges between 0, 100 (up to two decimal points).
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :columns =>
            list(GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DataQualityColumnResult.t())
            | nil,
          :dimensions =>
            list(GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DataQualityDimensionResult.t())
            | nil,
          :passed => boolean() | nil,
          :postScanActionsResult =>
            GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DataQualityResultPostScanActionsResult.t()
            | nil,
          :rowCount => String.t() | nil,
          :rules =>
            list(GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DataQualityRuleResult.t()) | nil,
          :scannedData => GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ScannedData.t() | nil,
          :score => number() | nil
        }

  field(:columns,
    as: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DataQualityColumnResult,
    type: :list
  )

  field(:dimensions,
    as: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DataQualityDimensionResult,
    type: :list
  )

  field(:passed)

  field(:postScanActionsResult,
    as: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DataQualityResultPostScanActionsResult
  )

  field(:rowCount)

  field(:rules,
    as: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DataQualityRuleResult,
    type: :list
  )

  field(:scannedData, as: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ScannedData)
  field(:score)
end

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

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