# 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.GooglePrivacyDlpV2DiscoveryCloudSqlFilter do
  @moduledoc """
  Determines what tables will have profiles generated within an organization or project. Includes the ability to filter by regular expression patterns on project ID, location, instance, database, and database resource name.

  ## Attributes

  *   `collection` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DatabaseResourceCollection.t`, *default:* `nil`) - A specific set of database resources for this filter to apply to.
  *   `databaseResourceReference` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DatabaseResourceReference.t`, *default:* `nil`) - The database resource to scan. Targets including this can only include one target (the target with this database resource reference).
  *   `others` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2AllOtherDatabaseResources.t`, *default:* `nil`) - Catch-all. This should always be the last target in the list because anything above it will apply first. Should only appear once in a configuration. If none is specified, a default one will be added automatically.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :collection =>
            GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DatabaseResourceCollection.t() | nil,
          :databaseResourceReference =>
            GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DatabaseResourceReference.t() | nil,
          :others => GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2AllOtherDatabaseResources.t() | nil
        }

  field(:collection, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DatabaseResourceCollection)

  field(:databaseResourceReference,
    as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DatabaseResourceReference
  )

  field(:others, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2AllOtherDatabaseResources)
end

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

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