RoutePolicy.fromJson constructor
RoutePolicy.fromJson(
- Object? j
Implementation
factory RoutePolicy.fromJson(Object? j) {
final json = j as Map<String, Object?>;
return RoutePolicy(
description: switch (json['description']) {
null => null,
Object $1 => decodeString($1),
},
fingerprint: switch (json['fingerprint']) {
null => null,
Object $1 => decodeString($1),
},
name: switch (json['name']) {
null => null,
Object $1 => decodeString($1),
},
terms: switch (json['terms']) {
null => [],
List<Object?> $1 => [
for (final i in $1) RoutePolicyPolicyTerm.fromJson(i),
],
_ => throw const FormatException('"terms" is not a list'),
},
type: switch (json['type']) {
null => null,
Object $1 => decodeString($1),
},
);
}