# 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.Admin.Directory_v1.Model.BuildingAddress do
  @moduledoc """
  Public API: Resources.buildings

  ## Attributes

  *   `addressLines` (*type:* `list(String.t)`, *default:* `nil`) - Unstructured address lines describing the lower levels of an address.
  *   `administrativeArea` (*type:* `String.t`, *default:* `nil`) - Optional. Highest administrative subdivision which is used for postal addresses of a country or region.
  *   `languageCode` (*type:* `String.t`, *default:* `nil`) - Optional. BCP-47 language code of the contents of this address (if known).
  *   `locality` (*type:* `String.t`, *default:* `nil`) - Optional. Generally refers to the city/town portion of the address. Examples: US city, IT comune, UK post town. In regions of the world where localities are not well defined or do not fit into this structure well, leave locality empty and use addressLines.
  *   `postalCode` (*type:* `String.t`, *default:* `nil`) - Optional. Postal code of the address.
  *   `regionCode` (*type:* `String.t`, *default:* `nil`) - Required. CLDR region code of the country/region of the address.
  *   `sublocality` (*type:* `String.t`, *default:* `nil`) - Optional. Sublocality of the address.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :addressLines => list(String.t()) | nil,
          :administrativeArea => String.t() | nil,
          :languageCode => String.t() | nil,
          :locality => String.t() | nil,
          :postalCode => String.t() | nil,
          :regionCode => String.t() | nil,
          :sublocality => String.t() | nil
        }

  field(:addressLines, type: :list)
  field(:administrativeArea)
  field(:languageCode)
  field(:locality)
  field(:postalCode)
  field(:regionCode)
  field(:sublocality)
end

defimpl Poison.Decoder, for: GoogleApi.Admin.Directory_v1.Model.BuildingAddress do
  def decode(value, options) do
    GoogleApi.Admin.Directory_v1.Model.BuildingAddress.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Admin.Directory_v1.Model.BuildingAddress do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
