Serializes query maps to the API's bracket syntax, exactly as the Node SDK.
iex> Lettermint.Query.encode(%{page: %{size: 10}, filter: %{status: "verified"}, sort: ["-created_at"]})
"filter%5Bstatus%5D=verified&page%5Bsize%5D=10&sort=-created_at"- nested maps (or keyword lists) become bracketed names:
page[size]; - lists of values are joined with commas:
sort=-created_at,domain; - lists of maps are indexed:
filter[tags][0][name]=a; - booleans are
1or0;DateTime,NaiveDateTimeandDateare ISO 8601; nilvalues and empty lists are left out.
Keys of a map are sent in sorted order; keyword lists keep their order.
Names and values are form-encoded like URLSearchParams.
Summary
Functions
Encodes a query map. Raises Lettermint.ConfigError for values that cannot be sent.
Functions
Encodes a query map. Raises Lettermint.ConfigError for values that cannot be sent.