toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() {
  var description = this.description;
  var id = this.id;
  var isEditable = this.isEditable;
  var name = this.name;
  var scope = this.scope;
  var startPointLayout = this.startPointLayout;
  var statuses = this.statuses;
  var taskId = this.taskId;
  var transitions = this.transitions;
  var usages = this.usages;
  var version = this.version;

  final json = <String, Object?>{};
  if (description != null) {
    json[r'description'] = description;
  }
  if (id != null) {
    json[r'id'] = id;
  }
  json[r'isEditable'] = isEditable;
  if (name != null) {
    json[r'name'] = name;
  }
  if (scope != null) {
    json[r'scope'] = scope.toJson();
  }
  if (startPointLayout != null) {
    json[r'startPointLayout'] = startPointLayout.toJson();
  }
  json[r'statuses'] = statuses.map((i) => i.toJson()).toList();
  if (taskId != null) {
    json[r'taskId'] = taskId;
  }
  json[r'transitions'] = transitions.map((i) => i.toJson()).toList();
  json[r'usages'] = usages.map((i) => i.toJson()).toList();
  if (version != null) {
    json[r'version'] = version.toJson();
  }
  return json;
}