ExQuickbooks.Request (ex_quickbooks v0.9.0)

Copy Markdown View Source

Shared request builders for QuickBooks company-scoped endpoints.

Request helpers return a struct that the shared HTTP pipeline can execute with ExQuickbooks.request/2.

Summary

Functions

Builds a /v3/company/:realm_id/... path and appends query parameters.

Builds the company-scoped URL path for a request struct.

Builds a POST create request for a company-scoped entity endpoint.

Builds a GET request for a company-scoped entity endpoint.

Builds a POST operation request, such as void or delete.

Builds a POST query request with a plain-text QuickBooks query statement.

Builds a POST update request with operation=update.

Types

body_format()

@type body_format() :: :json | :text

method()

@type method() :: :get | :post

path_segment()

@type path_segment() :: String.t() | atom() | integer()

response_path()

@type response_path() :: [String.t()] | nil

t()

@type t() :: %ExQuickbooks.Request{
  body: map() | String.t() | nil,
  body_format: body_format(),
  headers: [{String.t(), String.t()}],
  method: method(),
  path_segments: [path_segment()],
  query: keyword(),
  response_path: response_path()
}

Functions

cdc(entity_names, changed_since, options \\ [])

@spec cdc([String.t() | atom()] | String.t(), DateTime.t() | String.t(), keyword()) ::
  t()

Builds a POST CDC request.

company_path(client, path_segments, options \\ [])

@spec company_path(
  ExQuickbooks.Client.t(),
  [path_segment()] | path_segment(),
  keyword()
) :: String.t()

Builds a /v3/company/:realm_id/... path and appends query parameters.

company_url_path(client, request)

@spec company_url_path(ExQuickbooks.Client.t(), t()) :: String.t()

Builds the company-scoped URL path for a request struct.

create(path_segments, body, options \\ [])

@spec create([path_segment()] | path_segment(), map(), keyword()) :: t()

Builds a POST create request for a company-scoped entity endpoint.

get(path_segments, options \\ [])

@spec get(
  [path_segment()] | path_segment(),
  keyword()
) :: t()

Builds a GET request for a company-scoped entity endpoint.

operation(path_segments, operation_name, body, options \\ [])

@spec operation(
  [path_segment()] | path_segment(),
  String.t() | atom(),
  map(),
  keyword()
) :: t()

Builds a POST operation request, such as void or delete.

query(statement, options \\ [])

@spec query(
  String.t(),
  keyword()
) :: t()

Builds a POST query request with a plain-text QuickBooks query statement.

update(path_segments, body, options \\ [])

@spec update([path_segment()] | path_segment(), map(), keyword()) :: t()

Builds a POST update request with operation=update.