Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Generator: Update SDK /services/stackitmarketplace#2276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
Show file tree
Hide file tree
Changes fromall 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
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -51,6 +51,7 @@
"InquiryContactSales",
"InquiryFormType",
"InquiryRegisterTesting",
"InquiryRequestPrivatePlan",
"InquirySuggestProduct",
"ListCatalogProductsResponse",
"ListVendorSubscriptionsResponse",
Expand All@@ -61,6 +62,7 @@
"PricingOptionUnit",
"ProductLifecycleState",
"RegisterTesting",
"RequestPrivatePlan",
"ResolveCustomerPayload",
"ServiceCertificate",
"SubscriptionLifecycleState",
Expand DownExpand Up@@ -144,6 +146,9 @@
from stackit.stackitmarketplace.models.inquiry_register_testing import (
InquiryRegisterTesting as InquiryRegisterTesting,
)
from stackit.stackitmarketplace.models.inquiry_request_private_plan import (
InquiryRequestPrivatePlan as InquiryRequestPrivatePlan,
)
from stackit.stackitmarketplace.models.inquiry_suggest_product import (
InquirySuggestProduct as InquirySuggestProduct,
)
Expand All@@ -168,6 +173,9 @@
from stackit.stackitmarketplace.models.register_testing import (
RegisterTesting as RegisterTesting,
)
from stackit.stackitmarketplace.models.request_private_plan import (
RequestPrivatePlan as RequestPrivatePlan,
)
from stackit.stackitmarketplace.models.resolve_customer_payload import (
ResolveCustomerPayload as ResolveCustomerPayload,
)
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -873,7 +873,7 @@ def inquiries_create_inquiry(
) -> None:
"""Create inquiry

Create an inquiry to contact sales, become a vendor, or suggest a product. Requests are limited to 10 per 5 minutes.
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.

:param inquiries_create_inquiry_payload: (required)
:type inquiries_create_inquiry_payload: InquiriesCreateInquiryPayload
Expand DownExpand Up@@ -937,7 +937,7 @@ def inquiries_create_inquiry_with_http_info(
) -> ApiResponse[None]:
"""Create inquiry

Create an inquiry to contact sales, become a vendor, or suggest a product. Requests are limited to 10 per 5 minutes.
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.

