View Source Chargebeex.Usage (chargebeex v0.5.0)

Struct that represent a Chargebee's API usage resource.

Summary

Types

"admin_console" | "api" | "bulk_operation"

t()

Types

@type source() :: String.t()

"admin_console" | "api" | "bulk_operation"

@type t() :: %Chargebeex.Usage{
  created_at: non_neg_integer() | nil,
  id: String.t() | nil,
  invoice_id: String.t() | nil,
  item_price_id: String.t() | nil,
  line_item_id: String.t() | nil,
  note: String.t() | nil,
  quantity: String.t() | nil,
  resource_version: String.t() | nil,
  source: source() | nil,
  subscription_id: String.t() | nil,
  updated_at: non_neg_integer() | nil,
  usage_date: String.t() | nil
}

Functions

Link to this function

build(map_or_kwlist, opts \\ [])

View Source
@spec build(ExConstructor.map_or_kwlist(), Keyword.t()) :: %Chargebeex.Usage{
  created_at: term(),
  id: term(),
  invoice_id: term(),
  item_price_id: term(),
  line_item_id: term(),
  note: term(),
  quantity: term(),
  resource_version: term(),
  source: term(),
  subscription_id: term(),
  updated_at: term(),
  usage_date: term()
}
Link to this function

create(subscription_id, params, opts \\ [])

View Source

Allows to create a Usage

Examples

iex> Chargebeex.Usage.create("e49e39cf-a406-4cc9-b14a-85476b3c3ebf", %{item_price_id: "item_eur_monthly", quantity: 42, usage_date: 1599817250})
  {:ok, %Chargebeex.Usage{}}
Link to this function

delete(subscription_id, params, opts \\ [])

View Source

Allows to delete a Usage

Examples

iex> Chargebeex.Usage.delete("e49e39cf-a406-4cc9-b14a-85476b3c3ebf", %{id: "a065d78c-a5a8-458b-85b6-e9295118d3bf"})
  {:ok, %Chargebeex.Usage{}}
Link to this function

list(params \\ %{}, opts \\ [])

View Source

Callback implementation for Chargebeex.Resource.list/2.

Link to this function

retrieve(subscription_id, params, opts \\ [])

View Source

Allows to retrieve a Usage

Examples

iex> Chargebeex.Usage.retrieve("e49e39cf-a406-4cc9-b14a-85476b3c3ebf", %{id: "a065d78c-a5a8-458b-85b6-e9295118d3bf"})
  {:ok, %Chargebeex.Usage{}}