# 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.GoogleCloudDataplexV1DataQualitySpec do
  @moduledoc """
  DataQualityScan related setting.

  ## Attributes

  *   `postScanActions` (*type:* `GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DataQualitySpecPostScanActions.t`, *default:* `nil`) - Optional. Actions to take upon job completion.
  *   `rowFilter` (*type:* `String.t`, *default:* `nil`) - Optional. A filter applied to all rows in a single DataScan job. The filter needs to be a valid SQL expression for a WHERE clause in GoogleSQL syntax (https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#where_clause).Example: col1 >= 0 AND col2 < 10
  *   `rules` (*type:* `list(GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DataQualityRule.t)`, *default:* `nil`) - Required. The list of rules to evaluate against a data source. At least one rule is required.
  *   `samplingPercent` (*type:* `number()`, *default:* `nil`) - Optional. The percentage of the records to be selected from the dataset for DataScan. Value can range between 0.0 and 100.0 with up to 3 significant decimal digits. Sampling is not applied if sampling_percent is not specified, 0 or 100.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :postScanActions =>
            GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DataQualitySpecPostScanActions.t()
            | nil,
          :rowFilter => String.t() | nil,
          :rules =>
            list(GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DataQualityRule.t()) | nil,
          :samplingPercent => number() | nil
        }

  field(:postScanActions,
    as: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DataQualitySpecPostScanActions
  )

  field(:rowFilter)
  field(:rules, as: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DataQualityRule, type: :list)
  field(:samplingPercent)
end

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

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