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