TaxRateUpdateOptions.fromJson constructor

TaxRateUpdateOptions.fromJson(
  1. Object? json
)

Implementation

factory TaxRateUpdateOptions.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return TaxRateUpdateOptions(
    active: map['active'] == null ? null : (map['active'] as bool),
    country: map['country'] == null ? null : (map['country'] as String),
    description:
        map['description'] == null ? null : (map['description'] as String),
    displayName:
        map['display_name'] == null ? null : (map['display_name'] as String),
    expand: map['expand'] == null
        ? null
        : (map['expand'] as List<Object?>)
            .map((el) => (el as String))
            .toList(),
    jurisdiction:
        map['jurisdiction'] == null ? null : (map['jurisdiction'] as String),
    metadata: map['metadata'] == null
        ? null
        : (map['metadata'] as Map).cast<String, Object?>().map((
              key,
              value,
            ) =>
                MapEntry(
                  key,
                  (value as String),
                )),
    state: map['state'] == null ? null : (map['state'] as String),
    taxType: map['tax_type'] == null
        ? null
        : TaxProductResourceLineItemTaxBreakdownTaxRateDetailsTaxType
            .fromJson(map['tax_type']),
  );
}