Releasing v4.11.0 (#107)
* Releasing v4.11.0
* Refactor JsonUtil: serialize Timestamp/Date/Enum via Gson type adapters
Replace the hand-rolled `instanceof`-chain inside `toJsonElement(...)` with
a single static `Gson` instance configured via `GsonBuilder`:
- `Timestamp` → Unix-seconds JSON number (`JsonSerializer<Timestamp>`)
- `Date` → `yyyy-MM-dd` JSON string (`JsonSerializer<Date>`)
- `Enum` → lowercase `name()` string (`registerTypeHierarchyAdapter`)
`toJson(Map)` and `toJson(List)` now delegate to `GSON.toJson(...)`; Gson
natively walks nested maps, lists, and `Object[]` and dispatches each
value through the registered adapters via its `ObjectTypeAdapter`. The
builder also calls `disableHtmlEscaping()` and `serializeNulls()` to
preserve the prior behavior (`JsonElement.toString()` semantics and the
explicit `"key":null` shape).
No behavior change for the Chargebee API contract; the full JsonUtil and
PromotionalGrantsParams regression suites pass.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Fix JSON request body serialization and usage_timestamp precision
- Regenerate param classes with dedicated toJsonMap()/toJsonString() so
JSON content-type endpoints emit a proper nested structure instead of
reusing the form-url-encoded flattening (e.g. events[...][]) and
double-encoding nested objects.
- Change usage_timestamp on UsageEvent create and batch ingest from
Timestamp to Long (epoch milliseconds) to preserve the precision the
ingestion API requires.
- Update PromotionalGrantsParamsJsonTest to assert the nested-object JSON
body for metadata.
- Update CHANGELOG for v4.11.0 (release date and new bug-fix entries).
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>