stackit-stackitmarketplace 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. stackit/stackitmarketplace/__init__.py +84 -0
  2. stackit/stackitmarketplace/api/__init__.py +4 -0
  3. stackit/stackitmarketplace/api/default_api.py +1719 -0
  4. stackit/stackitmarketplace/api_client.py +627 -0
  5. stackit/stackitmarketplace/api_response.py +23 -0
  6. stackit/stackitmarketplace/configuration.py +138 -0
  7. stackit/stackitmarketplace/exceptions.py +199 -0
  8. stackit/stackitmarketplace/models/__init__.py +65 -0
  9. stackit/stackitmarketplace/models/catalog_pricing_option_highlight.py +84 -0
  10. stackit/stackitmarketplace/models/catalog_product_detail.py +246 -0
  11. stackit/stackitmarketplace/models/catalog_product_details_vendor.py +96 -0
  12. stackit/stackitmarketplace/models/catalog_product_highlight.py +94 -0
  13. stackit/stackitmarketplace/models/catalog_product_overview.py +132 -0
  14. stackit/stackitmarketplace/models/catalog_product_overview_vendor.py +86 -0
  15. stackit/stackitmarketplace/models/catalog_product_pricing_option.py +146 -0
  16. stackit/stackitmarketplace/models/catalog_product_support_resource.py +89 -0
  17. stackit/stackitmarketplace/models/catalog_product_vendor_terms.py +86 -0
  18. stackit/stackitmarketplace/models/current_subscription_state_response.py +103 -0
  19. stackit/stackitmarketplace/models/error_response.py +95 -0
  20. stackit/stackitmarketplace/models/list_catalog_products_response.py +109 -0
  21. stackit/stackitmarketplace/models/list_vendor_subscriptions_response.py +107 -0
  22. stackit/stackitmarketplace/models/requested_subscription_state_response.py +103 -0
  23. stackit/stackitmarketplace/models/resolve_customer_payload.py +82 -0
  24. stackit/stackitmarketplace/models/subscription_cancel_response.py +109 -0
  25. stackit/stackitmarketplace/models/subscription_product.py +130 -0
  26. stackit/stackitmarketplace/models/vendor_subscription.py +115 -0
  27. stackit/stackitmarketplace/py.typed +0 -0
  28. stackit/stackitmarketplace/rest.py +149 -0
  29. stackit_stackitmarketplace-0.1.0.dist-info/METADATA +44 -0
  30. stackit_stackitmarketplace-0.1.0.dist-info/RECORD +31 -0
  31. stackit_stackitmarketplace-0.1.0.dist-info/WHEEL +4 -0
