lib/google_api/document_ai/v1beta3/model/google_cloud_documentai_v1beta2_document_entity_normalized_value.ex

# 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.DocumentAI.V1beta3.Model.GoogleCloudDocumentaiV1beta2DocumentEntityNormalizedValue do
  @moduledoc """
  Parsed and normalized entity value.

  ## Attributes

  *   `addressValue` (*type:* `GoogleApi.DocumentAI.V1beta3.Model.GoogleTypePostalAddress.t`, *default:* `nil`) - Postal address. See also: https://github.com/googleapis/googleapis/blob/master/google/type/postal_address.proto
  *   `booleanValue` (*type:* `boolean()`, *default:* `nil`) - Boolean value. Can be used for entities with binary values, or for checkboxes.
  *   `dateValue` (*type:* `GoogleApi.DocumentAI.V1beta3.Model.GoogleTypeDate.t`, *default:* `nil`) - Date value. Includes year, month, day. See also: https://github.com/googleapis/googleapis/blob/master/google/type/date.proto
  *   `datetimeValue` (*type:* `GoogleApi.DocumentAI.V1beta3.Model.GoogleTypeDateTime.t`, *default:* `nil`) - DateTime value. Includes date, time, and timezone. See also: https://github.com/googleapis/googleapis/blob/master/google/type/datetime.proto
  *   `floatValue` (*type:* `number()`, *default:* `nil`) - Float value.
  *   `integerValue` (*type:* `integer()`, *default:* `nil`) - Integer value.
  *   `moneyValue` (*type:* `GoogleApi.DocumentAI.V1beta3.Model.GoogleTypeMoney.t`, *default:* `nil`) - Money value. See also: https://github.com/googleapis/googleapis/blob/master/google/type/money.proto
  *   `text` (*type:* `String.t`, *default:* `nil`) - Optional. An optional field to store a normalized string. For some entity types, one of respective `structured_value` fields may also be populated. Also not all the types of `structured_value` will be normalized. For example, some processors may not generate float or int normalized text by default. Below are sample formats mapped to structured values. - Money/Currency type (`money_value`) is in the ISO 4217 text format. - Date type (`date_value`) is in the ISO 8601 text format. - Datetime type (`datetime_value`) is in the ISO 8601 text format.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :addressValue => GoogleApi.DocumentAI.V1beta3.Model.GoogleTypePostalAddress.t() | nil,
          :booleanValue => boolean() | nil,
          :dateValue => GoogleApi.DocumentAI.V1beta3.Model.GoogleTypeDate.t() | nil,
          :datetimeValue => GoogleApi.DocumentAI.V1beta3.Model.GoogleTypeDateTime.t() | nil,
          :floatValue => number() | nil,
          :integerValue => integer() | nil,
          :moneyValue => GoogleApi.DocumentAI.V1beta3.Model.GoogleTypeMoney.t() | nil,
          :text => String.t() | nil
        }

  field(:addressValue, as: GoogleApi.DocumentAI.V1beta3.Model.GoogleTypePostalAddress)
  field(:booleanValue)
  field(:dateValue, as: GoogleApi.DocumentAI.V1beta3.Model.GoogleTypeDate)
  field(:datetimeValue, as: GoogleApi.DocumentAI.V1beta3.Model.GoogleTypeDateTime)
  field(:floatValue)
  field(:integerValue)
  field(:moneyValue, as: GoogleApi.DocumentAI.V1beta3.Model.GoogleTypeMoney)
  field(:text)
end

defimpl Poison.Decoder,
  for:
    GoogleApi.DocumentAI.V1beta3.Model.GoogleCloudDocumentaiV1beta2DocumentEntityNormalizedValue do
  def decode(value, options) do
    GoogleApi.DocumentAI.V1beta3.Model.GoogleCloudDocumentaiV1beta2DocumentEntityNormalizedValue.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for:
    GoogleApi.DocumentAI.V1beta3.Model.GoogleCloudDocumentaiV1beta2DocumentEntityNormalizedValue do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end