2323from stackit .cdn .models .config_patch_backend import ConfigPatchBackend
2424from stackit .cdn .models .loki_log_sink_patch import LokiLogSinkPatch
2525from stackit .cdn .models .optimizer_patch import OptimizerPatch
26+ from stackit .cdn .models .redirect_config import RedirectConfig
2627from stackit .cdn .models .region import Region
2728from stackit .cdn .models .waf_config_patch import WafConfigPatch
2829
@@ -55,6 +56,7 @@ class ConfigPatch(BaseModel):
5556 alias = "monthlyLimitBytes" ,
5657 )
5758 optimizer : Optional [OptimizerPatch ] = None
59+ redirects : Optional [RedirectConfig ] = None
5860 regions : Optional [Annotated [List [Region ], Field (min_length = 1 )]] = None
5961 waf : Optional [WafConfigPatch ] = None
6062 __properties : ClassVar [List [str ]] = [
@@ -65,6 +67,7 @@ class ConfigPatch(BaseModel):
6567 "logSink" ,
6668 "monthlyLimitBytes" ,
6769 "optimizer" ,
70+ "redirects" ,
6871 "regions" ,
6972 "waf" ,
7073 ]
@@ -115,6 +118,9 @@ def to_dict(self) -> Dict[str, Any]:
115118 # override the default output from pydantic by calling `to_dict()` of optimizer
116119 if self .optimizer :
117120 _dict ["optimizer" ] = self .optimizer .to_dict ()
121+ # override the default output from pydantic by calling `to_dict()` of redirects
122+ if self .redirects :
123+ _dict ["redirects" ] = self .redirects .to_dict ()
118124 # override the default output from pydantic by calling `to_dict()` of waf
119125 if self .waf :
120126 _dict ["waf" ] = self .waf .to_dict ()
@@ -153,6 +159,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
153159 "logSink" : LokiLogSinkPatch .from_dict (obj ["logSink" ]) if obj .get ("logSink" ) is not None else None ,
154160 "monthlyLimitBytes" : obj .get ("monthlyLimitBytes" ),
155161 "optimizer" : OptimizerPatch .from_dict (obj ["optimizer" ]) if obj .get ("optimizer" ) is not None else None ,
162+ "redirects" : RedirectConfig .from_dict (obj ["redirects" ]) if obj .get ("redirects" ) is not None else None ,
156163 "regions" : obj .get ("regions" ),
157164 "waf" : WafConfigPatch .from_dict (obj ["waf" ]) if obj .get ("waf" ) is not None else None ,
158165 }
0 commit comments