class GenericRespModel { GenericRespModel({ this.data, this.messageStatus, this.totalItemsCount, }); dynamic data; int? messageStatus; int? totalItemsCount; factory GenericRespModel.fromJson(Map json) => GenericRespModel( data: json["data"], messageStatus: json["messageStatus"], totalItemsCount: json["totalItemsCount"], ); Map toJson() => { "data": data, "messageStatus": messageStatus, "totalItemsCount": totalItemsCount, }; } var json = { "ads": { "id": 0, "adsDurationID": 1, "startDate": "2023-04-12T10:10:20.905Z", "countryId": 1, "specialServiceIDs": [ ], "isMCHandled": false }, "vehiclePosting": { "id": 0, "userID": "1A1597B3-D5A0-433A-098B-08DB189E51EC", "vehicleType": 1, "vehicleModelID": 1, "vehicleModelYearID": 1, "vehicleColorID": 2, "vehicleCategoryID": 1, "vehicleConditionID": 1, "vehicleMileageID": 1, "vehicleTransmissionID": 1, "vehicleSellerTypeID": 1, "cityID": 1, "price": 33, "vehicleVIN": "fdfd", "vehicleDescription": "dsd", "vehicleTitle": "fsfs", "vehicleDescriptionN": "dsdds", "isFinanceAvailable": true, "warantyYears": 2, "demandAmount": 34, "adStatus": 1, "vehiclePostingImages": [ { "id": 0, "imageName": "onon", "imageUrl": "string", "imageStr": null, "vehiclePostingID": 0, "vehiclePosting": null } ], "vehiclePostingDamageParts": [ { "id": 0, "comment": "hhsa", "vehicleImageBase64": null, "vehicleDamagePartID": 1, "vehiclePostingID": 0, "isActive": true } ] } }; class AdsCreationPayloadModel { Ads? ads; VehiclePosting? vehiclePosting; AdsCreationPayloadModel({this.ads, this.vehiclePosting}); AdsCreationPayloadModel.fromJson(Map json) { ads = json['ads'] != null ? Ads.fromJson(json['ads']) : null; vehiclePosting = json['vehiclePosting'] != null ? VehiclePosting.fromJson(json['vehiclePosting']) : null; } Map toJson() { final Map data = {}; if (ads != null) { data['ads'] = ads!.toJson(); } if (vehiclePosting != null) { data['vehiclePosting'] = vehiclePosting!.toJson(); } return data; } } class Ads { int? id; int? adsDurationID; String? startDate; int? countryId; List? specialServiceIDs; bool? isMCHandled; Ads( {this.id, this.adsDurationID, this.startDate, this.countryId, this.specialServiceIDs, this.isMCHandled}); Ads.fromJson(Map json) { id = json['id']; adsDurationID = json['adsDurationID']; startDate = json['startDate']; countryId = json['countryId']; specialServiceIDs = json['specialServiceIDs'].cast(); isMCHandled = json['isMCHandled']; } Map toJson() { final Map data = {}; data['id'] = id; data['adsDurationID'] = adsDurationID; data['startDate'] = startDate; data['countryId'] = countryId; data['specialServiceIDs'] = specialServiceIDs; data['isMCHandled'] = isMCHandled; return data; } } class VehiclePosting { int? id; String? userID; int? vehicleType; int? vehicleModelID; int? vehicleModelYearID; int? vehicleColorID; int? vehicleCategoryID; int? vehicleConditionID; int? vehicleMileageID; int? vehicleTransmissionID; int? vehicleSellerTypeID; int? cityID; int? price; String? vehicleVIN; String? vehicleDescription; String? vehicleTitle; String? vehicleDescriptionN; bool? isFinanceAvailable; int? warantyYears; int? demandAmount; int? adStatus; List? vehiclePostingImages; List? vehiclePostingDamageParts; VehiclePosting( {this.id, this.userID, this.vehicleType, this.vehicleModelID, this.vehicleModelYearID, this.vehicleColorID, this.vehicleCategoryID, this.vehicleConditionID, this.vehicleMileageID, this.vehicleTransmissionID, this.vehicleSellerTypeID, this.cityID, this.price, this.vehicleVIN, this.vehicleDescription, this.vehicleTitle, this.vehicleDescriptionN, this.isFinanceAvailable, this.warantyYears, this.demandAmount, this.adStatus, this.vehiclePostingImages, this.vehiclePostingDamageParts}); VehiclePosting.fromJson(Map json) { id = json['id']; userID = json['userID']; vehicleType = json['vehicleType']; vehicleModelID = json['vehicleModelID']; vehicleModelYearID = json['vehicleModelYearID']; vehicleColorID = json['vehicleColorID']; vehicleCategoryID = json['vehicleCategoryID']; vehicleConditionID = json['vehicleConditionID']; vehicleMileageID = json['vehicleMileageID']; vehicleTransmissionID = json['vehicleTransmissionID']; vehicleSellerTypeID = json['vehicleSellerTypeID']; cityID = json['cityID']; price = json['price']; vehicleVIN = json['vehicleVIN']; vehicleDescription = json['vehicleDescription']; vehicleTitle = json['vehicleTitle']; vehicleDescriptionN = json['vehicleDescriptionN']; isFinanceAvailable = json['isFinanceAvailable']; warantyYears = json['warantyYears']; demandAmount = json['demandAmount']; adStatus = json['adStatus']; if (json['vehiclePostingImages'] != null) { vehiclePostingImages = []; json['vehiclePostingImages'].forEach((v) { vehiclePostingImages!.add(VehiclePostingImages.fromJson(v)); }); } if (json['vehiclePostingDamageParts'] != null) { vehiclePostingDamageParts = []; json['vehiclePostingDamageParts'].forEach((v) { vehiclePostingDamageParts! .add(VehiclePostingDamageParts.fromJson(v)); }); } } Map toJson() { final Map data = {}; data['id'] = id; data['userID'] = userID; data['vehicleType'] = vehicleType; data['vehicleModelID'] = vehicleModelID; data['vehicleModelYearID'] = vehicleModelYearID; data['vehicleColorID'] = vehicleColorID; data['vehicleCategoryID'] = vehicleCategoryID; data['vehicleConditionID'] = vehicleConditionID; data['vehicleMileageID'] = vehicleMileageID; data['vehicleTransmissionID'] = vehicleTransmissionID; data['vehicleSellerTypeID'] = vehicleSellerTypeID; data['cityID'] = cityID; data['price'] = price; data['vehicleVIN'] = vehicleVIN; data['vehicleDescription'] = vehicleDescription; data['vehicleTitle'] = vehicleTitle; data['vehicleDescriptionN'] = vehicleDescriptionN; data['isFinanceAvailable'] = isFinanceAvailable; data['warantyYears'] = warantyYears; data['demandAmount'] = demandAmount; data['adStatus'] = adStatus; if (vehiclePostingImages != null) { data['vehiclePostingImages'] = vehiclePostingImages!.map((v) => v.toJson()).toList(); } if (vehiclePostingDamageParts != null) { data['vehiclePostingDamageParts'] = vehiclePostingDamageParts!.map((v) => v.toJson()).toList(); } return data; } } class VehiclePostingImages { int? id; String? imageName; String? imageUrl; String? imageStr; int? vehiclePostingID; String? vehiclePosting; VehiclePostingImages( {this.id, this.imageName, this.imageUrl, this.imageStr, this.vehiclePostingID, this.vehiclePosting}); VehiclePostingImages.fromJson(Map json) { id = json['id']; imageName = json['imageName']; imageUrl = json['imageUrl']; imageStr = json['imageStr']; vehiclePostingID = json['vehiclePostingID']; vehiclePosting = json['vehiclePosting']; } Map toJson() { final Map data = {}; data['id'] = id; data['imageName'] = imageName; data['imageUrl'] = imageUrl; data['imageStr'] = imageStr; data['vehiclePostingID'] = vehiclePostingID; data['vehiclePosting'] = vehiclePosting; return data; } } class VehiclePostingDamageParts { int? id; String? comment; String? vehicleImageBase64; int? vehicleDamagePartID; int? vehiclePostingID; bool? isActive; VehiclePostingDamageParts( {this.id, this.comment, this.vehicleImageBase64, this.vehicleDamagePartID, this.vehiclePostingID, this.isActive}); VehiclePostingDamageParts.fromJson(Map json) { id = json['id']; comment = json['comment']; vehicleImageBase64 = json['vehicleImageBase64']; vehicleDamagePartID = json['vehicleDamagePartID']; vehiclePostingID = json['vehiclePostingID']; isActive = json['isActive']; } Map toJson() { final Map data = {}; data['id'] = id; data['comment'] = comment; data['vehicleImageBase64'] = vehicleImageBase64; data['vehicleDamagePartID'] = vehicleDamagePartID; data['vehiclePostingID'] = vehiclePostingID; data['isActive'] = isActive; return data; } }