TaxRegistration.fromJson constructor
TaxRegistration.fromJson(
- Object? json
Implementation
factory TaxRegistration.fromJson(Object? json) {
final map = (json as Map).cast<String, Object?>();
return TaxRegistration(
activeFrom: DateTime.fromMillisecondsSinceEpoch(
(map['active_from'] as int).toInt()),
country: (map['country'] as String),
countryOptions: TaxProductRegistrationsResourceCountryOptions.fromJson(
map['country_options']),
created:
DateTime.fromMillisecondsSinceEpoch((map['created'] as int).toInt()),
expiresAt: map['expires_at'] == null
? null
: DateTime.fromMillisecondsSinceEpoch(
(map['expires_at'] as int).toInt()),
id: (map['id'] as String),
livemode: (map['livemode'] as bool),
status: TaxRegistrationStatus.fromJson(map['status']),
);
}