1616import json
1717import pprint
1818from typing import Any , ClassVar , Dict , List , Optional , Set
19+ from uuid import UUID
1920
2021from pydantic import BaseModel , ConfigDict , Field , StrictInt , StrictStr , field_validator
2122from pydantic_core import to_jsonable_python
@@ -39,13 +40,14 @@ class RuleResponse(BaseModel):
3940 port_range : Optional [StrictStr ] = Field (default = None , alias = "portRange" )
4041 product : StrictStr
4142 protocol : Optional [StrictStr ] = None
43+ ref_id : Optional [UUID ] = Field (default = None , alias = "refId" )
4244 region : Optional [StrictStr ] = None
4345 remote_security_group_id : Optional [StrictStr ] = Field (default = None , alias = "remoteSecurityGroupId" )
4446 security_group : Optional [StrictStr ] = Field (default = None , alias = "securityGroup" )
4547 security_group_id : Optional [StrictStr ] = Field (default = None , alias = "securityGroupId" )
4648 source_ip : StrictStr = Field (alias = "sourceIP" )
4749 status : StrictStr = Field (description = "The current state of the resource." )
48- type : StrictStr
50+ type : StrictStr = Field ( description = 'The type of the rule (e.g., "ACL", "PublicIP", "SecurityRule").' )
4951 __properties : ClassVar [List [str ]] = [
5052 "description" ,
5153 "destination" ,
@@ -59,6 +61,7 @@ class RuleResponse(BaseModel):
5961 "portRange" ,
6062 "product" ,
6163 "protocol" ,
64+ "refId" ,
6265 "region" ,
6366 "remoteSecurityGroupId" ,
6467 "securityGroup" ,
@@ -77,6 +80,13 @@ def status_validate_enum(cls, value):
7780 )
7881 return value
7982
83+ @field_validator ("type" )
84+ def type_validate_enum (cls , value ):
85+ """Validates the enum"""
86+ if value not in set (["ACL" , "PublicIP" , "SecurityRule" , "SecurityGroup" ]):
87+ raise ValueError ("must be one of enum values ('ACL', 'PublicIP', 'SecurityRule', 'SecurityGroup')" )
88+ return value
89+
8090 model_config = ConfigDict (
8191 validate_by_name = True ,
8292 validate_by_alias = True ,
@@ -139,6 +149,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
139149 "portRange" : obj .get ("portRange" ),
140150 "product" : obj .get ("product" ),
141151 "protocol" : obj .get ("protocol" ),
152+ "refId" : obj .get ("refId" ),
142153 "region" : obj .get ("region" ),
143154 "remoteSecurityGroupId" : obj .get ("remoteSecurityGroupId" ),
144155 "securityGroup" : obj .get ("securityGroup" ),
0 commit comments