toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() {
  var value = this.value;
  var representation = this.representation;
  var renderTaskId = this.renderTaskId;
  var error = this.error;
  var status = this.status;
  var embeddedContent = this.embeddedContent;
  var webresource = this.webresource;
  var mediaToken = this.mediaToken;
  var expandable = this.expandable;
  var links = this.links;

  final json = <String, Object?>{};
  if (value != null) {
    json[r'value'] = value;
  }
  if (representation != null) {
    json[r'representation'] = representation.value;
  }
  if (renderTaskId != null) {
    json[r'renderTaskId'] = renderTaskId;
  }
  if (error != null) {
    json[r'error'] = error;
  }
  if (status != null) {
    json[r'status'] = status.value;
  }
  json[r'embeddedContent'] = embeddedContent.map((i) => i.toJson()).toList();
  if (webresource != null) {
    json[r'webresource'] = webresource.toJson();
  }
  if (mediaToken != null) {
    json[r'mediaToken'] = mediaToken.toJson();
  }
  if (expandable != null) {
    json[r'_expandable'] = expandable.toJson();
  }
  if (links != null) {
    json[r'_links'] = links.toJson();
  }
  return json;
}