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#2267

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@@ -45,6 +45,7 @@
"ContactSales",
"DeliveryMethod",
"ErrorResponse",
"FreeTrial",
"InquiriesCreateInquiryPayload",
"InquiryBecomeVendor",
"InquiryContactSales",
Expand DownExpand 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
View file
Open in desktop
Original file line numberDiff line numberDiff 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 numberDiff line numberDiff 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 DownExpand 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
View file
Open in desktop
Original file line numberDiff line numberDiff 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

[8]ページ先頭

©2009-2025 Movatter.jp