From aeb517b9a975483d6f5f3b74e39c3a073eab728e Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Tue, 27 Oct 2026 14:13:37 +0000 Subject: [PATCH] Generate mongodbflex --- services/mongodbflex/oas_commit | 2 +- .../src/stackit/mongodbflex/__init__.py | 2 + .../stackit/mongodbflex/models/__init__.py | 1 + .../models/partial_update_instance_payload.py | 6 +- .../mongodbflex/models/storage_update.py | 88 +++++++++++++++++++ .../models/update_instance_payload.py | 6 +- 6 files changed, 98 insertions(+), 7 deletions(-) create mode 100644 services/mongodbflex/src/stackit/mongodbflex/models/storage_update.py diff --git a/services/mongodbflex/oas_commit b/services/mongodbflex/oas_commit index 6e745cd65..06fd33893 100644 --- a/services/mongodbflex/oas_commit +++ b/services/mongodbflex/oas_commit @@ -1 +1 @@ -9873a8f7a4120017699e43baba2e8b2af7bca93e +3d55d58fe8607afa4f894077e1e5c0a19ef57b3f diff --git a/services/mongodbflex/src/stackit/mongodbflex/__init__.py b/services/mongodbflex/src/stackit/mongodbflex/__init__.py index 7a3527de6..37737f9e3 100644 --- a/services/mongodbflex/src/stackit/mongodbflex/__init__.py +++ b/services/mongodbflex/src/stackit/mongodbflex/__init__.py @@ -71,6 +71,7 @@ "SlowQuery", "Storage", "StorageRange", + "StorageUpdate", "SuggestedIndex", "UpdateBackupSchedulePayload", "UpdateInstancePayload", @@ -193,6 +194,7 @@ from stackit.mongodbflex.models.slow_query import SlowQuery as SlowQuery from stackit.mongodbflex.models.storage import Storage as Storage from stackit.mongodbflex.models.storage_range import StorageRange as StorageRange +from stackit.mongodbflex.models.storage_update import StorageUpdate as StorageUpdate from stackit.mongodbflex.models.suggested_index import SuggestedIndex as SuggestedIndex from stackit.mongodbflex.models.update_backup_schedule_payload import ( UpdateBackupSchedulePayload as UpdateBackupSchedulePayload, diff --git a/services/mongodbflex/src/stackit/mongodbflex/models/__init__.py b/services/mongodbflex/src/stackit/mongodbflex/models/__init__.py index 86c1d2e8d..b90ad73be 100644 --- a/services/mongodbflex/src/stackit/mongodbflex/models/__init__.py +++ b/services/mongodbflex/src/stackit/mongodbflex/models/__init__.py @@ -67,6 +67,7 @@ from stackit.mongodbflex.models.slow_query import SlowQuery from stackit.mongodbflex.models.storage import Storage from stackit.mongodbflex.models.storage_range import StorageRange +from stackit.mongodbflex.models.storage_update import StorageUpdate from stackit.mongodbflex.models.suggested_index import SuggestedIndex from stackit.mongodbflex.models.update_backup_schedule_payload import ( UpdateBackupSchedulePayload, diff --git a/services/mongodbflex/src/stackit/mongodbflex/models/partial_update_instance_payload.py b/services/mongodbflex/src/stackit/mongodbflex/models/partial_update_instance_payload.py index 54206d4cc..3eeb47527 100644 --- a/services/mongodbflex/src/stackit/mongodbflex/models/partial_update_instance_payload.py +++ b/services/mongodbflex/src/stackit/mongodbflex/models/partial_update_instance_payload.py @@ -24,7 +24,7 @@ from typing_extensions import Annotated, Self from stackit.mongodbflex.models.acl import ACL -from stackit.mongodbflex.models.storage import Storage +from stackit.mongodbflex.models.storage_update import StorageUpdate class PartialUpdateInstancePayload(BaseModel): @@ -39,7 +39,7 @@ class PartialUpdateInstancePayload(BaseModel): name: Optional[Annotated[str, Field(min_length=3, strict=True, max_length=63)]] = None options: Optional[Dict[str, StrictStr]] = None replicas: Optional[StrictInt] = None - storage: Optional[Storage] = None + storage: Optional[StorageUpdate] = None version: Optional[StrictStr] = None __properties: ClassVar[List[str]] = [ "acl", @@ -129,7 +129,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "name": obj.get("name"), "options": obj.get("options"), "replicas": obj.get("replicas"), - "storage": Storage.from_dict(obj["storage"]) if obj.get("storage") is not None else None, + "storage": StorageUpdate.from_dict(obj["storage"]) if obj.get("storage") is not None else None, "version": obj.get("version"), } ) diff --git a/services/mongodbflex/src/stackit/mongodbflex/models/storage_update.py b/services/mongodbflex/src/stackit/mongodbflex/models/storage_update.py new file mode 100644 index 000000000..9ce6fcbca --- /dev/null +++ b/services/mongodbflex/src/stackit/mongodbflex/models/storage_update.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" +STACKIT MongoDB Service API + +This is the documentation for the STACKIT MongoDB Flex Service API + +The version of the OpenAPI document: 2.0.0 +Contact: support@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, Field, StrictInt, StrictStr +from pydantic_core import to_jsonable_python +from typing_extensions import Self + + +class StorageUpdate(BaseModel): + """ + StorageUpdate + """ # noqa: E501 + + var_class: Optional[StrictStr] = Field( + default=None, + description="DEPRECATED: Starting November 2026, the API will reject requests that attempt to modify the storage class.", + alias="class", + ) + size: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["class", "size"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of StorageUpdate 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 StorageUpdate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"class": obj.get("class"), "size": obj.get("size")}) + return _obj diff --git a/services/mongodbflex/src/stackit/mongodbflex/models/update_instance_payload.py b/services/mongodbflex/src/stackit/mongodbflex/models/update_instance_payload.py index 62edc37e4..380013007 100644 --- a/services/mongodbflex/src/stackit/mongodbflex/models/update_instance_payload.py +++ b/services/mongodbflex/src/stackit/mongodbflex/models/update_instance_payload.py @@ -24,7 +24,7 @@ from typing_extensions import Annotated, Self from stackit.mongodbflex.models.acl import ACL -from stackit.mongodbflex.models.storage import Storage +from stackit.mongodbflex.models.storage_update import StorageUpdate class UpdateInstancePayload(BaseModel): @@ -39,7 +39,7 @@ class UpdateInstancePayload(BaseModel): name: Annotated[str, Field(min_length=3, strict=True, max_length=63)] options: Dict[str, StrictStr] replicas: StrictInt - storage: Storage + storage: StorageUpdate version: StrictStr __properties: ClassVar[List[str]] = [ "acl", @@ -126,7 +126,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "name": obj.get("name"), "options": obj.get("options"), "replicas": obj.get("replicas"), - "storage": Storage.from_dict(obj["storage"]) if obj.get("storage") is not None else None, + "storage": StorageUpdate.from_dict(obj["storage"]) if obj.get("storage") is not None else None, "version": obj.get("version"), } )