2022-11-30 16:26:40 +01:00
|
|
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
|
|
|
|
part of 'ceskedrahy.dart';
|
|
|
|
|
|
|
|
// **************************************************************************
|
|
|
|
// JsonSerializableGenerator
|
|
|
|
// **************************************************************************
|
|
|
|
|
|
|
|
CDJizdenka _$CDJizdenkaFromJson(Map<String, dynamic> json) => CDJizdenka(
|
|
|
|
doStanice: json['stationTo'] as String,
|
|
|
|
jmeno: json['name'] as String,
|
|
|
|
platiOd: const _DatumPlatnostiPrevodnik()
|
|
|
|
.fromJson(json['validFrom'] as String?),
|
|
|
|
platiDo: const _DatumPlatnostiPrevodnik()
|
|
|
|
.fromJson(json['validity'] as String?),
|
|
|
|
spoje: (json['trainsThere'] as List<dynamic>)
|
|
|
|
.map((e) => CDSpoj.fromJson(e as Map<String, dynamic>))
|
|
|
|
.toList(),
|
|
|
|
zeStanice: json['stationFrom'] as String,
|
|
|
|
vracena: json['isRefunded'] as bool,
|
|
|
|
cena: const _CenaPrevodnik().fromJson(json['price'] as int),
|
2022-12-01 20:32:52 +01:00
|
|
|
trida: $enumDecode(_$ClassEnumMap, json['serviceClass']),
|
|
|
|
qrUrl: json['aztecImageUrl'] as String,
|
|
|
|
id: json['transactionCode'] as String,
|
2022-11-30 16:26:40 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
Map<String, dynamic> _$CDJizdenkaToJson(CDJizdenka instance) =>
|
|
|
|
<String, dynamic>{
|
|
|
|
'stationTo': instance.doStanice,
|
|
|
|
'name': instance.jmeno,
|
|
|
|
'validity': const _DatumPlatnostiPrevodnik().toJson(instance.platiDo),
|
|
|
|
'validFrom': const _DatumPlatnostiPrevodnik().toJson(instance.platiOd),
|
|
|
|
'trainsThere': instance.spoje,
|
|
|
|
'stationFrom': instance.zeStanice,
|
|
|
|
'isRefunded': instance.vracena,
|
|
|
|
'price': const _CenaPrevodnik().toJson(instance.cena),
|
2022-12-01 20:32:52 +01:00
|
|
|
'serviceClass': _$ClassEnumMap[instance.trida]!,
|
|
|
|
'aztecImageUrl': instance.qrUrl,
|
|
|
|
'transactionCode': instance.id,
|
2022-11-30 16:26:40 +01:00
|
|
|
};
|
|
|
|
|
2022-12-01 20:32:52 +01:00
|
|
|
const _$ClassEnumMap = {
|
|
|
|
Class.class2: 'Class2',
|
|
|
|
Class.class1: 'Class1',
|
|
|
|
Class.business: 'Business',
|
|
|
|
};
|
|
|
|
|
2022-11-30 16:26:40 +01:00
|
|
|
CDSpoj _$CDSpojFromJson(Map<String, dynamic> json) => CDSpoj(
|
|
|
|
nazev: json['train'] as String,
|
|
|
|
zeStanice: json['stationFrom'] as String,
|
|
|
|
doStanice: json['stationTo'] as String,
|
|
|
|
odjezdDen: const _DatumPlatnostiPrevodnik()
|
|
|
|
.fromJson(json['stationFromDate'] as String?),
|
|
|
|
prijezdDen: const _DatumPlatnostiPrevodnik()
|
|
|
|
.fromJson(json['stationToDate'] as String?),
|
|
|
|
);
|
|
|
|
|
|
|
|
Map<String, dynamic> _$CDSpojToJson(CDSpoj instance) => <String, dynamic>{
|
|
|
|
'train': instance.nazev,
|
|
|
|
'stationFrom': instance.zeStanice,
|
|
|
|
'stationTo': instance.doStanice,
|
|
|
|
'stationFromDate':
|
|
|
|
const _DatumPlatnostiPrevodnik().toJson(instance.odjezdDen),
|
|
|
|
'stationToDate':
|
|
|
|
const _DatumPlatnostiPrevodnik().toJson(instance.prijezdDen),
|
|
|
|
};
|