toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final json = <String, dynamic>{};
    json[r'_id'] = this.id;
    json[r'tenantId'] = this.tenantId;
    json[r'createdByUserId'] = this.createdByUserId;
    json[r'createdAt'] = this.createdAt.toUtc().toIso8601String();
    json[r'enabled'] = this.enabled;
  if (this.urlId != null) {
    json[r'urlId'] = this.urlId;
  } else {
    json[r'urlId'] = null;
  }
    json[r'type'] = this.type;
    json[r'threshold'] = this.threshold;
    json[r'uses'] = this.uses;
    json[r'name'] = this.name;
    json[r'description'] = this.description;
    json[r'displayLabel'] = this.displayLabel;
  if (this.displaySrc != null) {
    json[r'displaySrc'] = this.displaySrc;
  } else {
    json[r'displaySrc'] = null;
  }
  if (this.backgroundColor != null) {
    json[r'backgroundColor'] = this.backgroundColor;
  } else {
    json[r'backgroundColor'] = null;
  }
  if (this.borderColor != null) {
    json[r'borderColor'] = this.borderColor;
  } else {
    json[r'borderColor'] = null;
  }
  if (this.textColor != null) {
    json[r'textColor'] = this.textColor;
  } else {
    json[r'textColor'] = null;
  }
  if (this.cssClass != null) {
    json[r'cssClass'] = this.cssClass;
  } else {
    json[r'cssClass'] = null;
  }
  if (this.veteranUserThresholdMillis != null) {
    json[r'veteranUserThresholdMillis'] = this.veteranUserThresholdMillis;
  } else {
    json[r'veteranUserThresholdMillis'] = null;
  }
    json[r'isAwaitingReprocess'] = this.isAwaitingReprocess;
    json[r'isAwaitingDeletion'] = this.isAwaitingDeletion;
  if (this.replacesBadgeId != null) {
    json[r'replacesBadgeId'] = this.replacesBadgeId;
  } else {
    json[r'replacesBadgeId'] = null;
  }
  return json;
}