Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
- Mark attributes `max_message_size_ki_b` and `max_messages_per_hour` as optional (previously required) in `UpdateIntakeRunnerPayload` model
- `ske`: [v1.3.0](services/ske/CHANGELOG.md#v130)
- **Feature:** Add new field `kubernetes` to `Nodepool` model
- `stackitmarketplace`: [v1.8.0](services/stackitmarketplace/CHANGELOG.md#v180)
- **Feature:** Add new field `free_trial` in `CatalogProductOverview` model

## Release (2025-08-29)
- `kms`: [v0.3.0](services/kms/CHANGELOG.md#v030)
Expand Down
3 changes: 3 additions & 0 deletions services/stackitmarketplace/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## v1.8.0
- **Feature:** Add new field `free_trial` in `CatalogProductOverview` model

## v1.7.0
- **Breaking Change:** Update `InquiryFormType` enums

Expand Down
2 changes: 1 addition & 1 deletion services/stackitmarketplace/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "stackit-stackitmarketplace"

[tool.poetry]
name = "stackit-stackitmarketplace"
version = "v1.7.0"
version = "v1.8.0"
authors = [
"STACKIT Developer Tools <developer-tools@stackit.cloud>",
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"ContactSales",
"DeliveryMethod",
"ErrorResponse",
"FreeTrial",
"InquiriesCreateInquiryPayload",
"InquiryBecomeVendor",
"InquiryContactSales",
Expand Down Expand Up @@ -127,6 +128,7 @@
from stackit.stackitmarketplace.models.error_response import (
ErrorResponse as ErrorResponse,
)
from stackit.stackitmarketplace.models.free_trial import FreeTrial as FreeTrial
from stackit.stackitmarketplace.models.inquiries_create_inquiry_payload import (
InquiriesCreateInquiryPayload as InquiriesCreateInquiryPayload,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
from stackit.stackitmarketplace.models.contact_sales import ContactSales
from stackit.stackitmarketplace.models.delivery_method import DeliveryMethod
from stackit.stackitmarketplace.models.error_response import ErrorResponse
from stackit.stackitmarketplace.models.free_trial import FreeTrial
from stackit.stackitmarketplace.models.inquiries_create_inquiry_payload import (
InquiriesCreateInquiryPayload,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
CatalogProductOverviewVendor,
)
from stackit.stackitmarketplace.models.delivery_method import DeliveryMethod
from stackit.stackitmarketplace.models.free_trial import FreeTrial
from stackit.stackitmarketplace.models.product_lifecycle_state import (
ProductLifecycleState,
)
Expand All @@ -44,6 +45,7 @@ class CatalogProductOverview(BaseModel):
""" # noqa: E501

delivery_method: DeliveryMethod = Field(alias="deliveryMethod")
free_trial: Optional[FreeTrial] = Field(default=None, alias="freeTrial")
lifecycle_state: ProductLifecycleState = Field(alias="lifecycleState")
logo: Optional[Union[StrictBytes, StrictStr]] = Field(default=None, description="The logo base64 encoded.")
name: Annotated[str, Field(strict=True, max_length=512)] = Field(description="The name of the product.")
Expand All @@ -54,6 +56,7 @@ class CatalogProductOverview(BaseModel):
vendor: CatalogProductOverviewVendor
__properties: ClassVar[List[str]] = [
"deliveryMethod",
"freeTrial",
"lifecycleState",
"logo",
"name",
Expand Down Expand Up @@ -120,6 +123,9 @@ def to_dict(self) -> Dict[str, Any]:
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of free_trial
if self.free_trial:
_dict["freeTrial"] = self.free_trial.to_dict()
# override the default output from pydantic by calling `to_dict()` of vendor
if self.vendor:
_dict["vendor"] = self.vendor.to_dict()
Expand All @@ -137,6 +143,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
_obj = cls.model_validate(
{
"deliveryMethod": obj.get("deliveryMethod"),
"freeTrial": FreeTrial.from_dict(obj["freeTrial"]) if obj.get("freeTrial") is not None else None,
"lifecycleState": obj.get("lifecycleState"),
"logo": obj.get("logo"),
"name": obj.get("name"),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# coding: utf-8

"""
STACKIT Marketplace API

API to manage STACKIT Marketplace.

The version of the OpenAPI document: 1
Contact: marketplace@stackit.cloud
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
""" # noqa: E501

from __future__ import annotations

import json
import pprint
from typing import Any, ClassVar, Dict, List, Optional, Set

from pydantic import BaseModel, ConfigDict, StrictInt
from typing_extensions import Self


class FreeTrial(BaseModel):
"""
The amount of days of free trial highlighted in the product card.
""" # noqa: E501

value: Optional[StrictInt] = None
__properties: ClassVar[List[str]] = ["value"]

model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)

def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))

def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())

@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of FreeTrial from a JSON string"""
return cls.from_dict(json.loads(json_str))

def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:

* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([])

_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict

@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of FreeTrial from a dict"""
if obj is None:
return None

if not isinstance(obj, dict):
return cls.model_validate(obj)

_obj = cls.model_validate({"value": obj.get("value")})
return _obj