@@ -0,0 +1,246 @@
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
+ Contact: marketplace@stackit.de
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501 docstring might be too long
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 (
22
+ BaseModel,
23
+ ConfigDict,
24
+ Field,
25
+ StrictBool,
26
+ StrictStr,
27
+ field_validator,
28
+ )
29
+ from typing_extensions import Self
30
+
31
+ from stackit.stackitmarketplace.models.catalog_product_details_vendor import (
32
+ CatalogProductDetailsVendor,
33
+ )
34
+ from stackit.stackitmarketplace.models.catalog_product_highlight import (
35
+ CatalogProductHighlight,
36
+ )
37
+ from stackit.stackitmarketplace.models.catalog_product_pricing_option import (
38
+ CatalogProductPricingOption,
39
+ )
40
+ from stackit.stackitmarketplace.models.catalog_product_support_resource import (
41
+ CatalogProductSupportResource,
42
+ )
43
+ from stackit.stackitmarketplace.models.catalog_product_vendor_terms import (
44
+ CatalogProductVendorTerms,
45
+ )
46
+
47
+
48
+ class CatalogProductDetail(BaseModel):
49
+ """
50
+ CatalogProductDetail
51
+ """
52
+
53
+ categories: Optional[List[StrictStr]] = Field(
54
+ default=None, description="The list of categories associated to the product."
55
+ )
56
+ delivery_method: StrictStr = Field(
57
+ description="The product type. For reference: SAAS - Software as a Service, SAI - STACKIT Application Image",
58
+ alias="deliveryMethod",
59
+ )
60
+ description: StrictStr = Field(description="The product description.")
61
+ documentation_url: StrictStr = Field(description="The documentation URL.", alias="documentationUrl")
62
+ highlights: List[CatalogProductHighlight] = Field(description="The list of highlights.")
63
+ is_product_listing: StrictBool = Field(
64
+ description="If true, the product is not fully integrated but only listed. Product listings may not have prices and support information.",
65
+ alias="isProductListing",
66
+ )
67
+ lifecycle_state: StrictStr = Field(description="The lifecycle state of the product.", alias="lifecycleState")
68
+ logo: StrictStr = Field(description="The logo base64 encoded.")
69
+ name: StrictStr = Field(description="The product name.")
70
+ pricing_options: List[CatalogProductPricingOption] = Field(
71
+ description="The list of pricing options.", alias="pricingOptions"
72
+ )
73
+ product_id: StrictStr = Field(description="The product ID.", alias="productId")
74
+ summary: StrictStr = Field(description="The short summary of the product.")
75
+ support_email: Optional[StrictStr] = Field(
76
+ default=None, description="The e-mail address for support inquiries.", alias="supportEmail"
77
+ )
78
+ support_faq: Optional[StrictStr] = Field(default=None, description="The support FAQ URL.", alias="supportFaq")
79
+ support_phone: Optional[StrictStr] = Field(
80
+ default=None, description="The phone number for support inquiries.", alias="supportPhone"
81
+ )
82
+ support_resources: Optional[List[CatalogProductSupportResource]] = Field(
83
+ default=None, description="The list of support resources.", alias="supportResources"
84
+ )
85
+ vendor: CatalogProductDetailsVendor
86
+ vendor_terms: Optional[List[CatalogProductVendorTerms]] = Field(
87
+ default=None, description="The list of terms of use.", alias="vendorTerms"
88
+ )
89
+ video_url: StrictStr = Field(description="The video URL.", alias="videoUrl")
90
+ __properties: ClassVar[List[str]] = [
91
+ "categories",
92
+ "deliveryMethod",
93
+ "description",
94
+ "documentationUrl",
95
+ "highlights",
96
+ "isProductListing",
97
+ "lifecycleState",
98
+ "logo",
99
+ "name",
100
+ "pricingOptions",
101
+ "productId",
102
+ "summary",
103
+ "supportEmail",
104
+ "supportFaq",
105
+ "supportPhone",
106
+ "supportResources",
107
+ "vendor",
108
+ "vendorTerms",
109
+ "videoUrl",
110
+ ]
111
+
112
+ @field_validator("delivery_method")
113
+ def delivery_method_validate_enum(cls, value):
114
+ """Validates the enum"""
115
+ if value not in set(["SAAS", "KUBERNETES", "SAI", "PROFESSIONAL_SERVICE"]):
116
+ raise ValueError("must be one of enum values ('SAAS', 'KUBERNETES', 'SAI', 'PROFESSIONAL_SERVICE')")
117
+ return value
118
+
119
+ @field_validator("lifecycle_state")
120
+ def lifecycle_state_validate_enum(cls, value):
121
+ """Validates the enum"""
122
+ if value not in set(["PRODUCT_LIVE", "PRODUCT_PREVIEW"]):
123
+ raise ValueError("must be one of enum values ('PRODUCT_LIVE', 'PRODUCT_PREVIEW')")
124
+ return value
125
+
126
+ model_config = ConfigDict(
127
+ populate_by_name=True,
128
+ validate_assignment=True,
129
+ protected_namespaces=(),
130
+ )
131
+
132
+ def to_str(self) -> str:
133
+ """Returns the string representation of the model using alias"""
134
+ return pprint.pformat(self.model_dump(by_alias=True))
135
+
136
+ def to_json(self) -> str:
137
+ """Returns the JSON representation of the model using alias"""
138
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
139
+ return json.dumps(self.to_dict())
140
+
141
+ @classmethod
142
+ def from_json(cls, json_str: str) -> Optional[Self]:
143
+ """Create an instance of CatalogProductDetail from a JSON string"""
144
+ return cls.from_dict(json.loads(json_str))
145
+
146
+ def to_dict(self) -> Dict[str, Any]:
147
+ """Return the dictionary representation of the model using alias.
148
+
149
+ This has the following differences from calling pydantic's
150
+ `self.model_dump(by_alias=True)`:
151
+
152
+ * `None` is only added to the output dict for nullable fields that
153
+ were set at model initialization. Other fields with value `None`
154
+ are ignored.
155
+ """
156
+ excluded_fields: Set[str] = set([])
157
+
158
+ _dict = self.model_dump(
159
+ by_alias=True,
160
+ exclude=excluded_fields,
161
+ exclude_none=True,
162
+ )
163
+ # override the default output from pydantic by calling `to_dict()` of each item in highlights (list)
164
+ _items = []
165
+ if self.highlights:
166
+ for _item in self.highlights:
167
+ if _item:
168
+ _items.append(_item.to_dict())
169
+ _dict["highlights"] = _items
170
+ # override the default output from pydantic by calling `to_dict()` of each item in pricing_options (list)
171
+ _items = []
172
+ if self.pricing_options:
173
+ for _item in self.pricing_options:
174
+ if _item:
175
+ _items.append(_item.to_dict())
176
+ _dict["pricingOptions"] = _items
177
+ # override the default output from pydantic by calling `to_dict()` of each item in support_resources (list)
178
+ _items = []
179
+ if self.support_resources:
180
+ for _item in self.support_resources:
181
+ if _item:
182
+ _items.append(_item.to_dict())
183
+ _dict["supportResources"] = _items
184
+ # override the default output from pydantic by calling `to_dict()` of vendor
185
+ if self.vendor:
186
+ _dict["vendor"] = self.vendor.to_dict()
187
+ # override the default output from pydantic by calling `to_dict()` of each item in vendor_terms (list)
188
+ _items = []
189
+ if self.vendor_terms:
190
+ for _item in self.vendor_terms:
191
+ if _item:
192
+ _items.append(_item.to_dict())
193
+ _dict["vendorTerms"] = _items
194
+ return _dict
195
+
196
+ @classmethod
197
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
198
+ """Create an instance of CatalogProductDetail from a dict"""
199
+ if obj is None:
200
+ return None
201
+
202
+ if not isinstance(obj, dict):
203
+ return cls.model_validate(obj)
204
+
205
+ _obj = cls.model_validate(
206
+ {
207
+ "categories": obj.get("categories"),
208
+ "deliveryMethod": obj.get("deliveryMethod"),
209
+ "description": obj.get("description"),
210
+ "documentationUrl": obj.get("documentationUrl"),
211
+ "highlights": (
212
+ [CatalogProductHighlight.from_dict(_item) for _item in obj["highlights"]]
213
+ if obj.get("highlights") is not None
214
+ else None
215
+ ),
216
+ "isProductListing": obj.get("isProductListing"),
217
+ "lifecycleState": obj.get("lifecycleState"),
218
+ "logo": obj.get("logo"),
219
+ "name": obj.get("name"),
220
+ "pricingOptions": (
221
+ [CatalogProductPricingOption.from_dict(_item) for _item in obj["pricingOptions"]]
222
+ if obj.get("pricingOptions") is not None
223
+ else None
224
+ ),
225
+ "productId": obj.get("productId"),
226
+ "summary": obj.get("summary"),
227
+ "supportEmail": obj.get("supportEmail"),
228
+ "supportFaq": obj.get("supportFaq"),
229
+ "supportPhone": obj.get("supportPhone"),
230
+ "supportResources": (
231
+ [CatalogProductSupportResource.from_dict(_item) for _item in obj["supportResources"]]
232
+ if obj.get("supportResources") is not None
233
+ else None
234
+ ),
235
+ "vendor": (
236
+ CatalogProductDetailsVendor.from_dict(obj["vendor"]) if obj.get("vendor") is not None else None
237
+ ),
238
+ "vendorTerms": (
239
+ [CatalogProductVendorTerms.from_dict(_item) for _item in obj["vendorTerms"]]
240
+ if obj.get("vendorTerms") is not None
241
+ else None
242
+ ),
243
+ "videoUrl": obj.get("videoUrl"),
244
+ }
245
+ )
246
+ return _obj
@@ -0,0 +1,96 @@
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
+ Contact: marketplace@stackit.de
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501 docstring might be too long
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, Field, StrictStr
22
+ from typing_extensions import Self
23
+
24
+
25
+ class CatalogProductDetailsVendor(BaseModel):
26
+ """
27
+ CatalogProductDetailsVendor
28
+ """
29
+
30
+ description: StrictStr = Field(description="The vendor description.")
31
+ logo: StrictStr = Field(description="The vendor logo base64 encoded.")
32
+ name: StrictStr = Field(description="The vendor name.")
33
+ vendor_id: StrictStr = Field(description="The vendor ID.", alias="vendorId")
34
+ video_url: StrictStr = Field(description="The vendor video URL.", alias="videoUrl")
35
+ website_url: StrictStr = Field(description="The vendor website URL.", alias="websiteUrl")
36
+ __properties: ClassVar[List[str]] = ["description", "logo", "name", "vendorId", "videoUrl", "websiteUrl"]
37
+
38
+ model_config = ConfigDict(
39
+ populate_by_name=True,
40
+ validate_assignment=True,
41
+ protected_namespaces=(),
42
+ )
43
+
44
+ def to_str(self) -> str:
45
+ """Returns the string representation of the model using alias"""
46
+ return pprint.pformat(self.model_dump(by_alias=True))
47
+
48
+ def to_json(self) -> str:
49
+ """Returns the JSON representation of the model using alias"""
50
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
51
+ return json.dumps(self.to_dict())
52
+
53
+ @classmethod
54
+ def from_json(cls, json_str: str) -> Optional[Self]:
55
+ """Create an instance of CatalogProductDetailsVendor from a JSON string"""
56
+ return cls.from_dict(json.loads(json_str))
57
+
58
+ def to_dict(self) -> Dict[str, Any]:
59
+ """Return the dictionary representation of the model using alias.
60
+
61
+ This has the following differences from calling pydantic's
62
+ `self.model_dump(by_alias=True)`:
63
+
64
+ * `None` is only added to the output dict for nullable fields that
65
+ were set at model initialization. Other fields with value `None`
66
+ are ignored.
67
+ """
68
+ excluded_fields: Set[str] = set([])
69
+
70
+ _dict = self.model_dump(
71
+ by_alias=True,
72
+ exclude=excluded_fields,
73
+ exclude_none=True,
74
+ )
75
+ return _dict
76
+
77
+ @classmethod
78
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
79
+ """Create an instance of CatalogProductDetailsVendor from a dict"""
80
+ if obj is None:
81
+ return None
82
+
83
+ if not isinstance(obj, dict):
84
+ return cls.model_validate(obj)
85
+
86
+ _obj = cls.model_validate(
87
+ {
88
+ "description": obj.get("description"),
89
+ "logo": obj.get("logo"),
90
+ "name": obj.get("name"),
91
+ "vendorId": obj.get("vendorId"),
92
+ "videoUrl": obj.get("videoUrl"),
93
+ "websiteUrl": obj.get("websiteUrl"),
94
+ }
95
+ )
96
+ return _obj
@@ -0,0 +1,94 @@
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
+ Contact: marketplace@stackit.de
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501 docstring might be too long
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, Field, StrictStr
22
+ from typing_extensions import Self
23
+
24
+
25
+ class CatalogProductHighlight(BaseModel):
26
+ """
27
+ CatalogProductHighlight
28
+ """
29
+
30
+ highlight_content: Optional[StrictStr] = Field(
31
+ default=None, description="The highlight content.", alias="highlightContent"
32
+ )
33
+ highlight_icon: Optional[StrictStr] = Field(default=None, description="The highlight icon.", alias="highlightIcon")
34
+ highlight_title: Optional[StrictStr] = Field(
35
+ default=None, description="The highlight title.", alias="highlightTitle"
36
+ )
37
+ __properties: ClassVar[List[str]] = ["highlightContent", "highlightIcon", "highlightTitle"]
38
+
39
+ model_config = ConfigDict(
40
+ populate_by_name=True,
41
+ validate_assignment=True,
42
+ protected_namespaces=(),
43
+ )
44
+
45
+ def to_str(self) -> str:
46
+ """Returns the string representation of the model using alias"""
47
+ return pprint.pformat(self.model_dump(by_alias=True))
48
+
49
+ def to_json(self) -> str:
50
+ """Returns the JSON representation of the model using alias"""
51
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52
+ return json.dumps(self.to_dict())
53
+
54
+ @classmethod
55
+ def from_json(cls, json_str: str) -> Optional[Self]:
56
+ """Create an instance of CatalogProductHighlight from a JSON string"""
57
+ return cls.from_dict(json.loads(json_str))
58
+
59
+ def to_dict(self) -> Dict[str, Any]:
60
+ """Return the dictionary representation of the model using alias.
61
+
62
+ This has the following differences from calling pydantic's
63
+ `self.model_dump(by_alias=True)`:
64
+
65
+ * `None` is only added to the output dict for nullable fields that
66
+ were set at model initialization. Other fields with value `None`
67
+ are ignored.
68
+ """
69
+ excluded_fields: Set[str] = set([])
70
+
71
+ _dict = self.model_dump(
72
+ by_alias=True,
73
+ exclude=excluded_fields,
74
+ exclude_none=True,
75
+ )
76
+ return _dict
77
+
78
+ @classmethod
79
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
80
+ """Create an instance of CatalogProductHighlight from a dict"""
81
+ if obj is None:
82
+ return None
83
+
84
+ if not isinstance(obj, dict):
85
+ return cls.model_validate(obj)
86
+
87
+ _obj = cls.model_validate(
88
+ {
89
+ "highlightContent": obj.get("highlightContent"),
90
+ "highlightIcon": obj.get("highlightIcon"),
91
+ "highlightTitle": obj.get("highlightTitle"),
92
+ }
93
+ )
94
+ return _obj
@@ -0,0 +1,132 @@
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
+ Contact: marketplace@stackit.de
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501 docstring might be too long
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, Field, StrictStr, field_validator
22
+ from typing_extensions import Self
23
+
24
+ from stackit.stackitmarketplace.models.catalog_product_overview_vendor import (
25
+ CatalogProductOverviewVendor,
26
+ )
27
+
28
+
29
+ class CatalogProductOverview(BaseModel):
30
+ """
31
+ CatalogProductOverview
32
+ """
33
+
34
+ delivery_method: StrictStr = Field(
35
+ description="The product type. For reference: SAAS - Software as a Service, SAI - STACKIT Application Image",
36
+ alias="deliveryMethod",
37
+ )
38
+ lifecycle_state: StrictStr = Field(description="The lifecycle state of the product.", alias="lifecycleState")
39
+ logo: Optional[StrictStr] = Field(default=None, description="The logo base64 encoded.")
40
+ name: StrictStr = Field(description="The product name.")
41
+ product_id: StrictStr = Field(description="The product ID.", alias="productId")
42
+ summary: StrictStr = Field(description="The short summary of the product.")
43
+ vendor: CatalogProductOverviewVendor
44
+ __properties: ClassVar[List[str]] = [
45
+ "deliveryMethod",
46
+ "lifecycleState",
47
+ "logo",
48
+ "name",
49
+ "productId",
50
+ "summary",
51
+ "vendor",
52
+ ]
53
+
54
+ @field_validator("delivery_method")
55
+ def delivery_method_validate_enum(cls, value):
56
+ """Validates the enum"""
57
+ if value not in set(["SAAS", "KUBERNETES", "SAI", "PROFESSIONAL_SERVICE"]):
58
+ raise ValueError("must be one of enum values ('SAAS', 'KUBERNETES', 'SAI', 'PROFESSIONAL_SERVICE')")
59
+ return value
60
+
61
+ @field_validator("lifecycle_state")
62
+ def lifecycle_state_validate_enum(cls, value):
63
+ """Validates the enum"""
64
+ if value not in set(["PRODUCT_LIVE", "PRODUCT_PREVIEW"]):
65
+ raise ValueError("must be one of enum values ('PRODUCT_LIVE', 'PRODUCT_PREVIEW')")
66
+ return value
67
+
68
+ model_config = ConfigDict(
69
+ populate_by_name=True,
70
+ validate_assignment=True,
71
+ protected_namespaces=(),
72
+ )
73
+
74
+ def to_str(self) -> str:
75
+ """Returns the string representation of the model using alias"""
76
+ return pprint.pformat(self.model_dump(by_alias=True))
77
+
78
+ def to_json(self) -> str:
79
+ """Returns the JSON representation of the model using alias"""
80
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
81
+ return json.dumps(self.to_dict())
82
+
83
+ @classmethod
84
+ def from_json(cls, json_str: str) -> Optional[Self]:
85
+ """Create an instance of CatalogProductOverview from a JSON string"""
86
+ return cls.from_dict(json.loads(json_str))
87
+
88
+ def to_dict(self) -> Dict[str, Any]:
89
+ """Return the dictionary representation of the model using alias.
90
+
91
+ This has the following differences from calling pydantic's
92
+ `self.model_dump(by_alias=True)`:
93
+
94
+ * `None` is only added to the output dict for nullable fields that
95
+ were set at model initialization. Other fields with value `None`
96
+ are ignored.
97
+ """
98
+ excluded_fields: Set[str] = set([])
99
+
100
+ _dict = self.model_dump(
101
+ by_alias=True,
102
+ exclude=excluded_fields,
103
+ exclude_none=True,
104
+ )
105
+ # override the default output from pydantic by calling `to_dict()` of vendor
106
+ if self.vendor:
107
+ _dict["vendor"] = self.vendor.to_dict()
108
+ return _dict
109
+
110
+ @classmethod
111
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
112
+ """Create an instance of CatalogProductOverview from a dict"""
113
+ if obj is None:
114
+ return None
115
+
116
+ if not isinstance(obj, dict):
117
+ return cls.model_validate(obj)
118
+
119
+ _obj = cls.model_validate(
120
+ {
121
+ "deliveryMethod": obj.get("deliveryMethod"),
122
+ "lifecycleState": obj.get("lifecycleState"),
123
+ "logo": obj.get("logo"),
124
+ "name": obj.get("name"),
125
+ "productId": obj.get("productId"),
126
+ "summary": obj.get("summary"),
127
+ "vendor": (
128
+ CatalogProductOverviewVendor.from_dict(obj["vendor"]) if obj.get("vendor") is not None else None
129
+ ),
130
+ }
131
+ )
132
+ return _obj
@@ -0,0 +1,86 @@
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
+ Contact: marketplace@stackit.de
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501 docstring might be too long
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, Field, StrictStr
22
+ from typing_extensions import Self
23
+
24
+
25
+ class CatalogProductOverviewVendor(BaseModel):
26
+ """
27
+ CatalogProductOverviewVendor
28
+ """
29
+
30
+ name: StrictStr = Field(description="The vendor name.")
31
+ vendor_id: StrictStr = Field(description="The vendor ID.", alias="vendorId")
32
+ website_url: StrictStr = Field(description="The vendor website URL.", alias="websiteUrl")
33
+ __properties: ClassVar[List[str]] = ["name", "vendorId", "websiteUrl"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+ def to_str(self) -> str:
42
+ """Returns the string representation of the model using alias"""
43
+ return pprint.pformat(self.model_dump(by_alias=True))
44
+
45
+ def to_json(self) -> str:
46
+ """Returns the JSON representation of the model using alias"""
47
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
+ return json.dumps(self.to_dict())
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of CatalogProductOverviewVendor from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ """
65
+ excluded_fields: Set[str] = set([])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ return _dict
73
+
74
+ @classmethod
75
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
76
+ """Create an instance of CatalogProductOverviewVendor from a dict"""
77
+ if obj is None:
78
+ return None
79
+
80
+ if not isinstance(obj, dict):
81
+ return cls.model_validate(obj)
82
+
83
+ _obj = cls.model_validate(
84
+ {"name": obj.get("name"), "vendorId": obj.get("vendorId"), "websiteUrl": obj.get("websiteUrl")}
85
+ )
86
+ return _obj