View Source ExTier.Api.Subscribe (ex_tier v0.11.1)
Link to this section Summary
Functions
Subscribe an organization to a plan or a set of features
Link to this section Types
@type subscribe_features_info() :: %{ :org => String.t(), optional(:features) => ExTier.Phase.features() | [ExTier.Phase.features()], optional(:effective) => DateTime.t(), optional(:trial) => boolean(), info: ExTier.OrgInfo.t() }
@type subscribe_features_params() :: %{ :org => String.t(), :features => ExTier.Phase.features() | [ExTier.Phase.features()], :effective => DateTime.t(), optional(:trial) => boolean(), optional(:info) => ExTier.OrgInfo.t() }
@type subscribe_params() :: subscribe_features_params() | subscribe_features_info() | subscribe_phases_params() | subscribe_phases_info()
@type subscribe_phases_info() :: %{ :org => String.t(), optional(:phases) => ExTier.Phase.t() | [ExTier.Phase.t()], info: ExTier.OrgInfo.t() }
@type subscribe_phases_params() :: %{ :org => String.t(), :phases => ExTier.Phase.t() | [ExTier.Phase.t()], optional(:info) => ExTier.OrgInfo.t() }
Link to this section Functions
@spec subscribe(subscribe_params()) :: :ok | {:error, ExTier.Error.t()}
Subscribe an organization to a plan or a set of features
:ok = ExTier.schedule(%{org: "org:org_id", features: ["plan:my_plan@0"]})
:ok = ExTier.schedule(%{org: "org:org_id", features: ["feature:feature@plan:my_plan@0"]})
:ok = ExTier.schedule(%{org: "org:org_id", info: %{email: "org@example.com"}})