Map<String, dynamic> toMap() { return { 'config': config?.toMap(), 'scopes': scopes.map((e) => e.name).toList(), }; }