1616
1717import json
1818import pprint
19+ import re
1920from typing import Any , ClassVar , Dict , List , Optional , Set
2021
21- from pydantic import BaseModel , ConfigDict , Field
22- from typing_extensions import Self
22+ from pydantic import BaseModel , ConfigDict , Field , field_validator
23+ from typing_extensions import Annotated , Self
2324
2425from stackit .stackitmarketplace .models .subscription_lifecycle_state import (
2526 SubscriptionLifecycleState ,
@@ -33,12 +34,45 @@ class VendorSubscription(BaseModel):
3334 """
3435
3536 lifecycle_state : SubscriptionLifecycleState = Field (alias = "lifecycleState" )
36- organization_id : object = Field (alias = "organizationId" )
37+ organization_id : Annotated [str , Field (min_length = 36 , strict = True , max_length = 36 )] = Field (
38+ description = "Universally Unique Identifier (UUID)." , alias = "organizationId"
39+ )
3740 product : SubscriptionProduct
38- project_id : object = Field (alias = "projectId" )
39- subscription_id : object = Field (alias = "subscriptionId" )
41+ project_id : Annotated [str , Field (min_length = 36 , strict = True , max_length = 36 )] = Field (
42+ description = "Universally Unique Identifier (UUID)." , alias = "projectId"
43+ )
44+ subscription_id : Annotated [str , Field (min_length = 36 , strict = True , max_length = 36 )] = Field (
45+ description = "Universally Unique Identifier (UUID)." , alias = "subscriptionId"
46+ )
4047 __properties : ClassVar [List [str ]] = ["lifecycleState" , "organizationId" , "product" , "projectId" , "subscriptionId" ]
4148
49+ @field_validator ("organization_id" )
50+ def organization_id_validate_regular_expression (cls , value ):
51+ """Validates the regular expression"""
52+ if not re .match (r"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" , value ):
53+ raise ValueError (
54+ r"must validate the regular expression /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/"
55+ )
56+ return value
57+
58+ @field_validator ("project_id" )
59+ def project_id_validate_regular_expression (cls , value ):
60+ """Validates the regular expression"""
61+ if not re .match (r"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" , value ):
62+ raise ValueError (
63+ r"must validate the regular expression /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/"
64+ )
65+ return value
66+
67+ @field_validator ("subscription_id" )
68+ def subscription_id_validate_regular_expression (cls , value ):
69+ """Validates the regular expression"""
70+ if not re .match (r"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" , value ):
71+ raise ValueError (
72+ r"must validate the regular expression /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/"
73+ )
74+ return value
75+
4276 model_config = ConfigDict (
4377 populate_by_name = True ,
4478 validate_assignment = True ,
0 commit comments