# 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.GooglePrivacyDlpV2Dictionary do
  @moduledoc """
  Custom information type based on a dictionary of words or phrases. This can be used to match sensitive information specific to the data, such as a list of employee IDs or job titles. Dictionary words are case-insensitive and all characters other than letters and digits in the unicode [Basic Multilingual Plane](https://en.wikipedia.org/wiki/Plane_%28Unicode%29#Basic_Multilingual_Plane) will be replaced with whitespace when scanning for matches, so the dictionary phrase "Sam Johnson" will match all three phrases "sam johnson", "Sam, Johnson", and "Sam (Johnson)". Additionally, the characters surrounding any match must be of a different type than the adjacent characters within the word, so letters must be next to non-letters and digits next to non-digits. For example, the dictionary word "jen" will match the first three letters of the text "jen123" but will return no matches for "jennifer". Dictionary words containing a large number of characters that are not letters or digits may result in unexpected findings because such characters are treated as whitespace. The [limits](https://cloud.google.com/sensitive-data-protection/limits) page contains details about the size limits of dictionaries. For dictionaries that do not fit within these constraints, consider using `LargeCustomDictionaryConfig` in the `StoredInfoType` API.

  ## Attributes

  *   `cloudStoragePath` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2CloudStoragePath.t`, *default:* `nil`) - Newline-delimited file of words in Cloud Storage. Only a single file is accepted.
  *   `wordList` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2WordList.t`, *default:* `nil`) - List of words or phrases to search for.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :cloudStoragePath =>
            GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2CloudStoragePath.t() | nil,
          :wordList => GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2WordList.t() | nil
        }

  field(:cloudStoragePath, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2CloudStoragePath)
  field(:wordList, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2WordList)
end

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

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