diff --git a/scaleway-core/scaleway_core/bridge/decimal.py b/scaleway-core/scaleway_core/bridge/decimal.py index 49f4aec15..d6092a762 100644 --- a/scaleway-core/scaleway_core/bridge/decimal.py +++ b/scaleway-core/scaleway_core/bridge/decimal.py @@ -1,6 +1,8 @@ from decimal import Decimal from typing import Any, Dict +from scaleway_core.profile import ProfileDefaults + def unmarshal_Decimal(data: Any) -> Decimal: """ @@ -19,7 +21,7 @@ def unmarshal_Decimal(data: Any) -> Decimal: return Decimal(data["value"]) -def marshal_Decimal(data: Decimal) -> Dict[str, Any]: +def marshal_Decimal(data: Decimal, _defaults: ProfileDefaults | None) -> Dict[str, Any]: """ Marshal an instance of Decimal into google.protobuf.Decimal JSON representation. """ diff --git a/scaleway-core/scaleway_core/bridge/money.py b/scaleway-core/scaleway_core/bridge/money.py index 674e6d409..94789f65e 100644 --- a/scaleway-core/scaleway_core/bridge/money.py +++ b/scaleway-core/scaleway_core/bridge/money.py @@ -1,6 +1,8 @@ from dataclasses import dataclass from typing import Any, Dict +from scaleway_core.profile import ProfileDefaults + @dataclass class Money: @@ -48,7 +50,7 @@ def unmarshal_Money(data: Any) -> Money: ) -def marshal_Money(data: Money) -> Dict[str, Any]: +def marshal_Money(data: Money, _defaults: ProfileDefaults | None) -> Dict[str, Any]: """ Marshal an instance of Money into a JSON compatible data structure. """ diff --git a/scaleway-core/scaleway_core/bridge/scwfile.py b/scaleway-core/scaleway_core/bridge/scwfile.py index 222838abc..ea0893fed 100644 --- a/scaleway-core/scaleway_core/bridge/scwfile.py +++ b/scaleway-core/scaleway_core/bridge/scwfile.py @@ -1,6 +1,8 @@ from dataclasses import dataclass from typing import Any, Dict +from scaleway_core.profile import ProfileDefaults + @dataclass class ScwFile: @@ -40,7 +42,7 @@ def unmarshal_ScwFile(data: Any) -> ScwFile: ) -def marshal_ScwFile(obj: ScwFile) -> Dict[str, Any]: +def marshal_ScwFile(obj: ScwFile, _defaults: ProfileDefaults | None) -> Dict[str, Any]: """ Marshals a ScwFile object into a dict. """ diff --git a/scaleway-core/scaleway_core/bridge/serviceinfo.py b/scaleway-core/scaleway_core/bridge/serviceinfo.py index 7410c45a2..14568c43d 100644 --- a/scaleway-core/scaleway_core/bridge/serviceinfo.py +++ b/scaleway-core/scaleway_core/bridge/serviceinfo.py @@ -1,6 +1,8 @@ from dataclasses import dataclass from typing import Any, Dict, Optional +from scaleway_core.profile import ProfileDefaults + @dataclass class ServiceInfo: @@ -48,7 +50,9 @@ def unmarshal_ServiceInfo(data: Any) -> ServiceInfo: ) -def marshal_ServiceInfo(obj: ServiceInfo) -> Dict[str, Any]: +def marshal_ServiceInfo( + obj: ServiceInfo, _defaults: ProfileDefaults | None +) -> Dict[str, Any]: """ Marshals a ServiceInfo object into a dict. """ diff --git a/scaleway-core/scaleway_core/bridge/timeseries.py b/scaleway-core/scaleway_core/bridge/timeseries.py index 8f253c21b..f3d9d21b4 100644 --- a/scaleway-core/scaleway_core/bridge/timeseries.py +++ b/scaleway-core/scaleway_core/bridge/timeseries.py @@ -3,6 +3,8 @@ from typing import Any, Dict, List from dateutil import parser +from scaleway_core.profile import ProfileDefaults + @dataclass class TimeSeriesPoint: @@ -36,7 +38,9 @@ def unmarshal_TimeSeriesPoint(data: Any) -> TimeSeriesPoint: ) -def marshal_TimeSeriesPoint(data: TimeSeriesPoint) -> Dict[str, Any]: +def marshal_TimeSeriesPoint( + data: TimeSeriesPoint, _defaults: ProfileDefaults | None +) -> Dict[str, Any]: """ Marshal an instance of TimeSeriesPoint into a JSON compatible data structure. """ @@ -84,12 +88,14 @@ def unmarshal_TimeSeries(data: Any) -> TimeSeries: ) -def marshal_TimeSeries(data: TimeSeries) -> Dict[str, Any]: +def marshal_TimeSeries( + data: TimeSeries, defaults: ProfileDefaults | None +) -> Dict[str, Any]: """ Marshal an instance of TimeSeries into a JSON compatible data structure. """ return { "name": data.name, - "points": [marshal_TimeSeriesPoint(point) for point in data.points], + "points": [marshal_TimeSeriesPoint(point, defaults) for point in data.points], "metadata": data.metadata, } diff --git a/scaleway-core/tests/test_bridge_marshal.py b/scaleway-core/tests/test_bridge_marshal.py index 328a8d160..2d7c6d998 100644 --- a/scaleway-core/tests/test_bridge_marshal.py +++ b/scaleway-core/tests/test_bridge_marshal.py @@ -7,7 +7,7 @@ class TestBridgeMarshal(unittest.TestCase): def test_decimal_marshal(self): decimal = Decimal("1.2") - self.assertEqual(marshal_Decimal(decimal), {"value": "1.2"}) + self.assertEqual(marshal_Decimal(decimal, None), {"value": "1.2"}) def test_decimal_unmarshal(self): decimal = Decimal("1.2")