# 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.HealthCare.V1beta1.Model.GoogleCloudHealthcareV1beta1DeidentifyFieldMetadata do
  @moduledoc """
  Specifies the FHIR paths to match and how to handle the de-identification of matching fields.

  ## Attributes

  *   `characterMaskField` (*type:* `GoogleApi.HealthCare.V1beta1.Model.CharacterMaskField.t`, *default:* `nil`) - Replace the field's value with a masking character. Supported [types](https://www.hl7.org/fhir/datatypes.html): Code, Decimal, HumanName, Id, LanguageCode, Markdown, Oid, String, Uri, Uuid, Xhtml.
  *   `cleanTextField` (*type:* `GoogleApi.HealthCare.V1beta1.Model.CleanTextField.t`, *default:* `nil`) - Inspect the field's text and transform sensitive text. Configure using TextConfig. Supported [types](https://www.hl7.org/fhir/datatypes.html): Code, Date, DateTime, Decimal, HumanName, Id, LanguageCode, Markdown, Oid, String, Uri, Uuid, Xhtml.
  *   `cryptoHashField` (*type:* `GoogleApi.HealthCare.V1beta1.Model.CryptoHashField.t`, *default:* `nil`) - Replace field value with a hash of that value. Supported [types](https://www.hl7.org/fhir/datatypes.html): Code, Decimal, HumanName, Id, LanguageCode, Markdown, Oid, String, Uri, Uuid, Xhtml.
  *   `dateShiftField` (*type:* `GoogleApi.HealthCare.V1beta1.Model.DateShiftField.t`, *default:* `nil`) - Shift the date by a randomized number of days. See [date shifting](https://cloud.google.com/dlp/docs/concepts-date-shifting) for more information. Supported [types](https://www.hl7.org/fhir/datatypes.html): Date, DateTime.
  *   `keepField` (*type:* `GoogleApi.HealthCare.V1beta1.Model.KeepField.t`, *default:* `nil`) - Keep the field unchanged.
  *   `paths` (*type:* `list(String.t)`, *default:* `nil`) - List of paths to FHIR fields to redact. Each path is a period-separated list where each component is either a field name or FHIR [type](https://www.hl7.org/fhir/datatypes.html) name. All types begin with an upper case letter. For example, the resource field `Patient.Address.city`, which uses a [string](https://www.hl7.org/fhir/datatypes-definitions.html#Address.city) type, can be matched by `Patient.Address.String`. Partial matching is supported. For example, `Patient.Address.city` can be matched by `Address.city` (with `Patient` omitted). Partial matching and type matching can be combined, for example `Patient.Address.city` can be matched by `Address.String`. For "choice" types (those defined in the FHIR spec with the format `field[x]`), use two separate components. For example, `deceasedAge.unit` is matched by `Deceased.Age.unit`. The following types are supported: AdministrativeGenderCode, Base64Binary, Boolean, Code, Date, DateTime, Decimal, HumanName, Id, Instant, Integer, LanguageCode, Markdown, Oid, PositiveInt, String, UnsignedInt, Uri, Uuid, Xhtml. The sub-type for HumanName (for example `HumanName.given`, `HumanName.family`) can be omitted.
  *   `removeField` (*type:* `GoogleApi.HealthCare.V1beta1.Model.RemoveField.t`, *default:* `nil`) - Remove the field.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :characterMaskField => GoogleApi.HealthCare.V1beta1.Model.CharacterMaskField.t() | nil,
          :cleanTextField => GoogleApi.HealthCare.V1beta1.Model.CleanTextField.t() | nil,
          :cryptoHashField => GoogleApi.HealthCare.V1beta1.Model.CryptoHashField.t() | nil,
          :dateShiftField => GoogleApi.HealthCare.V1beta1.Model.DateShiftField.t() | nil,
          :keepField => GoogleApi.HealthCare.V1beta1.Model.KeepField.t() | nil,
          :paths => list(String.t()) | nil,
          :removeField => GoogleApi.HealthCare.V1beta1.Model.RemoveField.t() | nil
        }

  field(:characterMaskField, as: GoogleApi.HealthCare.V1beta1.Model.CharacterMaskField)
  field(:cleanTextField, as: GoogleApi.HealthCare.V1beta1.Model.CleanTextField)
  field(:cryptoHashField, as: GoogleApi.HealthCare.V1beta1.Model.CryptoHashField)
  field(:dateShiftField, as: GoogleApi.HealthCare.V1beta1.Model.DateShiftField)
  field(:keepField, as: GoogleApi.HealthCare.V1beta1.Model.KeepField)
  field(:paths, type: :list)
  field(:removeField, as: GoogleApi.HealthCare.V1beta1.Model.RemoveField)
end

defimpl Poison.Decoder,
  for: GoogleApi.HealthCare.V1beta1.Model.GoogleCloudHealthcareV1beta1DeidentifyFieldMetadata do
  def decode(value, options) do
    GoogleApi.HealthCare.V1beta1.Model.GoogleCloudHealthcareV1beta1DeidentifyFieldMetadata.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.HealthCare.V1beta1.Model.GoogleCloudHealthcareV1beta1DeidentifyFieldMetadata do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
