IssuingCardShipping.fromJson constructor

IssuingCardShipping.fromJson(
  1. Object? json
)

Implementation

factory IssuingCardShipping.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return IssuingCardShipping(
    address: Address.fromJson(map['address']),
    carrier: map['carrier'] == null
        ? null
        : IssuingCardShippingCarrier.fromJson(map['carrier']),
    customs: map['customs'] == null
        ? null
        : IssuingCardShippingCustoms.fromJson(map['customs']),
    eta: map['eta'] == null
        ? null
        : DateTime.fromMillisecondsSinceEpoch((map['eta'] as int).toInt()),
    name: (map['name'] as String),
    phoneNumber:
        map['phone_number'] == null ? null : (map['phone_number'] as String),
    requireSignature: map['require_signature'] == null
        ? null
        : (map['require_signature'] as bool),
    service: IssuingCardShippingService.fromJson(map['service']),
    status: map['status'] == null
        ? null
        : IssuingCardShippingStatus.fromJson(map['status']),
    trackingNumber: map['tracking_number'] == null
        ? null
        : (map['tracking_number'] as String),
    trackingUrl:
        map['tracking_url'] == null ? null : (map['tracking_url'] as String),
    type: IssuingCardShippingType.fromJson(map['type']),
  );
}