AccountCapabilityRequirements.fromJson constructor
AccountCapabilityRequirements.fromJson(
- Object? json
Implementation
factory AccountCapabilityRequirements.fromJson(Object? json) {
final map = (json as Map).cast<String, Object?>();
return AccountCapabilityRequirements(
alternatives: map['alternatives'] == null
? null
: (map['alternatives'] as List<Object?>)
.map((el) => AccountRequirementsAlternative.fromJson(el))
.toList(),
currentDeadline: map['current_deadline'] == null
? null
: DateTime.fromMillisecondsSinceEpoch(
(map['current_deadline'] as int).toInt()),
currentlyDue: (map['currently_due'] as List<Object?>)
.map((el) => (el as String))
.toList(),
disabledReason: map['disabled_reason'] == null
? null
: (map['disabled_reason'] as String),
errors: (map['errors'] as List<Object?>)
.map((el) => AccountRequirementsError.fromJson(el))
.toList(),
eventuallyDue: (map['eventually_due'] as List<Object?>)
.map((el) => (el as String))
.toList(),
pastDue: (map['past_due'] as List<Object?>)
.map((el) => (el as String))
.toList(),
pendingVerification: (map['pending_verification'] as List<Object?>)
.map((el) => (el as String))
.toList(),
);
}