decodeQuery static method

ReleaseQuery decodeQuery(
  1. Map<String, dynamic> json
)

Decodes a ReleaseQuery from an RPC payload.

Implementation

static ReleaseQuery decodeQuery(Map<String, dynamic> json) {
  final channel = Json.optString(json, 'channel');
  final acceptedBy = Json.optString(json, 'acceptedBy');
  return ReleaseQuery(
    channel: channel == null ? null : ReleaseChannel.parse(channel),
    acceptedBy: acceptedBy == null ? null : ReleaseChannel.parse(acceptedBy),
    includeDrafts: Json.optBool(json, 'includeDrafts'),
    includeYanked: Json.optBool(json, 'includeYanked'),
    includeUnpublished: Json.optBool(json, 'includeUnpublished'),
    limit: Json.optInt(json, 'limit'),
    offset: Json.optInt(json, 'offset', 0)!,
  );
}