# 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.GooglePrivacyDlpV2DataProfileJobConfig do
  @moduledoc """
  Configuration for setting up a job to scan resources for profile generation. Only one data profile configuration may exist per organization, folder, or project. The generated data profiles are retained according to the [data retention policy] (https://cloud.google.com/sensitive-data-protection/docs/data-profiles#retention).

  ## Attributes

  *   `dataProfileActions` (*type:* `list(GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DataProfileAction.t)`, *default:* `nil`) - Actions to execute at the completion of the job.
  *   `inspectTemplates` (*type:* `list(String.t)`, *default:* `nil`) - Detection logic for profile generation. Not all template features are used by profiles. FindingLimits, include_quote and exclude_info_types have no impact on data profiling. Multiple templates may be provided if there is data in multiple regions. At most one template must be specified per-region (including "global"). Each region is scanned using the applicable template. If no region-specific template is specified, but a "global" template is specified, it will be copied to that region and used instead. If no global or region-specific template is provided for a region with data, that region's data will not be scanned. For more information, see https://cloud.google.com/sensitive-data-protection/docs/data-profiles#data-residency.
  *   `location` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DataProfileLocation.t`, *default:* `nil`) - The data to scan.
  *   `otherCloudStartingLocation` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2OtherCloudDiscoveryStartingLocation.t`, *default:* `nil`) - Must be set only when scanning other clouds.
  *   `projectId` (*type:* `String.t`, *default:* `nil`) - The project that will run the scan. The DLP service account that exists within this project must have access to all resources that are profiled, and the DLP API must be enabled.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :dataProfileActions =>
            list(GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DataProfileAction.t()) | nil,
          :inspectTemplates => list(String.t()) | nil,
          :location => GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DataProfileLocation.t() | nil,
          :otherCloudStartingLocation =>
            GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2OtherCloudDiscoveryStartingLocation.t() | nil,
          :projectId => String.t() | nil
        }

  field(:dataProfileActions,
    as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DataProfileAction,
    type: :list
  )

  field(:inspectTemplates, type: :list)
  field(:location, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DataProfileLocation)

  field(:otherCloudStartingLocation,
    as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2OtherCloudDiscoveryStartingLocation
  )

  field(:projectId)
end

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

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