toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() {
  var boardFeature = this.boardFeature;
  var boardId = this.boardId;
  var state = this.state;
  var localisedName = this.localisedName;
  var localisedDescription = this.localisedDescription;
  var learnMoreLink = this.learnMoreLink;
  var imageUri = this.imageUri;
  var featureType = this.featureType;
  var localisedGroup = this.localisedGroup;
  var permissibleEstimationTypes = this.permissibleEstimationTypes;
  var featureId = this.featureId;
  var learnMoreArticleId = this.learnMoreArticleId;
  var toggleLocked = this.toggleLocked;

  final json = <String, Object?>{};
  if (boardFeature != null) {
    json[r'boardFeature'] = boardFeature.value;
  }
  if (boardId != null) {
    json[r'boardId'] = boardId;
  }
  if (state != null) {
    json[r'state'] = state.value;
  }
  if (localisedName != null) {
    json[r'localisedName'] = localisedName;
  }
  if (localisedDescription != null) {
    json[r'localisedDescription'] = localisedDescription;
  }
  if (learnMoreLink != null) {
    json[r'learnMoreLink'] = learnMoreLink;
  }
  if (imageUri != null) {
    json[r'imageUri'] = imageUri;
  }
  if (featureType != null) {
    json[r'featureType'] = featureType.value;
  }
  if (localisedGroup != null) {
    json[r'localisedGroup'] = localisedGroup;
  }
  json[r'permissibleEstimationTypes'] =
      permissibleEstimationTypes.map((i) => i.toJson()).toList();
  if (featureId != null) {
    json[r'featureId'] = featureId;
  }
  if (learnMoreArticleId != null) {
    json[r'learnMoreArticleId'] = learnMoreArticleId;
  }
  json[r'toggleLocked'] = toggleLocked;
  return json;
}