SecurityPolicyRule.fromJson constructor

SecurityPolicyRule.fromJson(
  1. Object? j
)

Implementation

factory SecurityPolicyRule.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return SecurityPolicyRule(
    action: switch (json['action']) {
      null => null,
      Object $1 => decodeString($1),
    },
    description: switch (json['description']) {
      null => null,
      Object $1 => decodeString($1),
    },
    headerAction: switch (json['headerAction']) {
      null => null,
      Object $1 => SecurityPolicyRuleHttpHeaderAction.fromJson($1),
    },
    kind: switch (json['kind']) {
      null => null,
      Object $1 => decodeString($1),
    },
    match: switch (json['match']) {
      null => null,
      Object $1 => SecurityPolicyRuleMatcher.fromJson($1),
    },
    networkMatch: switch (json['networkMatch']) {
      null => null,
      Object $1 => SecurityPolicyRuleNetworkMatcher.fromJson($1),
    },
    preconfiguredWafConfig: switch (json['preconfiguredWafConfig']) {
      null => null,
      Object $1 => SecurityPolicyRulePreconfiguredWafConfig.fromJson($1),
    },
    preview: switch (json['preview']) {
      null => null,
      Object $1 => decodeBool($1),
    },
    priority: switch (json['priority']) {
      null => null,
      Object $1 => decodeInt($1),
    },
    rateLimitOptions: switch (json['rateLimitOptions']) {
      null => null,
      Object $1 => SecurityPolicyRuleRateLimitOptions.fromJson($1),
    },
    redirectOptions: switch (json['redirectOptions']) {
      null => null,
      Object $1 => SecurityPolicyRuleRedirectOptions.fromJson($1),
    },
  );
}