Skip to content

Generator: Update SDK /services/mongodbflex #1044

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 5, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
- Added API calls for folder management
- `serverupdate`: [v1.0.1](services/serverupdate/CHANGELOG.md#v101-2025-05-05)
- **Minor change:** Use stderr by default.
- `mongodbflex`: [v1.0.0](services/mongodbflex/CHANGELOG.md#v100-2025-05-05)
- **Breaking Change:** Introduce typed enum constants for status attributes

## Release (2025-04-30)
- `stackitmarketplace`: [v0.4.0](services/stackitmarketplace/CHANGELOG.md#v040-2025-04-16)
Expand Down
3 changes: 3 additions & 0 deletions services/mongodbflex/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## v1.0.0 (2025-05-05)
- **Breaking Change:** Introduce typed enum constants for status attributes

## v0.3.0 (2025-01-21)

- **Breaking change**: Delete endpoint made private.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# coding: utf-8

import sys

import os


"""
STACKIT MongoDB Service API

Expand All @@ -12,8 +17,6 @@
Do not edit the class manually.
""" # noqa: E501 docstring might be too long

import os


class HostConfiguration:
def __init__(
Expand All @@ -30,6 +33,7 @@ def __init__(
"as a function argument instead of being set in the client configuration.\n"
"Once all services have migrated, the methods to specify the region in the client configuration "
"will be removed.",
file=sys.stderr,
)
"""Constructor
"""
Expand Down
14 changes: 12 additions & 2 deletions services/mongodbflex/src/stackit/mongodbflex/models/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import pprint
from typing import Any, ClassVar, Dict, List, Optional, Set

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

from stackit.mongodbflex.models.acl import ACL
Expand All @@ -38,7 +38,7 @@ class Instance(BaseModel):
name: Optional[StrictStr] = None
options: Optional[Dict[str, StrictStr]] = None
replicas: Optional[StrictInt] = None
status: Optional[StrictStr] = None
status: Optional[StrictStr] = Field(default=None, description="The current status of the instance.")
storage: Optional[Storage] = None
version: Optional[StrictStr] = None
__properties: ClassVar[List[str]] = [
Expand All @@ -54,6 +54,16 @@ class Instance(BaseModel):
"version",
]

@field_validator("status")
def status_validate_enum(cls, value):
"""Validates the enum"""
if value is None:
return value

if value not in set(["READY", "PENDING", "PROCESSING", "FAILED", "UNKNOWN"]):
raise ValueError("must be one of enum values ('READY', 'PENDING', 'PROCESSING', 'FAILED', 'UNKNOWN')")
return value

model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import pprint
from typing import Any, ClassVar, Dict, List, Optional, Set

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


Expand All @@ -29,9 +29,19 @@ class InstanceListInstance(BaseModel):

id: Optional[StrictStr] = None
name: Optional[StrictStr] = None
status: Optional[StrictStr] = None
status: Optional[StrictStr] = Field(default=None, description="The current status of the instance.")
__properties: ClassVar[List[str]] = ["id", "name", "status"]

@field_validator("status")
def status_validate_enum(cls, value):
"""Validates the enum"""
if value is None:
return value

if value not in set(["READY", "PENDING", "PROCESSING", "FAILED", "UNKNOWN"]):
raise ValueError("must be one of enum values ('READY', 'PENDING', 'PROCESSING', 'FAILED', 'UNKNOWN')")
return value

model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
Expand Down
Loading