toJson method
Serializes the public credential representation.
Implementation
Map<String, Object?> toJson() => <String, Object?>{
'id': id,
'connectionId': connectionId,
'name': name,
'keyPrefix': keyPrefix,
'scopes': scopes.map((value) => value.name).toList(growable: false),
'active': active,
'createdAt': createdAt.toUtc().toIso8601String(),
'updatedAt': updatedAt.toUtc().toIso8601String(),
if (expiresAt != null) 'expiresAt': expiresAt!.toUtc().toIso8601String(),
if (lastUsedAt != null) 'lastUsedAt': lastUsedAt!.toUtc().toIso8601String(),
if (revokedAt != null) 'revokedAt': revokedAt!.toUtc().toIso8601String(),
};