View Source Chargebeex.Resource behaviour (chargebeex v0.1.0)

Generic macro implemented by most of the Chargebee resources. Provides whenever it is possible retrieve/create/list/update/delete actions for each resource.

Link to this section Summary

Callbacks

Build a raw data map into in an internal structure.

Create a resource

Delete a resource

List a resource

Retrieve a resource

Update a resource

Link to this section Callbacks

@callback build(raw_data :: map()) :: struct()

Build a raw data map into in an internal structure.

Link to this callback

create(params)

View Source (optional)
@callback create(params :: map()) :: {:ok, struct()}

Create a resource

@callback delete(id :: String.t()) :: {:ok, struct()}

Delete a resource

@callback list(params :: map()) :: {:ok, list(), map()}

List a resource

@callback retrieve(id :: String.t()) :: {:ok, struct()}

Retrieve a resource

Link to this callback

update(id, params)

View Source (optional)
@callback update(id :: String.t(), params :: map()) :: {:ok, struct()}

Update a resource