1616
1717import json
1818import pprint
19+ import re # noqa: F401
1920from typing import Any , ClassVar , Dict , List , Optional , Set
2021
21- from pydantic import BaseModel , ConfigDict , Field , StrictStr
22- from typing_extensions import Self
22+ from pydantic import BaseModel , ConfigDict , Field , StrictStr , field_validator
23+ from typing_extensions import Annotated , Self
2324
2425from stackit .stackitmarketplace .models .catalog_pricing_option_highlight import (
2526 CatalogPricingOptionHighlight ,
@@ -38,6 +39,9 @@ class CatalogProductPricingOption(BaseModel):
3839 highlights : List [CatalogPricingOptionHighlight ] = Field (description = "The list of highlights." )
3940 name : StrictStr = Field (description = "The pricing option name." )
4041 notice_period : Optional [NoticePeriod ] = Field (default = None , alias = "noticePeriod" )
42+ plan_id : Annotated [str , Field (min_length = 10 , strict = True , max_length = 29 )] = Field (
43+ description = "The user-readable plan ID of a pricing option." , alias = "planId"
44+ )
4145 price_type : Optional [PriceType ] = Field (default = None , alias = "priceType" )
4246 pricing_plan : Optional [StrictStr ] = Field (
4347 default = None , description = "Additional price type information." , alias = "pricingPlan"
@@ -54,6 +58,7 @@ class CatalogProductPricingOption(BaseModel):
5458 "highlights" ,
5559 "name" ,
5660 "noticePeriod" ,
61+ "planId" ,
5762 "priceType" ,
5863 "pricingPlan" ,
5964 "rate" ,
@@ -63,6 +68,13 @@ class CatalogProductPricingOption(BaseModel):
6368 "unit" ,
6469 ]
6570
71+ @field_validator ("plan_id" )
72+ def plan_id_validate_regular_expression (cls , value ):
73+ """Validates the regular expression"""
74+ if not re .match (r"^[a-z0-9-]{1,20}-[0-9a-f]{8}$" , value ):
75+ raise ValueError (r"must validate the regular expression /^[a-z0-9-]{1,20}-[0-9a-f]{8}$/" )
76+ return value
77+
6678 model_config = ConfigDict (
6779 populate_by_name = True ,
6880 validate_assignment = True ,
@@ -133,6 +145,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
133145 "noticePeriod" : (
134146 NoticePeriod .from_dict (obj ["noticePeriod" ]) if obj .get ("noticePeriod" ) is not None else None
135147 ),
148+ "planId" : obj .get ("planId" ),
136149 "priceType" : obj .get ("priceType" ),
137150 "pricingPlan" : obj .get ("pricingPlan" ),
138151 "rate" : obj .get ("rate" ),
0 commit comments