# 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.DLP.V2.Model.GooglePrivacyDlpV2BigQueryDiscoveryTarget do
  @moduledoc """
  Target used to match against for discovery with BigQuery tables

  ## Attributes

  *   `cadence` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DiscoveryGenerationCadence.t`, *default:* `nil`) - How often and when to update profiles. New tables that match both the filter and conditions are scanned as quickly as possible depending on system capacity.
  *   `conditions` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DiscoveryBigQueryConditions.t`, *default:* `nil`) - In addition to matching the filter, these conditions must be true before a profile is generated.
  *   `disabled` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2Disabled.t`, *default:* `nil`) - Tables that match this filter will not have profiles created.
  *   `filter` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DiscoveryBigQueryFilter.t`, *default:* `nil`) - Required. The tables the discovery cadence applies to. The first target with a matching filter will be the one to apply to a table.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :cadence =>
            GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DiscoveryGenerationCadence.t() | nil,
          :conditions =>
            GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DiscoveryBigQueryConditions.t() | nil,
          :disabled => GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2Disabled.t() | nil,
          :filter => GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DiscoveryBigQueryFilter.t() | nil
        }

  field(:cadence, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DiscoveryGenerationCadence)
  field(:conditions, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DiscoveryBigQueryConditions)
  field(:disabled, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2Disabled)
  field(:filter, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DiscoveryBigQueryFilter)
end

defimpl Poison.Decoder, for: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2BigQueryDiscoveryTarget do
  def decode(value, options) do
    GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2BigQueryDiscoveryTarget.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2BigQueryDiscoveryTarget do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
