Skip to content

Commit b6e9f61

Browse files
Generator: Update SDK /services/stackitmarketplace (#2268)
v1.8.0 - Feature: Add new field `free_trial` in `CatalogProductOverview` model --------- Co-authored-by: Marcel Jacek <[email protected]>
1 parent 10ef492 commit b6e9f61

File tree

7 files changed

+98
-1
lines changed

7 files changed

+98
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
- Mark attributes `max_message_size_ki_b` and `max_messages_per_hour` as optional (previously required) in `UpdateIntakeRunnerPayload` model
1717
- `ske`: [v1.3.0](services/ske/CHANGELOG.md#v130)
1818
- **Feature:** Add new field `kubernetes` to `Nodepool` model
19+
- `stackitmarketplace`: [v1.8.0](services/stackitmarketplace/CHANGELOG.md#v180)
20+
- **Feature:** Add new field `free_trial` in `CatalogProductOverview` model
1921

2022
## Release (2025-08-29)
2123
- `kms`: [v0.3.0](services/kms/CHANGELOG.md#v030)

services/stackitmarketplace/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## v1.8.0
2+
- **Feature:** Add new field `free_trial` in `CatalogProductOverview` model
3+
14
## v1.7.0
25
- **Breaking Change:** Update `InquiryFormType` enums
36

services/stackitmarketplace/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "stackit-stackitmarketplace"
33

44
[tool.poetry]
55
name = "stackit-stackitmarketplace"
6-
version = "v1.7.0"
6+
version = "v1.8.0"
77
authors = [
88
"STACKIT Developer Tools <[email protected]>",
99
]

services/stackitmarketplace/src/stackit/stackitmarketplace/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"ContactSales",
4646
"DeliveryMethod",
4747
"ErrorResponse",
48+
"FreeTrial",
4849
"InquiriesCreateInquiryPayload",
4950
"InquiryBecomeVendor",
5051
"InquiryContactSales",
@@ -127,6 +128,7 @@
127128
from stackit.stackitmarketplace.models.error_response import (
128129
ErrorResponse as ErrorResponse,
129130
)
131+
from stackit.stackitmarketplace.models.free_trial import FreeTrial as FreeTrial
130132
from stackit.stackitmarketplace.models.inquiries_create_inquiry_payload import (
131133
InquiriesCreateInquiryPayload as InquiriesCreateInquiryPayload,
132134
)

services/stackitmarketplace/src/stackit/stackitmarketplace/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
from stackit.stackitmarketplace.models.contact_sales import ContactSales
5454
from stackit.stackitmarketplace.models.delivery_method import DeliveryMethod
5555
from stackit.stackitmarketplace.models.error_response import ErrorResponse
56+
from stackit.stackitmarketplace.models.free_trial import FreeTrial
5657
from stackit.stackitmarketplace.models.inquiries_create_inquiry_payload import (
5758
InquiriesCreateInquiryPayload,
5859
)

services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_overview.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
CatalogProductOverviewVendor,
3434
)
3535
from stackit.stackitmarketplace.models.delivery_method import DeliveryMethod
36+
from stackit.stackitmarketplace.models.free_trial import FreeTrial
3637
from stackit.stackitmarketplace.models.product_lifecycle_state import (
3738
ProductLifecycleState,
3839
)
@@ -44,6 +45,7 @@ class CatalogProductOverview(BaseModel):
4445
""" # noqa: E501
4546

4647
delivery_method: DeliveryMethod = Field(alias="deliveryMethod")
48+
free_trial: Optional[FreeTrial] = Field(default=None, alias="freeTrial")
4749
lifecycle_state: ProductLifecycleState = Field(alias="lifecycleState")
4850
logo: Optional[Union[StrictBytes, StrictStr]] = Field(default=None, description="The logo base64 encoded.")
4951
name: Annotated[str, Field(strict=True, max_length=512)] = Field(description="The name of the product.")
@@ -54,6 +56,7 @@ class CatalogProductOverview(BaseModel):
5456
vendor: CatalogProductOverviewVendor
5557
__properties: ClassVar[List[str]] = [
5658
"deliveryMethod",
59+
"freeTrial",
5760
"lifecycleState",
5861
"logo",
5962
"name",
@@ -120,6 +123,9 @@ def to_dict(self) -> Dict[str, Any]:
120123
exclude=excluded_fields,
121124
exclude_none=True,
122125
)
126+
# override the default output from pydantic by calling `to_dict()` of free_trial
127+
if self.free_trial:
128+
_dict["freeTrial"] = self.free_trial.to_dict()
123129
# override the default output from pydantic by calling `to_dict()` of vendor
124130
if self.vendor:
125131
_dict["vendor"] = self.vendor.to_dict()
@@ -137,6 +143,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
137143
_obj = cls.model_validate(
138144
{
139145
"deliveryMethod": obj.get("deliveryMethod"),
146+
"freeTrial": FreeTrial.from_dict(obj["freeTrial"]) if obj.get("freeTrial") is not None else None,
140147
"lifecycleState": obj.get("lifecycleState"),
141148
"logo": obj.get("logo"),
142149
"name": obj.get("name"),
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# coding: utf-8
2+
3+
"""
4+
STACKIT Marketplace API
5+
6+
API to manage STACKIT Marketplace.
7+
8+
The version of the OpenAPI document: 1
9+
10+
Generated by OpenAPI Generator (https://openapi-generator.tech)
11+
12+
Do not edit the class manually.
13+
""" # noqa: E501
14+
15+
from __future__ import annotations
16+
17+
import json
18+
import pprint
19+
from typing import Any, ClassVar, Dict, List, Optional, Set
20+
21+
from pydantic import BaseModel, ConfigDict, StrictInt
22+
from typing_extensions import Self
23+
24+
25+
class FreeTrial(BaseModel):
26+
"""
27+
The amount of days of free trial highlighted in the product card.
28+
""" # noqa: E501
29+
30+
value: Optional[StrictInt] = None
31+
__properties: ClassVar[List[str]] = ["value"]
32+
33+
model_config = ConfigDict(
34+
populate_by_name=True,
35+
validate_assignment=True,
36+
protected_namespaces=(),
37+
)
38+
39+
def to_str(self) -> str:
40+
"""Returns the string representation of the model using alias"""
41+
return pprint.pformat(self.model_dump(by_alias=True))
42+
43+
def to_json(self) -> str:
44+
"""Returns the JSON representation of the model using alias"""
45+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
46+
return json.dumps(self.to_dict())
47+
48+
@classmethod
49+
def from_json(cls, json_str: str) -> Optional[Self]:
50+
"""Create an instance of FreeTrial from a JSON string"""
51+
return cls.from_dict(json.loads(json_str))
52+
53+
def to_dict(self) -> Dict[str, Any]:
54+
"""Return the dictionary representation of the model using alias.
55+
56+
This has the following differences from calling pydantic's
57+
`self.model_dump(by_alias=True)`:
58+
59+
* `None` is only added to the output dict for nullable fields that
60+
were set at model initialization. Other fields with value `None`
61+
are ignored.
62+
"""
63+
excluded_fields: Set[str] = set([])
64+
65+
_dict = self.model_dump(
66+
by_alias=True,
67+
exclude=excluded_fields,
68+
exclude_none=True,
69+
)
70+
return _dict
71+
72+
@classmethod
73+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
74+
"""Create an instance of FreeTrial from a dict"""
75+
if obj is None:
76+
return None
77+
78+
if not isinstance(obj, dict):
79+
return cls.model_validate(obj)
80+
81+
_obj = cls.model_validate({"value": obj.get("value")})
82+
return _obj

0 commit comments

Comments
 (0)