Exosphere.Community.Location.Address (Exosphere v0.3.0)

Copy Markdown View Source

A physical location in the form of a street address.

Object schema community.lexicon.location.address.

Fields

  • country: The ISO 3166 country code. Preferably the 2-letter code.
  • locality: The locality of the region. For example, a city in the USA.
  • name: The name of the location.
  • postal_code: The postal code of the location.
  • region: The administrative region of the country. For example, a state in the USA.
  • street: The street address.

Summary

Functions

Decode a wire-format map. Delegates to new/1.

Build and validate from a map of attrs (atom or wire string keys).

Build and validate, raising ArgumentError on error.

Encode to the wire-format map.

The lexicon type ID (nsid or nsid#def) this module was generated from.

Types

t()

@type t() :: %Exosphere.Community.Location.Address{
  country: String.t(),
  extra: term(),
  locality: String.t() | nil,
  name: String.t() | nil,
  postal_code: String.t() | nil,
  region: String.t() | nil,
  street: String.t() | nil
}

Functions

from_map(map)

@spec from_map(map()) ::
  {:ok, t()} | {:error, [{path :: String.t(), message :: String.t()}]}

Decode a wire-format map. Delegates to new/1.

new(attrs)

@spec new(map()) ::
  {:ok, t()} | {:error, [{path :: String.t(), message :: String.t()}]}

Build and validate from a map of attrs (atom or wire string keys).

Unknown keys are kept in extra and re-emitted by to_map/1.

new!(attrs)

@spec new!(map()) :: t()

Build and validate, raising ArgumentError on error.

to_map(struct)

@spec to_map(t()) :: map()

Encode to the wire-format map.

type_id()

@spec type_id() :: String.t()

The lexicon type ID (nsid or nsid#def) this module was generated from.