Codat.API (codat v1.0.0)

Copy Markdown View Source

The use Codat.API macro that powers all Codat resource modules.

Generates standard CRUD, pagination, streaming, and write-model functions.

Usage

defmodule Codat.Accounting.Invoices do
  use Codat.API,
    base_path:  "/companies/:company_id/connections/:connection_id/push/invoices",
    list_path:  "/companies/:company_id/data/invoices",
    data_type:  "invoices",
    supports:   [:list, :get, :create, :update, :delete,
                 :get_create_model, :get_update_model, :stream, :fetch_all]
end

Summary

Types

page_response()

@type page_response() :: {:ok, Codat.Pagination.t()} | {:error, Codat.Error.t()}

response()

@type response() :: {:ok, map() | list() | nil} | {:error, Codat.Error.t()}