# 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.FhirFieldConfig do
  @moduledoc """
  Specifies how to handle the de-identification of a FHIR store.

  ## Attributes

  *   `fieldMetadataList` (*type:* `list(GoogleApi.HealthCare.V1beta1.Model.GoogleCloudHealthcareV1beta1DeidentifyFieldMetadata.t)`, *default:* `nil`) - Specifies FHIR paths to match and how to transform them. Any field that is not matched by a FieldMetadata `action` is passed through to the output dataset unmodified. All extensions will be processed according to keep_extensions. If a field can be matched by more than one FieldMetadata `action`, the first `action` option is applied. Overrides options and the union field `profile` in FhirFieldConfig.
  *   `options` (*type:* `GoogleApi.HealthCare.V1beta1.Model.GoogleCloudHealthcareV1beta1DeidentifyOptions.t`, *default:* `nil`) - Specifies additional options, overriding the base ProfileType.
  *   `profileType` (*type:* `String.t`, *default:* `nil`) - Base profile type for handling FHIR fields.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :fieldMetadataList =>
            list(
              GoogleApi.HealthCare.V1beta1.Model.GoogleCloudHealthcareV1beta1DeidentifyFieldMetadata.t()
            )
            | nil,
          :options =>
            GoogleApi.HealthCare.V1beta1.Model.GoogleCloudHealthcareV1beta1DeidentifyOptions.t()
            | nil,
          :profileType => String.t() | nil
        }

  field(:fieldMetadataList,
    as: GoogleApi.HealthCare.V1beta1.Model.GoogleCloudHealthcareV1beta1DeidentifyFieldMetadata,
    type: :list
  )

  field(:options,
    as: GoogleApi.HealthCare.V1beta1.Model.GoogleCloudHealthcareV1beta1DeidentifyOptions
  )

  field(:profileType)
end

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

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