FirewallPolicyRuleMatcherLayer4Config.fromJson constructor

FirewallPolicyRuleMatcherLayer4Config.fromJson(
  1. Object? j
)

Implementation

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