FirewallPolicyRuleMatcher.fromJson constructor
FirewallPolicyRuleMatcher.fromJson(
- Object? j
Implementation
factory FirewallPolicyRuleMatcher.fromJson(Object? j) {
final json = j as Map<String, Object?>;
return FirewallPolicyRuleMatcher(
destAddressGroups: switch (json['destAddressGroups']) {
null => [],
List<Object?> $1 => [for (final i in $1) decodeString(i)],
_ => throw const FormatException('"destAddressGroups" is not a list'),
},
destFqdns: switch (json['destFqdns']) {
null => [],
List<Object?> $1 => [for (final i in $1) decodeString(i)],
_ => throw const FormatException('"destFqdns" is not a list'),
},
destIpRanges: switch (json['destIpRanges']) {
null => [],
List<Object?> $1 => [for (final i in $1) decodeString(i)],
_ => throw const FormatException('"destIpRanges" is not a list'),
},
destNetworkContext: switch (json['destNetworkContext']) {
null => null,
Object $1 => decodeString($1),
},
destNetworkType: switch (json['destNetworkType']) {
null => null,
Object $1 => decodeString($1),
},
destRegionCodes: switch (json['destRegionCodes']) {
null => [],
List<Object?> $1 => [for (final i in $1) decodeString(i)],
_ => throw const FormatException('"destRegionCodes" is not a list'),
},
destThreatIntelligences: switch (json['destThreatIntelligences']) {
null => [],
List<Object?> $1 => [for (final i in $1) decodeString(i)],
_ => throw const FormatException(
'"destThreatIntelligences" is not a list',
),
},
layer4Configs: switch (json['layer4Configs']) {
null => [],
List<Object?> $1 => [
for (final i in $1) FirewallPolicyRuleMatcherLayer4Config.fromJson(i),
],
_ => throw const FormatException('"layer4Configs" is not a list'),
},
srcAddressGroups: switch (json['srcAddressGroups']) {
null => [],
List<Object?> $1 => [for (final i in $1) decodeString(i)],
_ => throw const FormatException('"srcAddressGroups" is not a list'),
},
srcFqdns: switch (json['srcFqdns']) {
null => [],
List<Object?> $1 => [for (final i in $1) decodeString(i)],
_ => throw const FormatException('"srcFqdns" is not a list'),
},
srcIpRanges: switch (json['srcIpRanges']) {
null => [],
List<Object?> $1 => [for (final i in $1) decodeString(i)],
_ => throw const FormatException('"srcIpRanges" is not a list'),
},
srcNetworkContext: switch (json['srcNetworkContext']) {
null => null,
Object $1 => decodeString($1),
},
srcNetworkType: switch (json['srcNetworkType']) {
null => null,
Object $1 => decodeString($1),
},
srcNetworks: switch (json['srcNetworks']) {
null => [],
List<Object?> $1 => [for (final i in $1) decodeString(i)],
_ => throw const FormatException('"srcNetworks" is not a list'),
},
srcRegionCodes: switch (json['srcRegionCodes']) {
null => [],
List<Object?> $1 => [for (final i in $1) decodeString(i)],
_ => throw const FormatException('"srcRegionCodes" is not a list'),
},
srcSecureTags: switch (json['srcSecureTags']) {
null => [],
List<Object?> $1 => [
for (final i in $1) FirewallPolicyRuleSecureTag.fromJson(i),
],
_ => throw const FormatException('"srcSecureTags" is not a list'),
},
srcThreatIntelligences: switch (json['srcThreatIntelligences']) {
null => [],
List<Object?> $1 => [for (final i in $1) decodeString(i)],
_ => throw const FormatException(
'"srcThreatIntelligences" is not a list',
),
},
);
}