Sdk

Responses & Gates

Understanding RestApiResponse and gates parsing.

Responses & Gates

All calls return RestApiResponse<T>:

  • statusCode: HTTP status
  • body: raw decoded JSON
  • data: parsed payload (typed)
  • message: server message when available

Gates

Gate values can be returned as:

  • true / false
  • { "allowed": true, "message": "..." }

The SDK parses both formats with GateValue.fromJson(...).

Use allowed and message in the UI:

if (!item.gates.canUpdate) {
  showError(item.gates.updateMessage ?? 'Not allowed');
}