Generates the CRUD functions for one Exact Online resource.
Exact Online exposes around 600 resources. This library ships modules for a handful of them and gives you this macro for the rest, because a resource module is five lines:
defmodule MyApp.Exact.Item do
@moduledoc "See [Items](https://start.exactonline.nl/docs/HlpRestAPIResourcesDetails.aspx?name=LogisticsItems)."
use Exact.Resource, service: "logistics", resource: "Items"
end
MyApp.Exact.Item.list(client, select: ["ID", "Code", "Description"], top: 25)Options
:resource- required, the resource name as it appears in the URL:service- the service segment, omit for a resource that has none:key- the primary key field, defaults to"ID":key_type-:guid(default),:integeror:string. Decides how the key predicate in the URL is formatted:only- restrict the generated functions, for exampleonly: [:list, :stream, :get]for a read-only resource
Generated functions
list/2, stream/2, get/3, create/2, update/3, delete/2 and
path/0, each delegating to the matching Exact.Client function. Records
are plain maps keyed by the field names Exact Online uses; nothing is
renamed, so the reference documentation applies as written.
Summary
Functions
Formats a key predicate value.