# 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.GooglePrivacyDlpV2CustomInfoType do
  @moduledoc """
  Custom information type provided by the user. Used to find domain-specific sensitive information configurable to the data in question.

  ## Attributes

  *   `detectionRules` (*type:* `list(GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DetectionRule.t)`, *default:* `nil`) - Set of detection rules to apply to all findings of this CustomInfoType. Rules are applied in order that they are specified. Not supported for the `surrogate_type` CustomInfoType.
  *   `dictionary` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2Dictionary.t`, *default:* `nil`) - A list of phrases to detect as a CustomInfoType.
  *   `exclusionType` (*type:* `String.t`, *default:* `nil`) - If set to EXCLUSION_TYPE_EXCLUDE this infoType will not cause a finding to be returned. It still can be used for rules matching.
  *   `infoType` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2InfoType.t`, *default:* `nil`) - CustomInfoType can either be a new infoType, or an extension of built-in infoType, when the name matches one of existing infoTypes and that infoType is specified in `InspectContent.info_types` field. Specifying the latter adds findings to the one detected by the system. If built-in info type is not specified in `InspectContent.info_types` list then the name is treated as a custom info type.
  *   `likelihood` (*type:* `String.t`, *default:* `nil`) - Likelihood to return for this CustomInfoType. This base value can be altered by a detection rule if the finding meets the criteria specified by the rule. Defaults to `VERY_LIKELY` if not specified.
  *   `regex` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2Regex.t`, *default:* `nil`) - Regular expression based CustomInfoType.
  *   `sensitivityScore` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2SensitivityScore.t`, *default:* `nil`) - Sensitivity for this CustomInfoType. If this CustomInfoType extends an existing InfoType, the sensitivity here will take precedence over that of the original InfoType. If unset for a CustomInfoType, it will default to HIGH. This only applies to data profiling.
  *   `storedType` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2StoredType.t`, *default:* `nil`) - Load an existing `StoredInfoType` resource for use in `InspectDataSource`. Not currently supported in `InspectContent`.
  *   `surrogateType` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2SurrogateType.t`, *default:* `nil`) - Message for detecting output from deidentification transformations that support reversing.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :detectionRules =>
            list(GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DetectionRule.t()) | nil,
          :dictionary => GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2Dictionary.t() | nil,
          :exclusionType => String.t() | nil,
          :infoType => GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2InfoType.t() | nil,
          :likelihood => String.t() | nil,
          :regex => GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2Regex.t() | nil,
          :sensitivityScore =>
            GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2SensitivityScore.t() | nil,
          :storedType => GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2StoredType.t() | nil,
          :surrogateType => GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2SurrogateType.t() | nil
        }

  field(:detectionRules, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DetectionRule, type: :list)
  field(:dictionary, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2Dictionary)
  field(:exclusionType)
  field(:infoType, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2InfoType)
  field(:likelihood)
  field(:regex, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2Regex)
  field(:sensitivityScore, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2SensitivityScore)
  field(:storedType, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2StoredType)
  field(:surrogateType, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2SurrogateType)
end

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

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