toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() {
  var id = this.id;
  var key = this.key;
  var name = this.name;
  var type = this.type;
  var status = this.status;
  var createdAt = this.createdAt;
  var homepageId = this.homepageId;
  var description = this.description;
  var icon = this.icon;

  final json = <String, Object?>{};
  if (id != null) {
    json[r'id'] = id;
  }
  if (key != null) {
    json[r'key'] = key;
  }
  if (name != null) {
    json[r'name'] = name;
  }
  if (type != null) {
    json[r'type'] = type;
  }
  if (status != null) {
    json[r'status'] = status;
  }
  if (createdAt != null) {
    json[r'createdAt'] = createdAt.toIso8601String();
  }
  if (homepageId != null) {
    json[r'homepageId'] = homepageId;
  }
  if (description != null) {
    json[r'description'] = description.toJson();
  }
  if (icon != null) {
    json[r'icon'] = icon.toJson();
  }
  return json;
}