16
16
17
17
import json
18
18
import pprint
19
+ import re
19
20
from typing import Any , ClassVar , Dict , List , Optional , Set
20
21
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
23
24
24
25
from stackit .stackitmarketplace .models .subscription_lifecycle_state import (
25
26
SubscriptionLifecycleState ,
@@ -33,12 +34,45 @@ class VendorSubscription(BaseModel):
33
34
"""
34
35
35
36
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
+ )
37
40
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
+ )
40
47
__properties : ClassVar [List [str ]] = ["lifecycleState" , "organizationId" , "product" , "projectId" , "subscriptionId" ]
41
48
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
+
42
76
model_config = ConfigDict (
43
77
populate_by_name = True ,
44
78
validate_assignment = True ,
0 commit comments