Skip to content

Commit c3e1cd5

Browse files
Generate stackitmarketplace
1 parent cf47200 commit c3e1cd5

File tree

7 files changed

+285
-11
lines changed

7 files changed

+285
-11
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"InquiryContactSales",
5252
"InquiryFormType",
5353
"InquiryRegisterTesting",
54+
"InquiryRequestPrivatePlan",
5455
"InquirySuggestProduct",
5556
"ListCatalogProductsResponse",
5657
"ListVendorSubscriptionsResponse",
@@ -61,6 +62,7 @@
6162
"PricingOptionUnit",
6263
"ProductLifecycleState",
6364
"RegisterTesting",
65+
"RequestPrivatePlan",
6466
"ResolveCustomerPayload",
6567
"ServiceCertificate",
6668
"SubscriptionLifecycleState",
@@ -144,6 +146,9 @@
144146
from stackit.stackitmarketplace.models.inquiry_register_testing import (
145147
InquiryRegisterTesting as InquiryRegisterTesting,
146148
)
149+
from stackit.stackitmarketplace.models.inquiry_request_private_plan import (
150+
InquiryRequestPrivatePlan as InquiryRequestPrivatePlan,
151+
)
147152
from stackit.stackitmarketplace.models.inquiry_suggest_product import (
148153
InquirySuggestProduct as InquirySuggestProduct,
149154
)
@@ -168,6 +173,9 @@
168173
from stackit.stackitmarketplace.models.register_testing import (
169174
RegisterTesting as RegisterTesting,
170175
)
176+
from stackit.stackitmarketplace.models.request_private_plan import (
177+
RequestPrivatePlan as RequestPrivatePlan,
178+
)
171179
from stackit.stackitmarketplace.models.resolve_customer_payload import (
172180
ResolveCustomerPayload as ResolveCustomerPayload,
173181
)

