erpnext-api-client-0.2.0.0: Generic API client library for ERPNext
Safe HaskellSafe-Inferred
LanguageGHC2021

ERPNext.Client.QueryStringParams

Synopsis

Documentation

data QueryStringParam Source #

Constructors

Debug Bool

If True, makes API returning query analysis info instead of data

AsDict Bool

If False, makes API returning the data records as mixed-type arrays which cannot be parsed by this library (default: True)

LimitStart Int

Page offset (starts at 0)

LimitPageLength Int

Page size

Asc Fieldname

Ascending order by given field

Desc Fieldname

Descending order by given field

Fields [Fieldname]

Select fields

AndFilter [Filter]

Filter terms combined with logical AND

OrFilter [Filter]

Filter terms combined with logical OR

renderQueryStringParams :: [QueryStringParam] -> Text Source #

Render the query string for the URL.

>>> renderQueryStringParams []
""
>>> renderQueryStringParams [LimitStart 20, LimitPageLength 10]
"limit_start=20&limit=10"
>>> urlDecode $ renderQueryStringParams [Fields [pack "id", pack "name"], Asc (pack "idx")]
"fields=[\"id\",\"name\"]&order_by=idx asc"