View Source Astarte.Core.Triggers.Policy (astarte_core v1.2.0)

Summary

Functions

Creates a Policy from a PolicyProto. Returns {:ok, %Policy{}} on success, {:error, :invalid_policy_data} on failure

Creates a Policy from a PolicyProto.

Creates a PolicyProto from a Policy.

Functions

Link to this function

changeset(policy, params \\ %{})

View Source
Link to this function

from_policy_proto(policy_proto)

View Source

Creates a Policy from a PolicyProto. Returns {:ok, %Policy{}} on success, {:error, :invalid_policy_data} on failure

Link to this function

from_policy_proto!(policy_proto)

View Source

Creates a Policy from a PolicyProto.

Returns the %Policy{} on success, raises on failure

Creates a PolicyProto from a Policy.

It is assumed that the Policy is valid and constructed using Policy.changeset

Returns a %PolicyProto{}