35 lines
1.0 KiB
Dart
35 lines
1.0 KiB
Dart
import 'package:json_annotation/json_annotation.dart';
|
|
|
|
part 'car_dto.g.dart';
|
|
|
|
|
|
@JsonSerializable(createToJson: false)
|
|
class CarDto {
|
|
@JsonKey(name: 'Count')
|
|
final int? count;
|
|
@JsonKey(name: 'Message')
|
|
final String? message;
|
|
@JsonKey(name: 'SearchCriteria')
|
|
final String? searchCriteria;
|
|
@JsonKey(name: 'Results')
|
|
final List<CarAttributesResultDto>? results;
|
|
|
|
const CarDto({this.count, this.message, this.searchCriteria, this.results});
|
|
factory CarDto.fromJson(Map<String, dynamic> json) => _$CarDtoFromJson(json);
|
|
}
|
|
@JsonSerializable(createToJson: false)
|
|
class CarAttributesResultDto {
|
|
@JsonKey(name: 'Model_ID')
|
|
final int? modelID;
|
|
@JsonKey(name: 'Make_Name')
|
|
final String? makeName;
|
|
@JsonKey(name: 'Model_Name')
|
|
final String? modelName;
|
|
|
|
const CarAttributesResultDto({ this.modelID, this.makeName, this.modelName});
|
|
|
|
factory CarAttributesResultDto.fromJson(Map<String, dynamic> json) => _$CarAttributesResultDtoFromJson(json);
|
|
// Map<String, dynamic> toJson() => _$CarAttributesResultDtoFromJson(this);
|
|
}
|
|
|