toJson method

Map<String, dynamic> toJson()

Converts this object to a JSON-compatible Map.

Implementation

Map<String, dynamic> toJson() {
  return {
    'name': name,
    if (projectId != null) 'sub': projectId,
    if (apiKeyId != null) 'kid': apiKeyId,
    'grants': grants.map((g) => g.toJson()).toList(),
  };
}