VippsStatus.fromJson constructor

VippsStatus.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory VippsStatus.fromJson(Map<String, dynamic> json) =>
    switch (json['status']) {
      'PENDING' => VippsPending.fromJson(json),
      'COMPLETED' => VippsCompleted.fromJson(json),
      'FAILED' => VippsFailed.fromJson(json),
      final String status => VippsUnknown(status: status),
      _ => throw IdentisureException(
          0, 'Invalid vipps status: ${json['status']}'),
    };