# 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.SchemaPackage do
  @moduledoc """
  A schema package contains a set of schemas and type definitions.

  ## Attributes

  *   `ignoreMinOccurs` (*type:* `boolean()`, *default:* `nil`) - Flag to ignore all min_occurs restrictions in the schema. This means that incoming messages can omit any group, segment, field, component, or subcomponent.
  *   `schemas` (*type:* `list(GoogleApi.HealthCare.V1beta1.Model.Hl7SchemaConfig.t)`, *default:* `nil`) - Schema configs that are layered based on their VersionSources that match the incoming message. Schema configs present in higher indices override those in lower indices with the same message type and trigger event if their VersionSources all match an incoming message.
  *   `schematizedParsingType` (*type:* `String.t`, *default:* `nil`) - Determines how messages that fail to parse are handled.
  *   `types` (*type:* `list(GoogleApi.HealthCare.V1beta1.Model.Hl7TypesConfig.t)`, *default:* `nil`) - Schema type definitions that are layered based on their VersionSources that match the incoming message. Type definitions present in higher indices override those in lower indices with the same type name if their VersionSources all match an incoming message.
  *   `unexpectedSegmentHandling` (*type:* `String.t`, *default:* `nil`) - Determines how unexpected segments (segments not matched to the schema) are handled.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :ignoreMinOccurs => boolean() | nil,
          :schemas => list(GoogleApi.HealthCare.V1beta1.Model.Hl7SchemaConfig.t()) | nil,
          :schematizedParsingType => String.t() | nil,
          :types => list(GoogleApi.HealthCare.V1beta1.Model.Hl7TypesConfig.t()) | nil,
          :unexpectedSegmentHandling => String.t() | nil
        }

  field(:ignoreMinOccurs)
  field(:schemas, as: GoogleApi.HealthCare.V1beta1.Model.Hl7SchemaConfig, type: :list)
  field(:schematizedParsingType)
  field(:types, as: GoogleApi.HealthCare.V1beta1.Model.Hl7TypesConfig, type: :list)
  field(:unexpectedSegmentHandling)
end

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

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