toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() {
  var expand = this.expand;
  var id = this.id;
  var self = this.self;
  var key = this.key;
  var renderedFields = this.renderedFields;
  var properties = this.properties;
  var names = this.names;
  var schema = this.schema;
  var transitions = this.transitions;
  var operations = this.operations;
  var editmeta = this.editmeta;
  var changelog = this.changelog;
  var versionedRepresentations = this.versionedRepresentations;
  var fieldsToInclude = this.fieldsToInclude;
  var fields = this.fields;

  final json = <String, Object?>{};
  if (expand != null) {
    json[r'expand'] = expand;
  }
  if (id != null) {
    json[r'id'] = id;
  }
  if (self != null) {
    json[r'self'] = self;
  }
  if (key != null) {
    json[r'key'] = key;
  }
  if (renderedFields != null) {
    json[r'renderedFields'] = renderedFields;
  }
  if (properties != null) {
    json[r'properties'] = properties;
  }
  if (names != null) {
    json[r'names'] = names;
  }
  if (schema != null) {
    json[r'schema'] = schema;
  }
  json[r'transitions'] = transitions.map((i) => i.toJson()).toList();
  if (operations != null) {
    json[r'operations'] = operations.toJson();
  }
  if (editmeta != null) {
    json[r'editmeta'] = editmeta;
  }
  if (changelog != null) {
    json[r'changelog'] = changelog;
  }
  if (versionedRepresentations != null) {
    json[r'versionedRepresentations'] = versionedRepresentations;
  }
  if (fieldsToInclude != null) {
    json[r'fieldsToInclude'] = fieldsToInclude.toJson();
  }
  if (fields != null) {
    json[r'fields'] = fields;
  }
  return json;
}