toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() {
  final deviceKeys = this.deviceKeys;
  final failures = this.failures;
  final masterKeys = this.masterKeys;
  final selfSigningKeys = this.selfSigningKeys;
  final userSigningKeys = this.userSigningKeys;
  return {
    if (deviceKeys != null)
      'device_keys': deviceKeys.map(
          (k, v) => MapEntry(k, v.map((k, v) => MapEntry(k, v.toJson())))),
    if (failures != null) 'failures': failures.map((k, v) => MapEntry(k, v)),
    if (masterKeys != null)
      'master_keys': masterKeys.map((k, v) => MapEntry(k, v.toJson())),
    if (selfSigningKeys != null)
      'self_signing_keys':
          selfSigningKeys.map((k, v) => MapEntry(k, v.toJson())),
    if (userSigningKeys != null)
      'user_signing_keys':
          userSigningKeys.map((k, v) => MapEntry(k, v.toJson())),
  };
}