SecurityPolicyRuleMatcherExprOptionsRecaptchaOptions.fromJson constructor

SecurityPolicyRuleMatcherExprOptionsRecaptchaOptions.fromJson(
  1. Object? j
)

Implementation

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