toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final json = <String, dynamic>{};
  json[r'id'] = id;
  if (rev != null) {
    json[r'rev'] = rev;
  }
  if (deletionDate != null) {
    json[r'deletionDate'] = deletionDate;
  }
  if (created != null) {
    json[r'created'] = created;
  }
  if (name != null) {
    json[r'name'] = name;
  }
  json[r'properties'] = properties.toList();
  json[r'permissions'] = permissions.toList();
  json[r'roles'] = roles.toList();
  if (type != null) {
    json[r'type'] = type;
  }
  if (status != null) {
    json[r'status'] = status;
  }
  if (login != null) {
    json[r'login'] = login;
  }
  if (passwordHash != null) {
    json[r'passwordHash'] = passwordHash;
  }
  if (secret != null) {
    json[r'secret'] = secret;
  }
  if (use2fa != null) {
    json[r'use2fa'] = use2fa;
  }
  if (groupId != null) {
    json[r'groupId'] = groupId;
  }
  if (healthcarePartyId != null) {
    json[r'healthcarePartyId'] = healthcarePartyId;
  }
  if (patientId != null) {
    json[r'patientId'] = patientId;
  }
  if (deviceId != null) {
    json[r'deviceId'] = deviceId;
  }
  json[r'autoDelegations'] = autoDelegations.map((k, v) => MapEntry(k, v.toList()));
  if (createdDate != null) {
    json[r'createdDate'] = createdDate!.millisecondsSinceEpoch;
  }
  if (termsOfUseDate != null) {
    json[r'termsOfUseDate'] = termsOfUseDate!.toUtc().toIso8601String();
  }
  if (email != null) {
    json[r'email'] = email;
  }
  if (mobilePhone != null) {
    json[r'mobilePhone'] = mobilePhone;
  }
  json[r'applicationTokens'] = applicationTokens;
  json[r'authenticationTokens'] = authenticationTokens;
  return json;
}