# 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.AttributeDefinition do
  @moduledoc """
  A client-defined consent attribute.

  ## Attributes

  *   `allowedValues` (*type:* `list(String.t)`, *default:* `nil`) - Required. Possible values for the attribute. The number of allowed values must not exceed 500. An empty list is invalid. The list can only be expanded after creation.
  *   `category` (*type:* `String.t`, *default:* `nil`) - Required. The category of the attribute. The value of this field cannot be changed after creation.
  *   `consentDefaultValues` (*type:* `list(String.t)`, *default:* `nil`) - Optional. Default values of the attribute in Consents. If no default values are specified, it defaults to an empty value.
  *   `dataMappingDefaultValue` (*type:* `String.t`, *default:* `nil`) - Optional. Default value of the attribute in User data mappings. If no default value is specified, it defaults to an empty value. This field is only applicable to attributes of the category `RESOURCE`.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Optional. A description of the attribute.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Identifier. Resource name of the Attribute definition, of the form `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/consentStores/{consent_store_id}/attributeDefinitions/{attribute_definition_id}`. Cannot be changed after creation.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :allowedValues => list(String.t()) | nil,
          :category => String.t() | nil,
          :consentDefaultValues => list(String.t()) | nil,
          :dataMappingDefaultValue => String.t() | nil,
          :description => String.t() | nil,
          :name => String.t() | nil
        }

  field(:allowedValues, type: :list)
  field(:category)
  field(:consentDefaultValues, type: :list)
  field(:dataMappingDefaultValue)
  field(:description)
  field(:name)
end

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

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