# 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.GooglePrivacyDlpV2DiscoveryTarget do
  @moduledoc """
  Target used to match against for Discovery.

  ## Attributes

  *   `bigQueryTarget` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2BigQueryDiscoveryTarget.t`, *default:* `nil`) - BigQuery target for Discovery. The first target to match a table will be the one applied.
  *   `cloudSqlTarget` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2CloudSqlDiscoveryTarget.t`, *default:* `nil`) - Cloud SQL target for Discovery. The first target to match a table will be the one applied.
  *   `cloudStorageTarget` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2CloudStorageDiscoveryTarget.t`, *default:* `nil`) - Cloud Storage target for Discovery. The first target to match a table will be the one applied.
  *   `otherCloudTarget` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2OtherCloudDiscoveryTarget.t`, *default:* `nil`) - Other clouds target for discovery. The first target to match a resource will be the one applied.
  *   `secretsTarget` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2SecretsDiscoveryTarget.t`, *default:* `nil`) - Discovery target that looks for credentials and secrets stored in cloud resource metadata and reports them as vulnerabilities to Security Command Center. Only one target of this type is allowed.
  *   `vertexDatasetTarget` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2VertexDatasetDiscoveryTarget.t`, *default:* `nil`) - Vertex AI dataset target for Discovery. The first target to match a dataset will be the one applied. Note that discovery for Vertex AI can incur Cloud Storage Class B operation charges for storage.objects.get operations and retrieval fees. For more information, see [Cloud Storage pricing](https://cloud.google.com/storage/pricing#price-tables). Note that discovery for Vertex AI dataset will not be able to scan images unless DiscoveryConfig.processing_location.image_fallback_location has multi_region_processing or global_processing configured.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :bigQueryTarget =>
            GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2BigQueryDiscoveryTarget.t() | nil,
          :cloudSqlTarget =>
            GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2CloudSqlDiscoveryTarget.t() | nil,
          :cloudStorageTarget =>
            GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2CloudStorageDiscoveryTarget.t() | nil,
          :otherCloudTarget =>
            GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2OtherCloudDiscoveryTarget.t() | nil,
          :secretsTarget =>
            GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2SecretsDiscoveryTarget.t() | nil,
          :vertexDatasetTarget =>
            GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2VertexDatasetDiscoveryTarget.t() | nil
        }

  field(:bigQueryTarget, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2BigQueryDiscoveryTarget)
  field(:cloudSqlTarget, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2CloudSqlDiscoveryTarget)

  field(:cloudStorageTarget,
    as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2CloudStorageDiscoveryTarget
  )

  field(:otherCloudTarget, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2OtherCloudDiscoveryTarget)
  field(:secretsTarget, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2SecretsDiscoveryTarget)

  field(:vertexDatasetTarget,
    as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2VertexDatasetDiscoveryTarget
  )
end

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

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