TicketLeg.fromJson constructor

TicketLeg.fromJson(
  1. Map json_
)

Implementation

TicketLeg.fromJson(core.Map json_)
    : this(
        arrivalDateTime: json_.containsKey('arrivalDateTime')
            ? json_['arrivalDateTime'] as core.String
            : null,
        carriage: json_.containsKey('carriage')
            ? json_['carriage'] as core.String
            : null,
        departureDateTime: json_.containsKey('departureDateTime')
            ? json_['departureDateTime'] as core.String
            : null,
        destinationName: json_.containsKey('destinationName')
            ? LocalizedString.fromJson(json_['destinationName']
                as core.Map<core.String, core.dynamic>)
            : null,
        destinationStationCode: json_.containsKey('destinationStationCode')
            ? json_['destinationStationCode'] as core.String
            : null,
        fareName: json_.containsKey('fareName')
            ? LocalizedString.fromJson(
                json_['fareName'] as core.Map<core.String, core.dynamic>)
            : null,
        originName: json_.containsKey('originName')
            ? LocalizedString.fromJson(
                json_['originName'] as core.Map<core.String, core.dynamic>)
            : null,
        originStationCode: json_.containsKey('originStationCode')
            ? json_['originStationCode'] as core.String
            : null,
        platform: json_.containsKey('platform')
            ? json_['platform'] as core.String
            : null,
        ticketSeat: json_.containsKey('ticketSeat')
            ? TicketSeat.fromJson(
                json_['ticketSeat'] as core.Map<core.String, core.dynamic>)
            : null,
        ticketSeats: json_.containsKey('ticketSeats')
            ? (json_['ticketSeats'] as core.List)
                .map((value) => TicketSeat.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        transitOperatorName: json_.containsKey('transitOperatorName')
            ? LocalizedString.fromJson(json_['transitOperatorName']
                as core.Map<core.String, core.dynamic>)
            : null,
        transitTerminusName: json_.containsKey('transitTerminusName')
            ? LocalizedString.fromJson(json_['transitTerminusName']
                as core.Map<core.String, core.dynamic>)
            : null,
        zone: json_.containsKey('zone') ? json_['zone'] as core.String : null,
      );