toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() {
  var templateId = this.templateId;
  var originalTemplate = this.originalTemplate;
  var referencingBlueprint = this.referencingBlueprint;
  var name = this.name;
  var description = this.description;
  var space = this.space;
  var labels = this.labels;
  var templateType = this.templateType;
  var editorVersion = this.editorVersion;
  var body = this.body;
  var expandable = this.expandable;
  var links = this.links;

  final json = <String, Object?>{};
  json[r'templateId'] = templateId;
  if (originalTemplate != null) {
    json[r'originalTemplate'] = originalTemplate.toJson();
  }
  if (referencingBlueprint != null) {
    json[r'referencingBlueprint'] = referencingBlueprint;
  }
  json[r'name'] = name;
  json[r'description'] = description;
  if (space != null) {
    json[r'space'] = space;
  }
  json[r'labels'] = labels.map((i) => i.toJson()).toList();
  json[r'templateType'] = templateType;
  if (editorVersion != null) {
    json[r'editorVersion'] = editorVersion;
  }
  if (body != null) {
    json[r'body'] = body.toJson();
  }
  if (expandable != null) {
    json[r'_expandable'] = expandable.toJson();
  }
  json[r'_links'] = links.toJson();
  return json;
}