AutoApi.TelematicsPermissions (auto_api v13.2.0) View Source
Utility module for handling AutoApi telematics permissions.
Link to this section Summary
Functions
Extracts only the capabilities granted from the given set of permissions.
Returns list of available permissions iex> "home_charger.set.wi_fi_hotspot_password" in AutoApi.TelematicsPermissions.permissions_list() true iex> "home_charger.get.wi_fi_hotspot_password" in AutoApi.TelematicsPermissions.permissions_list() true
Converts a permissions format string to property id
Verifies that all permissions are valid car permissions
Link to this section Functions
Specs
capabilities([String.t()]) :: [AutoApi.Capability.t()] | no_return()
Extracts only the capabilities granted from the given set of permissions.
Raises ArgumentError if one of the permissions is invalid.
Examples
iex> AutoApi.TelematicsPermissions.capabilities ["race.set.accelerations", "usage.get.average_weekly_distance_long_run", "race.get.gear_mode"] [AutoApi.RaceCapability, AutoApi.UsageCapability]
iex> AutoApi.TelematicsPermissions.capabilities ["charging.get.status", "i.dont.exist"] ** (ArgumentError) non existing properties: ["i.dont.exist"]
Specs
permissions_list() :: list()
Returns list of available permissions iex> "home_charger.set.wi_fi_hotspot_password" in AutoApi.TelematicsPermissions.permissions_list() true iex> "home_charger.get.wi_fi_hotspot_password" in AutoApi.TelematicsPermissions.permissions_list() true
Specs
Converts a permissions format string to property id
iex> AutoApi.TelematicsPermissions.to_spec("race.get.accelerations") {:ok, %{id: 1, type: :property}}
iex> AutoApi.TelematicsPermissions.to_spec("i.dont.exist") :error
Specs
Verifies that all permissions are valid car permissions
Examples
iex> AutoApi.TelematicsPermissions.verify ["race.set.accelerations", "usage.get.average_weekly_distance_long_run"] true
iex> AutoApi.TelematicsPermissions.verify ["charge.read", "i.dont.exist"] false