35 lines
1.0 KiB
Dart
Raw Normal View History

2024-10-28 16:20:50 +04:00
import 'package:json_annotation/json_annotation.dart';
part 'car_dto.g.dart';
@JsonSerializable(createToJson: false)
class CarDto {
2024-12-19 13:33:07 +04:00
@JsonKey(name: 'Count')
final int? count;
@JsonKey(name: 'Message')
final String? message;
@JsonKey(name: 'SearchCriteria')
final String? searchCriteria;
2024-12-11 17:49:42 +04:00
@JsonKey(name: 'Results')
2024-12-17 10:07:39 +04:00
final List<CarAttributesResultDto>? data;
2024-10-28 16:20:50 +04:00
2024-12-19 13:33:07 +04:00
const CarDto({this.data, this.count,this.message, this.searchCriteria});
2024-12-11 17:49:42 +04:00
factory CarDto.fromJson(Map<String, dynamic> json) => _$CarDtoFromJson(json);
2024-10-28 16:20:50 +04:00
}
2024-12-18 10:25:51 +04:00
2024-10-28 16:20:50 +04:00
@JsonSerializable(createToJson: false)
2024-12-11 13:10:34 +04:00
class CarAttributesResultDto {
@JsonKey(name: 'Make_Name')
2024-12-11 17:49:42 +04:00
final String? makeName;
2024-12-11 13:10:34 +04:00
@JsonKey(name: 'Model_Name')
2024-12-11 17:49:42 +04:00
final String? modelName;
2024-12-18 12:16:19 +04:00
@JsonKey(name: 'Model_ID')
final int? id;
2024-10-28 16:20:50 +04:00
2024-12-18 12:16:19 +04:00
const CarAttributesResultDto({this.id, this.makeName, this.modelName});
2024-10-28 16:20:50 +04:00
2024-12-18 10:25:51 +04:00
factory CarAttributesResultDto.fromJson(Map<String, dynamic> json) =>
_$CarAttributesResultDtoFromJson(json);
// Map<String, dynamic> toJson() => _$CarAttributesResultDtoFromJson(this);
2024-12-11 13:10:34 +04:00
}