# 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.GooglePrivacyDlpV2Finding do
  @moduledoc """
  Represents a piece of potentially sensitive content.

  ## Attributes

  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Timestamp when finding was detected.
  *   `findingId` (*type:* `String.t`, *default:* `nil`) - The unique finding id.
  *   `infoType` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2InfoType.t`, *default:* `nil`) - The type of content that might have been found. Provided if `excluded_types` is false.
  *   `jobCreateTime` (*type:* `DateTime.t`, *default:* `nil`) - Time the job started that produced this finding.
  *   `jobName` (*type:* `String.t`, *default:* `nil`) - The job that stored the finding.
  *   `labels` (*type:* `map()`, *default:* `nil`) - The labels associated with this `Finding`. Label keys must be between 1 and 63 characters long and must conform to the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`. Label values must be between 0 and 63 characters long and must conform to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`. No more than 10 labels can be associated with a given finding. Examples: * `"environment" : "production"` * `"pipeline" : "etl"`
  *   `likelihood` (*type:* `String.t`, *default:* `nil`) - Confidence of how likely it is that the `info_type` is correct.
  *   `location` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2Location.t`, *default:* `nil`) - Where the content was found.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Resource name in format projects/{project}/locations/{location}/findings/{finding} Populated only when viewing persisted findings.
  *   `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. Provided if `include_quote` is true and the finding is less than or equal to 4096 bytes long. 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. Only populated if include_quote was set to true and a supported infoType was requested. Currently supported infoTypes: DATE, DATE_OF_BIRTH and TIME.
  *   `resourceName` (*type:* `String.t`, *default:* `nil`) - The job that stored the finding.
  *   `triggerName` (*type:* `String.t`, *default:* `nil`) - Job trigger name, if applicable, for this finding.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :createTime => DateTime.t() | nil,
          :findingId => String.t() | nil,
          :infoType => GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2InfoType.t() | nil,
          :jobCreateTime => DateTime.t() | nil,
          :jobName => String.t() | nil,
          :labels => map() | nil,
          :likelihood => String.t() | nil,
          :location => GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2Location.t() | nil,
          :name => String.t() | nil,
          :quote => String.t() | nil,
          :quoteInfo => GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2QuoteInfo.t() | nil,
          :resourceName => String.t() | nil,
          :triggerName => String.t() | nil
        }

  field(:createTime, as: DateTime)
  field(:findingId)
  field(:infoType, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2InfoType)
  field(:jobCreateTime, as: DateTime)
  field(:jobName)
  field(:labels, type: :map)
  field(:likelihood)
  field(:location, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2Location)
  field(:name)
  field(:quote)
  field(:quoteInfo, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2QuoteInfo)
  field(:resourceName)
  field(:triggerName)
end

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

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