22
33from __future__ import annotations
44
5+ from typing import Iterable
56from typing_extensions import Literal , Required , TypedDict
67
78from ..._types import SequenceNotStr
89
9- __all__ = ["FraudUpdateParams" ]
10+ __all__ = [
11+ "FraudUpdateParams" ,
12+ "AuthenticationSettings" ,
13+ "AuthenticationSettingsFailureCriteria" ,
14+ "AuthenticationSettingsSuccessCriteria" ,
15+ ]
1016
1117
1218class FraudUpdateParams (TypedDict , total = False ):
1319 zone_id : Required [str ]
1420 """Identifier."""
1521
22+ authentication_settings : AuthenticationSettings
23+ """
24+ Configuration for classifying login authentication outcomes based on the origin
25+ response. Requires `user_profiles` to be enabled.
26+
27+ - Success and failure criteria are independently updatable — sending only
28+ `success_criteria` leaves failure codes untouched, and vice versa.
29+ - Omit `authentication_settings` entirely to leave both unchanged.
30+ - Status codes must not overlap between success and failure criteria.
31+ """
32+
1633 user_profiles : Literal ["enabled" , "disabled" ]
1734 """Whether Fraud User Profiles is enabled for the zone."""
1835
@@ -25,3 +42,55 @@ class FraudUpdateParams(TypedDict, total=False):
2542 - Invalid expressions will result in a 10400 Bad Request with details in the
2643 `messages` array.
2744 """
45+
46+
47+ class AuthenticationSettingsFailureCriteria (TypedDict , total = False ):
48+ """Criterion for identifying failed login responses."""
49+
50+ kind : Required [Literal ["status_code" ]]
51+ """The type of criterion. Currently only `status_code` is supported."""
52+
53+ status_codes : Iterable [int ]
54+ """HTTP status codes to match against the origin response.
55+
56+ - Maximum of 10 codes per criterion.
57+ - Each code must be a valid HTTP status code (100-599).
58+ - Codes are deduplicated and sorted on save.
59+ - Omit to leave unchanged on update.
60+ - Provide an empty array `[]` to clear codes on update.
61+ """
62+
63+
64+ class AuthenticationSettingsSuccessCriteria (TypedDict , total = False ):
65+ """Criterion for identifying successful login responses."""
66+
67+ kind : Required [Literal ["status_code" ]]
68+ """The type of criterion. Currently only `status_code` is supported."""
69+
70+ status_codes : Iterable [int ]
71+ """HTTP status codes to match against the origin response.
72+
73+ - Maximum of 10 codes per criterion.
74+ - Each code must be a valid HTTP status code (100-599).
75+ - Codes are deduplicated and sorted on save.
76+ - Omit to leave unchanged on update.
77+ - Provide an empty array `[]` to clear codes on update.
78+ """
79+
80+
81+ class AuthenticationSettings (TypedDict , total = False ):
82+ """
83+ Configuration for classifying login authentication outcomes based on the origin response.
84+ Requires `user_profiles` to be enabled.
85+
86+ - Success and failure criteria are independently updatable — sending only `success_criteria`
87+ leaves failure codes untouched, and vice versa.
88+ - Omit `authentication_settings` entirely to leave both unchanged.
89+ - Status codes must not overlap between success and failure criteria.
90+ """
91+
92+ failure_criteria : AuthenticationSettingsFailureCriteria
93+ """Criterion for identifying failed login responses."""
94+
95+ success_criteria : AuthenticationSettingsSuccessCriteria
96+ """Criterion for identifying successful login responses."""
0 commit comments