toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() {
  var type = this.type;
  var username = this.username;
  var userKey = this.userKey;
  var accountId = this.accountId;
  var accountType = this.accountType;
  var email = this.email;
  var publicName = this.publicName;
  var profilePicture = this.profilePicture;
  var displayName = this.displayName;
  var timeZone = this.timeZone;
  var isExternalCollaborator = this.isExternalCollaborator;
  var operations = this.operations;
  var details = this.details;
  var personalSpace = this.personalSpace;
  var expandable = this.expandable;
  var links = this.links;

  final json = <String, Object?>{};
  json[r'type'] = type.value;
  if (username != null) {
    json[r'username'] = username;
  }
  if (userKey != null) {
    json[r'userKey'] = userKey;
  }
  json[r'accountId'] = accountId;
  json[r'accountType'] = accountType;
  json[r'email'] = email;
  json[r'publicName'] = publicName;
  json[r'profilePicture'] = profilePicture.toJson();
  json[r'displayName'] = displayName;
  if (timeZone != null) {
    json[r'timeZone'] = timeZone;
  }
  json[r'isExternalCollaborator'] = isExternalCollaborator;
  json[r'operations'] = operations.map((i) => i.toJson()).toList();
  if (details != null) {
    json[r'details'] = details.toJson();
  }
  if (personalSpace != null) {
    json[r'personalSpace'] = personalSpace.toJson();
  }
  json[r'_expandable'] = expandable.toJson();
  json[r'_links'] = links.toJson();
  return json;
}