From 53d474605486ade9dabf8fc50c83137bd73eeb6d Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Tue, 17 Jun 2025 14:13:20 +0000 Subject: [PATCH] feat: update generated APIs --- .../mongodb/v1alpha1/__init__.py | 2 + .../mongodb/v1alpha1/marshalling.py | 44 +++++++++++++++++++ .../scaleway_async/mongodb/v1alpha1/types.py | 18 ++++++++ .../scaleway/mongodb/v1alpha1/__init__.py | 2 + .../scaleway/mongodb/v1alpha1/marshalling.py | 44 +++++++++++++++++++ scaleway/scaleway/mongodb/v1alpha1/types.py | 18 ++++++++ 6 files changed, 128 insertions(+) diff --git a/scaleway-async/scaleway_async/mongodb/v1alpha1/__init__.py b/scaleway-async/scaleway_async/mongodb/v1alpha1/__init__.py index 697dc1694..43095225f 100644 --- a/scaleway-async/scaleway_async/mongodb/v1alpha1/__init__.py +++ b/scaleway-async/scaleway_async/mongodb/v1alpha1/__init__.py @@ -17,6 +17,7 @@ from .types import EndpointSpecPublicDetails from .types import Endpoint from .types import InstanceSetting +from .types import InstanceSnapshotSchedule from .types import Volume from .types import NodeTypeVolumeType from .types import SnapshotVolumeType @@ -77,6 +78,7 @@ "EndpointSpecPublicDetails", "Endpoint", "InstanceSetting", + "InstanceSnapshotSchedule", "Volume", "NodeTypeVolumeType", "SnapshotVolumeType", diff --git a/scaleway-async/scaleway_async/mongodb/v1alpha1/marshalling.py b/scaleway-async/scaleway_async/mongodb/v1alpha1/marshalling.py index 9b267ac13..4f2bef5ed 100644 --- a/scaleway-async/scaleway_async/mongodb/v1alpha1/marshalling.py +++ b/scaleway-async/scaleway_async/mongodb/v1alpha1/marshalling.py @@ -14,6 +14,7 @@ EndpointPublicDetails, Endpoint, InstanceSetting, + InstanceSnapshotSchedule, Volume, Instance, SnapshotVolumeType, @@ -131,6 +132,43 @@ def unmarshal_InstanceSetting(data: Any) -> InstanceSetting: return InstanceSetting(**args) +def unmarshal_InstanceSnapshotSchedule(data: Any) -> InstanceSnapshotSchedule: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'InstanceSnapshotSchedule' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("frequency_hours", None) + if field is not None: + args["frequency_hours"] = field + + field = data.get("retention_days", None) + if field is not None: + args["retention_days"] = field + + field = data.get("enabled", None) + if field is not None: + args["enabled"] = field + + field = data.get("next_update", None) + if field is not None: + args["next_update"] = ( + parser.isoparse(field) if isinstance(field, str) else field + ) + else: + args["next_update"] = None + + field = data.get("last_run", None) + if field is not None: + args["last_run"] = parser.isoparse(field) if isinstance(field, str) else field + else: + args["last_run"] = None + + return InstanceSnapshotSchedule(**args) + + def unmarshal_Volume(data: Any) -> Volume: if not isinstance(data, dict): raise TypeError( @@ -218,6 +256,12 @@ def unmarshal_Instance(data: Any) -> Instance: else: args["created_at"] = None + field = data.get("snapshot_schedule", None) + if field is not None: + args["snapshot_schedule"] = unmarshal_InstanceSnapshotSchedule(field) + else: + args["snapshot_schedule"] = None + return Instance(**args) diff --git a/scaleway-async/scaleway_async/mongodb/v1alpha1/types.py b/scaleway-async/scaleway_async/mongodb/v1alpha1/types.py index 3703f280c..537e0c080 100644 --- a/scaleway-async/scaleway_async/mongodb/v1alpha1/types.py +++ b/scaleway-async/scaleway_async/mongodb/v1alpha1/types.py @@ -185,6 +185,19 @@ class InstanceSetting: """ +@dataclass +class InstanceSnapshotSchedule: + frequency_hours: int + + retention_days: int + + enabled: bool + + next_update: Optional[datetime] + + last_run: Optional[datetime] + + @dataclass class Volume: type_: VolumeType @@ -388,6 +401,11 @@ class Instance: Creation date (must follow the ISO 8601 format). """ + snapshot_schedule: Optional[InstanceSnapshotSchedule] + """ + Snapshot schedule configuration of the Database Instance. + """ + @dataclass class NodeType: diff --git a/scaleway/scaleway/mongodb/v1alpha1/__init__.py b/scaleway/scaleway/mongodb/v1alpha1/__init__.py index 697dc1694..43095225f 100644 --- a/scaleway/scaleway/mongodb/v1alpha1/__init__.py +++ b/scaleway/scaleway/mongodb/v1alpha1/__init__.py @@ -17,6 +17,7 @@ from .types import EndpointSpecPublicDetails from .types import Endpoint from .types import InstanceSetting +from .types import InstanceSnapshotSchedule from .types import Volume from .types import NodeTypeVolumeType from .types import SnapshotVolumeType @@ -77,6 +78,7 @@ "EndpointSpecPublicDetails", "Endpoint", "InstanceSetting", + "InstanceSnapshotSchedule", "Volume", "NodeTypeVolumeType", "SnapshotVolumeType", diff --git a/scaleway/scaleway/mongodb/v1alpha1/marshalling.py b/scaleway/scaleway/mongodb/v1alpha1/marshalling.py index 9b267ac13..4f2bef5ed 100644 --- a/scaleway/scaleway/mongodb/v1alpha1/marshalling.py +++ b/scaleway/scaleway/mongodb/v1alpha1/marshalling.py @@ -14,6 +14,7 @@ EndpointPublicDetails, Endpoint, InstanceSetting, + InstanceSnapshotSchedule, Volume, Instance, SnapshotVolumeType, @@ -131,6 +132,43 @@ def unmarshal_InstanceSetting(data: Any) -> InstanceSetting: return InstanceSetting(**args) +def unmarshal_InstanceSnapshotSchedule(data: Any) -> InstanceSnapshotSchedule: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'InstanceSnapshotSchedule' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("frequency_hours", None) + if field is not None: + args["frequency_hours"] = field + + field = data.get("retention_days", None) + if field is not None: + args["retention_days"] = field + + field = data.get("enabled", None) + if field is not None: + args["enabled"] = field + + field = data.get("next_update", None) + if field is not None: + args["next_update"] = ( + parser.isoparse(field) if isinstance(field, str) else field + ) + else: + args["next_update"] = None + + field = data.get("last_run", None) + if field is not None: + args["last_run"] = parser.isoparse(field) if isinstance(field, str) else field + else: + args["last_run"] = None + + return InstanceSnapshotSchedule(**args) + + def unmarshal_Volume(data: Any) -> Volume: if not isinstance(data, dict): raise TypeError( @@ -218,6 +256,12 @@ def unmarshal_Instance(data: Any) -> Instance: else: args["created_at"] = None + field = data.get("snapshot_schedule", None) + if field is not None: + args["snapshot_schedule"] = unmarshal_InstanceSnapshotSchedule(field) + else: + args["snapshot_schedule"] = None + return Instance(**args) diff --git a/scaleway/scaleway/mongodb/v1alpha1/types.py b/scaleway/scaleway/mongodb/v1alpha1/types.py index 3703f280c..537e0c080 100644 --- a/scaleway/scaleway/mongodb/v1alpha1/types.py +++ b/scaleway/scaleway/mongodb/v1alpha1/types.py @@ -185,6 +185,19 @@ class InstanceSetting: """ +@dataclass +class InstanceSnapshotSchedule: + frequency_hours: int + + retention_days: int + + enabled: bool + + next_update: Optional[datetime] + + last_run: Optional[datetime] + + @dataclass class Volume: type_: VolumeType @@ -388,6 +401,11 @@ class Instance: Creation date (must follow the ISO 8601 format). """ + snapshot_schedule: Optional[InstanceSnapshotSchedule] + """ + Snapshot schedule configuration of the Database Instance. + """ + @dataclass class NodeType: