toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() {
  var description = this.description;
  var id = this.id;
  var name = this.name;
  var scope = this.scope;
  var statusCategory = this.statusCategory;
  var statusReference = this.statusReference;
  var usages = this.usages;

  final json = <String, Object?>{};
  if (description != null) {
    json[r'description'] = description;
  }
  if (id != null) {
    json[r'id'] = id;
  }
  if (name != null) {
    json[r'name'] = name;
  }
  if (scope != null) {
    json[r'scope'] = scope.toJson();
  }
  if (statusCategory != null) {
    json[r'statusCategory'] = statusCategory.value;
  }
  if (statusReference != null) {
    json[r'statusReference'] = statusReference;
  }
  json[r'usages'] = usages.map((i) => i.toJson()).toList();
  return json;
}