toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() {
  var id = this.id;
  var key = this.key;
  var name = this.name;
  var icon = this.icon;
  var description = this.description;
  var homepage = this.homepage;
  var type = this.type;
  var metadata = this.metadata;
  var operations = this.operations;
  var permissions = this.permissions;
  var status = this.status;
  var settings = this.settings;
  var theme = this.theme;
  var lookAndFeel = this.lookAndFeel;
  var history = this.history;
  var expandable = this.expandable;
  var links = this.links;

  final json = <String, Object?>{};
  if (id != null) {
    json[r'id'] = id;
  }
  json[r'key'] = key;
  json[r'name'] = name;
  if (icon != null) {
    json[r'icon'] = icon.toJson();
  }
  if (description != null) {
    json[r'description'] = description.toJson();
  }
  if (homepage != null) {
    json[r'homepage'] = homepage.toJson();
  }
  json[r'type'] = type;
  if (metadata != null) {
    json[r'metadata'] = metadata.toJson();
  }
  json[r'operations'] = operations.map((i) => i.toJson()).toList();
  json[r'permissions'] = permissions.map((i) => i.toJson()).toList();
  json[r'status'] = status;
  if (settings != null) {
    json[r'settings'] = settings.toJson();
  }
  if (theme != null) {
    json[r'theme'] = theme.toJson();
  }
  if (lookAndFeel != null) {
    json[r'lookAndFeel'] = lookAndFeel.toJson();
  }
  if (history != null) {
    json[r'history'] = history.toJson();
  }
  json[r'_expandable'] = expandable.toJson();
  json[r'_links'] = links.toJson();
  return json;
}