Chargebeex.EntitlementOverride (chargebeex v0.6.0)
View SourceStruct that represent a Chargebee's API entitlement override resource.
Summary
Types
A single entitlement override map.
"subscription"
Parameters for the upsert_or_remove
function.
The action
field must be either upsert
or remove
.
Functions
Upserts or removes a set of entitlement_overrides for a subscription depending on the action specified
Types
@type entitlement_override() :: %{ :feature_id => String.t(), optional(:value) => String.t(), optional(:expires_at) => non_neg_integer(), optional(:effective_from) => non_neg_integer() }
A single entitlement override map.
@type entity_type() :: String.t()
"subscription"
@type upsert_or_remove_params() :: %{ :action => :upsert | :remove, optional(:entitlement_overrides) => [entitlement_override()], optional(any()) => any() }
Parameters for the upsert_or_remove
function.
The action
field must be either upsert
or remove
.
Functions
@spec upsert_or_remove(String.t(), upsert_or_remove_params(), keyword()) :: any()
Upserts or removes a set of entitlement_overrides for a subscription depending on the action specified
Examples
iex(1)> subscription_id = "BTLybZUInBGCXDMY" "BTLybZUInBGCXDMY" iex(2)> params = %{ ...(2)> "action" => :upsert, ...(2)> "entitlement_overrides" => [ ...(2)> %{ ...(2)> "feature_id" => "foo", ...(2)> "value" => "false" ...(2)> } ...(2)> ] ...(2)> } %{
"action" => :upsert,
"entitlement_overrides" => [
%{"feature_id" => "foo", "value" => "false"}
]
} iex(3)> Chargebeex.EntitlementOverride.upsert_or_remove(subscription_id, params) {:ok, [
%Chargebeex.EntitlementOverride{...}
], %{"next_offset" => nil}}