services/stackitmarketplace/src/stackit/stackitmarketplace/api/default_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,7 @@ def inquiries_create_inquiry(
873873
) -> None:
874874
"""Create inquiry
875875
876-
Create an inquiry to contact sales, become a vendor, or suggest a product. Requests are limited to 10 per 5 minutes.
876+
Create an inquiry to contact sales, become a vendor, request a private plan, register for testing, or suggest a product. Requests are limited to 10 per 5 minutes.
877877
878878
:param inquiries_create_inquiry_payload: (required)
879879
:type inquiries_create_inquiry_payload: InquiriesCreateInquiryPayload
@@ -937,7 +937,7 @@ def inquiries_create_inquiry_with_http_info(
937937
) -> ApiResponse[None]:
938938
"""Create inquiry
939939
940-
Create an inquiry to contact sales, become a vendor, or suggest a product. Requests are limited to 10 per 5 minutes.
940+
Create an inquiry to contact sales, become a vendor, request a private plan, register for testing, or suggest a product. Requests are limited to 10 per 5 minutes.
941941
942942
:param inquiries_create_inquiry_payload: (required)
943943
:type inquiries_create_inquiry_payload: InquiriesCreateInquiryPayload
@@ -1001,7 +1001,7 @@ def inquiries_create_inquiry_without_preload_content(
10011001
) -> RESTResponseType:
10021002
"""Create inquiry
10031003
1004-
Create an inquiry to contact sales, become a vendor, or suggest a product. Requests are limited to 10 per 5 minutes.
1004+
Create an inquiry to contact sales, become a vendor, request a private plan, register for testing, or suggest a product. Requests are limited to 10 per 5 minutes.
10051005
10061006
:param inquiries_create_inquiry_payload: (required)
10071007
:type inquiries_create_inquiry_payload: InquiriesCreateInquiryPayload

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@
6363
from stackit.stackitmarketplace.models.inquiry_register_testing import (
6464
InquiryRegisterTesting,
6565
)
66+
from stackit.stackitmarketplace.models.inquiry_request_private_plan import (
67+
InquiryRequestPrivatePlan,
68+
)
6669
from stackit.stackitmarketplace.models.inquiry_suggest_product import (
6770
InquirySuggestProduct,
6871
)
@@ -81,6 +84,7 @@
8184
ProductLifecycleState,
8285
)
8386
from stackit.stackitmarketplace.models.register_testing import RegisterTesting
87+
from stackit.stackitmarketplace.models.request_private_plan import RequestPrivatePlan
8488
from stackit.stackitmarketplace.models.resolve_customer_payload import (
8589
ResolveCustomerPayload,
8690
)

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

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,17 @@
2929
from stackit.stackitmarketplace.models.become_vendor import BecomeVendor
3030
from stackit.stackitmarketplace.models.contact_sales import ContactSales
3131
from stackit.stackitmarketplace.models.register_testing import RegisterTesting
32+
from stackit.stackitmarketplace.models.request_private_plan import RequestPrivatePlan
3233
from stackit.stackitmarketplace.models.suggest_product import SuggestProduct
3334

3435

35-
INQUIRIESCREATEINQUIRYPAYLOAD_ONE_OF_SCHEMAS = ["BecomeVendor", "ContactSales", "RegisterTesting", "SuggestProduct"]
36+
INQUIRIESCREATEINQUIRYPAYLOAD_ONE_OF_SCHEMAS = [
37+
"BecomeVendor",
38+
"ContactSales",
39+
"RegisterTesting",
40+
"RequestPrivatePlan",
41+
"SuggestProduct",
42+
]
3643

3744

3845
class InquiriesCreateInquiryPayload(BaseModel):
@@ -46,10 +53,20 @@ class InquiriesCreateInquiryPayload(BaseModel):
4653
oneof_schema_2_validator: Optional[ContactSales] = None
4754
# data type: BecomeVendor
4855
oneof_schema_3_validator: Optional[BecomeVendor] = None
56+
# data type: RequestPrivatePlan
57+
oneof_schema_4_validator: Optional[RequestPrivatePlan] = None
4958
# data type: RegisterTesting
50-
oneof_schema_4_validator: Optional[RegisterTesting] = None
51-
actual_instance: Optional[Union[BecomeVendor, ContactSales, RegisterTesting, SuggestProduct]] = None
52-
one_of_schemas: Set[str] = {"BecomeVendor", "ContactSales", "RegisterTesting", "SuggestProduct"}
59+
oneof_schema_5_validator: Optional[RegisterTesting] = None
60+
actual_instance: Optional[
61+
Union[BecomeVendor, ContactSales, RegisterTesting, RequestPrivatePlan, SuggestProduct]
62+
] = None
63+
one_of_schemas: Set[str] = {
64+
"BecomeVendor",
65+
"ContactSales",
66+
"RegisterTesting",
67+
"RequestPrivatePlan",
68+
"SuggestProduct",
69+
}
5370

5471
model_config = ConfigDict(
5572
validate_assignment=True,
@@ -86,6 +103,11 @@ def actual_instance_must_validate_oneof(cls, v):
86103
error_messages.append(f"Error! Input type `{type(v)}` is not `BecomeVendor`")
87104
else:
88105
match += 1
106+
# validate data type: RequestPrivatePlan
107+
if not isinstance(v, RequestPrivatePlan):
108+
error_messages.append(f"Error! Input type `{type(v)}` is not `RequestPrivatePlan`")
109+
else:
110+
match += 1
89111
# validate data type: RegisterTesting
90112
if not isinstance(v, RegisterTesting):
91113
error_messages.append(f"Error! Input type `{type(v)}` is not `RegisterTesting`")
@@ -94,7 +116,7 @@ def actual_instance_must_validate_oneof(cls, v):
94116
if match == 0:
95117
# no match
96118
raise ValueError(
97-
"No match found when setting `actual_instance` in InquiriesCreateInquiryPayload with oneOf schemas: BecomeVendor, ContactSales, RegisterTesting, SuggestProduct. Details: "
119+
"No match found when setting `actual_instance` in InquiriesCreateInquiryPayload with oneOf schemas: BecomeVendor, ContactSales, RegisterTesting, RequestPrivatePlan, SuggestProduct. Details: "
98120
+ ", ".join(error_messages)
99121
)
100122
else:
@@ -129,6 +151,12 @@ def from_json(cls, json_str: str) -> Self:
129151
match += 1
130152
except (ValidationError, ValueError) as e:
131153
error_messages.append(str(e))
154+
# deserialize data into RequestPrivatePlan
155+
try:
156+
instance.actual_instance = RequestPrivatePlan.from_json(json_str)
157+
match += 1
158+
except (ValidationError, ValueError) as e:
159+
error_messages.append(str(e))
132160
# deserialize data into RegisterTesting
133161
try:
134162
instance.actual_instance = RegisterTesting.from_json(json_str)
@@ -139,13 +167,13 @@ def from_json(cls, json_str: str) -> Self:
139167
if match > 1:
140168
# more than 1 match
141169
raise ValueError(
142-
"Multiple matches found when deserializing the JSON string into InquiriesCreateInquiryPayload with oneOf schemas: BecomeVendor, ContactSales, RegisterTesting, SuggestProduct. Details: "
170+
"Multiple matches found when deserializing the JSON string into InquiriesCreateInquiryPayload with oneOf schemas: BecomeVendor, ContactSales, RegisterTesting, RequestPrivatePlan, SuggestProduct. Details: "
143171
+ ", ".join(error_messages)
144172
)
145173
elif match == 0:
146174
# no match
147175
raise ValueError(
148-
"No match found when deserializing the JSON string into InquiriesCreateInquiryPayload with oneOf schemas: BecomeVendor, ContactSales, RegisterTesting, SuggestProduct. Details: "
176+
"No match found when deserializing the JSON string into InquiriesCreateInquiryPayload with oneOf schemas: BecomeVendor, ContactSales, RegisterTesting, RequestPrivatePlan, SuggestProduct. Details: "
149177
+ ", ".join(error_messages)
150178
)
151179
else:
@@ -161,7 +189,11 @@ def to_json(self) -> str:
161189
else:
162190
return json.dumps(self.actual_instance)
163191

164-
def to_dict(self) -> Optional[Union[Dict[str, Any], BecomeVendor, ContactSales, RegisterTesting, SuggestProduct]]:
192+
def to_dict(
193+
self,
194+
) -> Optional[
195+
Union[Dict[str, Any], BecomeVendor, ContactSales, RegisterTesting, RequestPrivatePlan, SuggestProduct]
196+
]:
165197
"""Returns the dict representation of the actual instance"""
166198
if self.actual_instance is None:
167199
return None

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class InquiryFormType(str, Enum):
3232
CONTACT_SALES = "CONTACT_SALES"
3333
BECOME_VENDOR = "BECOME_VENDOR"
3434
REGISTER_TESTING = "REGISTER_TESTING"
35+
REQUEST_PRIVATE_PLAN = "REQUEST_PRIVATE_PLAN"
3536

3637
@classmethod
3738
def from_json(cls, json_str: str) -> Self:
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
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+
import re # noqa: F401
20+
from typing import Any, ClassVar, Dict, List, Optional, Set
21+
22+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
23+
from typing_extensions import Annotated, Self
24+
25+
26+
class InquiryRequestPrivatePlan(BaseModel):
27+
"""
28+
Request a private plan.
29+
""" # noqa: E501
30+
31+
company_name: Annotated[str, Field(strict=True, max_length=512)] = Field(
32+
description="The company name.", alias="companyName"
33+
)
34+
contact_email: StrictStr = Field(description="A e-mail address.", alias="contactEmail")
35+
full_name: Annotated[str, Field(strict=True, max_length=512)] = Field(
36+
description="The full name of the contact person.", alias="fullName"
37+
)
38+
message: Annotated[str, Field(strict=True, max_length=512)] = Field(description="A custom message.")
39+
product_id: Annotated[str, Field(min_length=10, strict=True, max_length=29)] = Field(
40+
description="The user-readable product ID.", alias="productId"
41+
)
42+
__properties: ClassVar[List[str]] = ["companyName", "contactEmail", "fullName", "message", "productId"]
43+
44+
@field_validator("company_name")
45+
def company_name_validate_regular_expression(cls, value):
46+
"""Validates the regular expression"""
47+
if not re.match(r"^[a-zA-ZäüöÄÜÖ0-9,.!?()@\/:=\n\t -]+$", value):
48+
raise ValueError(r"must validate the regular expression /^[a-zA-ZäüöÄÜÖ0-9,.!?()@\/:=\n\t -]+$/")
49+
return value
50+
51+
@field_validator("full_name")
52+
def full_name_validate_regular_expression(cls, value):
53+
"""Validates the regular expression"""
54+
if not re.match(r"^[a-zA-ZäüöÄÜÖ0-9,.!?()@\/:=\n\t -]+$", value):
55+
raise ValueError(r"must validate the regular expression /^[a-zA-ZäüöÄÜÖ0-9,.!?()@\/:=\n\t -]+$/")
56+
return value
57+
58+
@field_validator("message")
59+
def message_validate_regular_expression(cls, value):
60+
"""Validates the regular expression"""
61+
if not re.match(r"^[a-zA-ZäüöÄÜÖ0-9,.!?()@\/:=\n\t -]+$", value):
62+
raise ValueError(r"must validate the regular expression /^[a-zA-ZäüöÄÜÖ0-9,.!?()@\/:=\n\t -]+$/")
63+
return value
64+
65+
@field_validator("product_id")
66+
def product_id_validate_regular_expression(cls, value):
67+
"""Validates the regular expression"""
68+
if not re.match(r"^[a-z0-9-]{1,20}-[0-9a-f]{8}$", value):
69+
raise ValueError(r"must validate the regular expression /^[a-z0-9-]{1,20}-[0-9a-f]{8}$/")
70+
return value
71+
72+
model_config = ConfigDict(
73+
populate_by_name=True,
74+
validate_assignment=True,
75+
protected_namespaces=(),
76+
)
77+
78+
def to_str(self) -> str:
79+
"""Returns the string representation of the model using alias"""
80+
return pprint.pformat(self.model_dump(by_alias=True))
81+
82+
def to_json(self) -> str:
83+
"""Returns the JSON representation of the model using alias"""
84+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
85+
return json.dumps(self.to_dict())
86+
87+
@classmethod
88+
def from_json(cls, json_str: str) -> Optional[Self]:
89+
"""Create an instance of InquiryRequestPrivatePlan from a JSON string"""
90+
return cls.from_dict(json.loads(json_str))
91+
92+
def to_dict(self) -> Dict[str, Any]:
93+
"""Return the dictionary representation of the model using alias.
94+
95+
This has the following differences from calling pydantic's
96+
`self.model_dump(by_alias=True)`:
97+
98+
* `None` is only added to the output dict for nullable fields that
99+
were set at model initialization. Other fields with value `None`
100+
are ignored.
101+
"""
102+
excluded_fields: Set[str] = set([])
103+
104+
_dict = self.model_dump(
105+
by_alias=True,
106+
exclude=excluded_fields,
107+
exclude_none=True,
108+
)
109+
return _dict
110+
111+
@classmethod
112+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
113+
"""Create an instance of InquiryRequestPrivatePlan from a dict"""
114+
if obj is None:
115+
return None
116+
117+
if not isinstance(obj, dict):
118+
return cls.model_validate(obj)
119+
120+
_obj = cls.model_validate(
121+
{
122+
"companyName": obj.get("companyName"),
123+
"contactEmail": obj.get("contactEmail"),
124+
"fullName": obj.get("fullName"),
125+
"message": obj.get("message"),
126+
"productId": obj.get("productId"),
127+
}
128+
)
129+
return _obj

0 commit comments

Comments
 (0)