Codat.Accounting.DirectIncomes (codat v1.0.0)

Copy Markdown View Source

Read and write direct income transactions (income not associated with an invoice).

Summary

Functions

create(client_or_company_id, company_or_conn_id, conn_or_body, body_or_opts \\ %{})

@spec create(
  Codat.Client.t() | String.t(),
  String.t(),
  String.t() | map(),
  map() | keyword()
) ::
  {:ok, map()} | {:error, Codat.Error.t()}

Creates a new directIncomes (async). Returns a push operation.

fetch_all(client_or_company_id, company_id_or_opts \\ [], opts \\ [])

@spec fetch_all(Codat.Client.t() | String.t(), String.t() | keyword(), keyword()) ::
  {:ok, [map()]} | {:error, Codat.Error.t()}

Fetches all directIncomes across all pages concurrently.

get(client_or_company_id, company_or_resource_id, resource_id_or_opts \\ [])

@spec get(Codat.Client.t() | String.t(), String.t(), String.t() | keyword()) ::
  {:ok, map()} | {:error, Codat.Error.t()}

Fetches a single directIncomes by ID.

get_create_model(client_or_company_id, company_or_conn_id, opts \\ [])

@spec get_create_model(Codat.Client.t() | String.t(), String.t(), keyword()) ::
  {:ok, map()} | {:error, Codat.Error.t()}

Returns the push model for creating directIncomes.

list(client_or_company_id, company_id_or_opts \\ [], opts \\ [])

@spec list(Codat.Client.t() | String.t(), String.t() | keyword(), keyword()) ::
  {:ok, Codat.Pagination.t()} | {:error, Codat.Error.t()}

Returns a paginated list of directIncomes.

stream(client_or_company_id, company_id_or_opts \\ [], opts \\ [])

@spec stream(Codat.Client.t() | String.t(), String.t() | keyword(), keyword()) ::
  Enumerable.t()

Returns a lazy Stream of all results.