diff --git a/CHANGELOG.md b/CHANGELOG.md index f5b1b4dc4..a88a1689f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ ## Release (2025-xx-xx) -- `stackitmarketplace`: [v1.10.0](services/stackitmarketplace/CHANGELOG.md#v1100) - - **Feature:** Added `PlanId` to `CatalogProductPricingOption`and `SubscriptionProduct` +- `stackitmarketplace`: + - [v1.11.0](services/stackitmarketplace/CHANGELOG.md#v1110) + - **Feature:** Add new field `DemoUrl` to `CatalogProductDetail` model + - [v1.10.0](services/stackitmarketplace/CHANGELOG.md#v1100) + - **Feature:** Added `PlanId` to `CatalogProductPricingOption` and `SubscriptionProduct` ## Release (2025-09-11) - `cdn`: [v1.6.0](services/cdn/CHANGELOG.md#v160) diff --git a/services/stackitmarketplace/CHANGELOG.md b/services/stackitmarketplace/CHANGELOG.md index 9b0e3d78c..71778a32e 100644 --- a/services/stackitmarketplace/CHANGELOG.md +++ b/services/stackitmarketplace/CHANGELOG.md @@ -1,5 +1,8 @@ +## v1.11.0 +- **Feature:** Add new field `DemoUrl` to `CatalogProductDetail` model + ## v1.10.0 -- **Feature:** Added `PlanId` to `CatalogProductPricingOption`and `SubscriptionProduct` +- **Feature:** Added `PlanId` to `CatalogProductPricingOption` and `SubscriptionProduct` ## v1.9.0 - **Feature:** Added `RequestPrivatePlan` to `InquiriesCreateInquiryPayload` diff --git a/services/stackitmarketplace/pyproject.toml b/services/stackitmarketplace/pyproject.toml index 821ac380b..76c8352ed 100644 --- a/services/stackitmarketplace/pyproject.toml +++ b/services/stackitmarketplace/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-stackitmarketplace" [tool.poetry] name = "stackit-stackitmarketplace" -version = "v1.10.0" +version = "v1.11.0" authors = [ "STACKIT Developer Tools ", ] diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_detail.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_detail.py index cf1b53170..2d2563779 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_detail.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_detail.py @@ -63,6 +63,9 @@ class CatalogProductDetail(BaseModel): default=None, description="The list of categories associated to the product." ) delivery_method: DeliveryMethod = Field(alias="deliveryMethod") + demo_url: Optional[Annotated[str, Field(strict=True, max_length=512)]] = Field( + default=None, description="The URL to a demo if available.", alias="demoUrl" + ) description: StrictStr = Field(description="The product description.") documentation_url: Annotated[str, Field(strict=True, max_length=512)] = Field( description="The documentation URL.", alias="documentationUrl" @@ -108,6 +111,7 @@ class CatalogProductDetail(BaseModel): "assets", "categories", "deliveryMethod", + "demoUrl", "description", "documentationUrl", "email", @@ -129,6 +133,18 @@ class CatalogProductDetail(BaseModel): "videoUrl", ] + @field_validator("demo_url") + def demo_url_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$", value): + raise ValueError( + r"must validate the regular expression /^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/" + ) + return value + @field_validator("documentation_url") def documentation_url_validate_regular_expression(cls, value): """Validates the regular expression""" @@ -260,6 +276,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "assets": Assets.from_dict(obj["assets"]) if obj.get("assets") is not None else None, "categories": obj.get("categories"), "deliveryMethod": obj.get("deliveryMethod"), + "demoUrl": obj.get("demoUrl"), "description": obj.get("description"), "documentationUrl": obj.get("documentationUrl"), "email": obj.get("email"),