# 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.GooglePrivacyDlpV2StoredInfoTypeConfig do
  @moduledoc """
  Configuration for stored infoTypes. All fields and subfield are provided by the user. For more information, see https://cloud.google.com/sensitive-data-protection/docs/creating-custom-infotypes.

  ## Attributes

  *   `description` (*type:* `String.t`, *default:* `nil`) - Description of the StoredInfoType (max 256 characters).
  *   `dictionary` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2Dictionary.t`, *default:* `nil`) - Store dictionary-based CustomInfoType.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - Display name of the StoredInfoType (max 256 characters).
  *   `largeCustomDictionary` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2LargeCustomDictionaryConfig.t`, *default:* `nil`) - StoredInfoType where findings are defined by a dictionary of phrases.
  *   `regex` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2Regex.t`, *default:* `nil`) - Store regular expression-based StoredInfoType.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :description => String.t() | nil,
          :dictionary => GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2Dictionary.t() | nil,
          :displayName => String.t() | nil,
          :largeCustomDictionary =>
            GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2LargeCustomDictionaryConfig.t() | nil,
          :regex => GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2Regex.t() | nil
        }

  field(:description)
  field(:dictionary, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2Dictionary)
  field(:displayName)

  field(:largeCustomDictionary,
    as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2LargeCustomDictionaryConfig
  )

  field(:regex, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2Regex)
end

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

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