Map<String, Object?> toJson() { var type = this.type; final json = <String, Object?>{}; if (type != null) { json[r'type'] = type.value; } return json; }