diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e3d125a..81fd7e50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## Release (2025-XX-YY) +- `stackitmarketplace`: [0.3.0](services/stackitmarketplace/CHANGELOG.md#v030-2025-04-04) + - **Feature:** Add new `VendorProductId` attribute for subscription products + ## Release (2025-03-27) - `alb`: [v0.1.0](services/alb/CHANGELOG.md#v010-2025-03-18) - **New**: Client for managing the ALB service diff --git a/services/stackitmarketplace/CHANGELOG.md b/services/stackitmarketplace/CHANGELOG.md index be22e15f..9654e108 100644 --- a/services/stackitmarketplace/CHANGELOG.md +++ b/services/stackitmarketplace/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.3.0 (2025-04-04) +- **Feature:** Add new `VendorProductId` attribute for subscription products + ## v0.2.0 (2025-03-05) - **Feature:** Add method to create inquiries: `InquiriesCreateInquiry` diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/subscription_product.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/subscription_product.py index 66c1bfa3..8ac787f7 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/subscription_product.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/subscription_product.py @@ -16,10 +16,11 @@ import json import pprint +import re from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing_extensions import Self +from typing_extensions import Annotated, Self class SubscriptionProduct(BaseModel): @@ -34,6 +35,9 @@ class SubscriptionProduct(BaseModel): product_id: StrictStr = Field(description="The product ID.", alias="productId") product_name: StrictStr = Field(description="The name of the product.", alias="productName") vendor_name: StrictStr = Field(description="The product's vendor name.", alias="vendorName") + vendor_product_id: Optional[Annotated[str, Field(strict=True)]] = Field( + default=None, description="The product ID provided by the Vendor.", alias="vendorProductId" + ) vendor_website_url: StrictStr = Field(description="The vendor's website.", alias="vendorWebsiteUrl") __properties: ClassVar[List[str]] = [ "deliveryMethod", @@ -43,6 +47,7 @@ class SubscriptionProduct(BaseModel): "productId", "productName", "vendorName", + "vendorProductId", "vendorWebsiteUrl", ] @@ -67,6 +72,16 @@ def price_type_validate_enum(cls, value): raise ValueError("must be one of enum values ('CONTRACT', 'FREE', 'FREE_TRIAL', 'BYOL', 'PAYG')") return value + @field_validator("vendor_product_id") + def vendor_product_id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[a-zA-Z0-9](?:[a-zA-Z0-9_+&-]){0,39}$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9](?:[a-zA-Z0-9_+&-]){0,39}$/") + return value + model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -124,6 +139,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "productId": obj.get("productId"), "productName": obj.get("productName"), "vendorName": obj.get("vendorName"), + "vendorProductId": obj.get("vendorProductId"), "vendorWebsiteUrl": obj.get("vendorWebsiteUrl"), } )