# 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.GooglePrivacyDlpV2DataProfileFinding do
  @moduledoc """
  Details about a piece of potentially sensitive information that was detected when the data resource was profiled.

  ## Attributes

  *   `dataProfileResourceName` (*type:* `String.t`, *default:* `nil`) - Resource name of the data profile associated with the finding.
  *   `findingId` (*type:* `String.t`, *default:* `nil`) - A unique identifier for the finding.
  *   `infotype` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2InfoType.t`, *default:* `nil`) - The [type of content](https://cloud.google.com/sensitive-data-protection/docs/infotypes-reference) that might have been found.
  *   `location` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DataProfileFindingLocation.t`, *default:* `nil`) - Where the content was found.
  *   `quote` (*type:* `String.t`, *default:* `nil`) - The content that was found. Even if the content is not textual, it may be converted to a textual representation here. If the finding exceeds 4096 bytes in length, the quote may be omitted.
  *   `quoteInfo` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2QuoteInfo.t`, *default:* `nil`) - Contains data parsed from quotes. Currently supported infoTypes: DATE, DATE_OF_BIRTH, and TIME.
  *   `resourceVisibility` (*type:* `String.t`, *default:* `nil`) - How broadly a resource has been shared.
  *   `timestamp` (*type:* `DateTime.t`, *default:* `nil`) - Timestamp when the finding was detected.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :dataProfileResourceName => String.t() | nil,
          :findingId => String.t() | nil,
          :infotype => GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2InfoType.t() | nil,
          :location =>
            GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DataProfileFindingLocation.t() | nil,
          :quote => String.t() | nil,
          :quoteInfo => GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2QuoteInfo.t() | nil,
          :resourceVisibility => String.t() | nil,
          :timestamp => DateTime.t() | nil
        }

  field(:dataProfileResourceName)
  field(:findingId)
  field(:infotype, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2InfoType)
  field(:location, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DataProfileFindingLocation)
  field(:quote)
  field(:quoteInfo, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2QuoteInfo)
  field(:resourceVisibility)
  field(:timestamp, as: DateTime)
end

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

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