:param inquiries_create_inquiry_payload: (required)
:type inquiries_create_inquiry_payload: InquiriesCreateInquiryPayload
Expand DownExpand Up@@ -1001,7 +1001,7 @@ def inquiries_create_inquiry_without_preload_content(
) -> RESTResponseType:
"""Create inquiry

Create an inquiry to contact sales, become a vendor, or suggest a product. Requests are limited to 10 per 5 minutes.
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.

:param inquiries_create_inquiry_payload: (required)
:type inquiries_create_inquiry_payload: InquiriesCreateInquiryPayload
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -63,6 +63,9 @@
from stackit.stackitmarketplace.models.inquiry_register_testing import (
InquiryRegisterTesting,
)
from stackit.stackitmarketplace.models.inquiry_request_private_plan import (
InquiryRequestPrivatePlan,
)
from stackit.stackitmarketplace.models.inquiry_suggest_product import (
InquirySuggestProduct,
)
Expand All@@ -81,6 +84,7 @@
ProductLifecycleState,
)
from stackit.stackitmarketplace.models.register_testing import RegisterTesting
from stackit.stackitmarketplace.models.request_private_plan import RequestPrivatePlan
from stackit.stackitmarketplace.models.resolve_customer_payload import (
ResolveCustomerPayload,
)
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,10 +29,17 @@
from stackit.stackitmarketplace.models.become_vendor import BecomeVendor
from stackit.stackitmarketplace.models.contact_sales import ContactSales
from stackit.stackitmarketplace.models.register_testing import RegisterTesting
from stackit.stackitmarketplace.models.request_private_plan import RequestPrivatePlan
from stackit.stackitmarketplace.models.suggest_product import SuggestProduct


INQUIRIESCREATEINQUIRYPAYLOAD_ONE_OF_SCHEMAS = ["BecomeVendor", "ContactSales", "RegisterTesting", "SuggestProduct"]
INQUIRIESCREATEINQUIRYPAYLOAD_ONE_OF_SCHEMAS = [
"BecomeVendor",
"ContactSales",
"RegisterTesting",
"RequestPrivatePlan",
"SuggestProduct",
]


class InquiriesCreateInquiryPayload(BaseModel):
Expand All@@ -46,10 +53,20 @@ class InquiriesCreateInquiryPayload(BaseModel):
oneof_schema_2_validator: Optional[ContactSales] = None
# data type: BecomeVendor
oneof_schema_3_validator: Optional[BecomeVendor] = None
# data type: RequestPrivatePlan
oneof_schema_4_validator: Optional[RequestPrivatePlan] = None
# data type: RegisterTesting
oneof_schema_4_validator: Optional[RegisterTesting] = None
actual_instance: Optional[Union[BecomeVendor, ContactSales, RegisterTesting, SuggestProduct]] = None
one_of_schemas: Set[str] = {"BecomeVendor", "ContactSales", "RegisterTesting", "SuggestProduct"}
oneof_schema_5_validator: Optional[RegisterTesting] = None
actual_instance: Optional[
Union[BecomeVendor, ContactSales, RegisterTesting, RequestPrivatePlan, SuggestProduct]
] = None
one_of_schemas: Set[str] = {
"BecomeVendor",
"ContactSales",
"RegisterTesting",
"RequestPrivatePlan",
"SuggestProduct",
}

model_config = ConfigDict(
validate_assignment=True,
Expand DownExpand Up@@ -86,6 +103,11 @@ def actual_instance_must_validate_oneof(cls, v):
error_messages.append(f"Error! Input type `{type(v)}` is not `BecomeVendor`")
else:
match += 1
# validate data type: RequestPrivatePlan
if not isinstance(v, RequestPrivatePlan):
error_messages.append(f"Error! Input type `{type(v)}` is not `RequestPrivatePlan`")
else:
match += 1
# validate data type: RegisterTesting
if not isinstance(v, RegisterTesting):
error_messages.append(f"Error! Input type `{type(v)}` is not `RegisterTesting`")
Expand All@@ -94,7 +116,7 @@ def actual_instance_must_validate_oneof(cls, v):
if match == 0:
# no match
raise ValueError(
"No match found when setting `actual_instance` in InquiriesCreateInquiryPayload with oneOf schemas: BecomeVendor, ContactSales, RegisterTesting, SuggestProduct. Details: "
"No match found when setting `actual_instance` in InquiriesCreateInquiryPayload with oneOf schemas: BecomeVendor, ContactSales, RegisterTesting,RequestPrivatePlan,SuggestProduct. Details: "
+ ", ".join(error_messages)
)
else:
Expand DownExpand Up@@ -129,6 +151,12 @@ def from_json(cls, json_str: str) -> Self:
match += 1
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# deserialize data into RequestPrivatePlan
try:
instance.actual_instance = RequestPrivatePlan.from_json(json_str)
match += 1
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# deserialize data into RegisterTesting
try:
instance.actual_instance = RegisterTesting.from_json(json_str)
Expand All@@ -139,13 +167,13 @@ def from_json(cls, json_str: str) -> Self:
if match > 1:
# more than 1 match
raise ValueError(
"Multiple matches found when deserializing the JSON string into InquiriesCreateInquiryPayload with oneOf schemas: BecomeVendor, ContactSales, RegisterTesting, SuggestProduct. Details: "
"Multiple matches found when deserializing the JSON string into InquiriesCreateInquiryPayload with oneOf schemas: BecomeVendor, ContactSales, RegisterTesting,RequestPrivatePlan,SuggestProduct. Details: "
+ ", ".join(error_messages)
)
elif match == 0:
# no match
raise ValueError(
"No match found when deserializing the JSON string into InquiriesCreateInquiryPayload with oneOf schemas: BecomeVendor, ContactSales, RegisterTesting, SuggestProduct. Details: "
"No match found when deserializing the JSON string into InquiriesCreateInquiryPayload with oneOf schemas: BecomeVendor, ContactSales, RegisterTesting,RequestPrivatePlan,SuggestProduct. Details: "
+ ", ".join(error_messages)
)
else:
Expand All@@ -161,7 +189,11 @@ def to_json(self) -> str:
else:
return json.dumps(self.actual_instance)

def to_dict(self) -> Optional[Union[Dict[str, Any], BecomeVendor, ContactSales, RegisterTesting, SuggestProduct]]:
def to_dict(
self,
) -> Optional[
Union[Dict[str, Any], BecomeVendor, ContactSales, RegisterTesting, RequestPrivatePlan, SuggestProduct]
]:
"""Returns the dict representation of the actual instance"""
if self.actual_instance is None:
return None
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -32,6 +32,7 @@ class InquiryFormType(str, Enum):
CONTACT_SALES = "CONTACT_SALES"
BECOME_VENDOR = "BECOME_VENDOR"
REGISTER_TESTING = "REGISTER_TESTING"
REQUEST_PRIVATE_PLAN = "REQUEST_PRIVATE_PLAN"

@classmethod
def from_json(cls, json_str: str) -> Self:
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
# 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
import re # noqa: F401
from typing import Any, ClassVar, Dict, List, Optional, Set

from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
from typing_extensions import Annotated, Self


class InquiryRequestPrivatePlan(BaseModel):
"""
Request a private plan.
""" # noqa: E501

company_name: Annotated[str, Field(strict=True, max_length=512)] = Field(
description="The company name.", alias="companyName"
)
contact_email: StrictStr = Field(description="A e-mail address.", alias="contactEmail")
full_name: Annotated[str, Field(strict=True, max_length=512)] = Field(
description="The full name of the contact person.", alias="fullName"
)
message: Annotated[str, Field(strict=True, max_length=512)] = Field(description="A custom message.")
product_id: Annotated[str, Field(min_length=10, strict=True, max_length=29)] = Field(
description="The user-readable product ID.", alias="productId"
)
__properties: ClassVar[List[str]] = ["companyName", "contactEmail", "fullName", "message", "productId"]

@field_validator("company_name")
def company_name_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^[a-zA-ZäüöÄÜÖ0-9,.!?()@\/:=\n\t -]+$", value):
raise ValueError(r"must validate the regular expression /^[a-zA-ZäüöÄÜÖ0-9,.!?()@\/:=\n\t -]+$/")
return value

@field_validator("full_name")
def full_name_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^[a-zA-ZäüöÄÜÖ0-9,.!?()@\/:=\n\t -]+$", value):
raise ValueError(r"must validate the regular expression /^[a-zA-ZäüöÄÜÖ0-9,.!?()@\/:=\n\t -]+$/")
return value

@field_validator("message")
def message_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^[a-zA-ZäüöÄÜÖ0-9,.!?()@\/:=\n\t -]+$", value):
raise ValueError(r"must validate the regular expression /^[a-zA-ZäüöÄÜÖ0-9,.!?()@\/:=\n\t -]+$/")
return value

@field_validator("product_id")
def product_id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^[a-z0-9-]{1,20}-[0-9a-f]{8}$", value):
raise ValueError(r"must validate the regular expression /^[a-z0-9-]{1,20}-[0-9a-f]{8}$/")
return 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 InquiryRequestPrivatePlan 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 InquiryRequestPrivatePlan from a dict"""
if obj is None:
return None

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

_obj = cls.model_validate(
{
"companyName": obj.get("companyName"),
"contactEmail": obj.get("contactEmail"),
"fullName": obj.get("fullName"),
"message": obj.get("message"),
"productId": obj.get("productId"),
}
)
return _obj
Loading

[8]ページ先頭

©2009-2025 Movatter.jp