smart_city_registry v3.2.2 SmartCity.Dataset.Metadata View Source
A struct defining internal metadata on a registry event message.
Link to this section Summary
Functions
Returns a new SmartCity.Dataset.Metadata struct.
Can be created from Map with string or atom keys.
Raises an ArgumentError when passed invalid input.
Link to this section Types
Link to this section Functions
Link to this function
new(msg)
View Source
new(msg)
View Source
new(map()) :: SmartCity.Dataset.Metadata.t()
new(map()) :: SmartCity.Dataset.Metadata.t()
Returns a new SmartCity.Dataset.Metadata struct.
Can be created from Map with string or atom keys.
Raises an ArgumentError when passed invalid input.
Parameters
- msg: Map with string or atom keys that defines the dataset's metadata.
Examples
iex> SmartCity.Dataset.Metadata.new(%{"intendedUse" => ["a","b","c"], "expectedBenefit" => [1,2,3]})
%SmartCity.Dataset.Metadata{
expectedBenefit: [1, 2, 3],
intendedUse: ["a", "b", "c"]
}
iex> SmartCity.Dataset.Metadata.new(%{:intendedUse => ["a","b","c"], :expectedBenefit => [1,2,3]})
%SmartCity.Dataset.Metadata{
expectedBenefit: [1, 2, 3],
intendedUse: ["a", "b", "c"]
}
iex> SmartCity.Dataset.Metadata.new("Not a map")
** (ArgumentError) Invalid internal metadata: "Not a map"