diff --git a/services/cost/oas_commit b/services/cost/oas_commit index c08a6770d..1538b64bb 100644 --- a/services/cost/oas_commit +++ b/services/cost/oas_commit @@ -1 +1 @@ -4407196dbbef4e53e6798809e856725cbc84ae05 +d5bd75f47f4b364fa6f71663efb4ba41ec703ac8 diff --git a/services/cost/src/stackit/cost/models/detailed_service_cost.py b/services/cost/src/stackit/cost/models/detailed_service_cost.py index 5bdc5c8a3..a79e3ab00 100644 --- a/services/cost/src/stackit/cost/models/detailed_service_cost.py +++ b/services/cost/src/stackit/cost/models/detailed_service_cost.py @@ -23,6 +23,7 @@ Field, StrictFloat, StrictInt, + StrictStr, ) from pydantic_core import to_jsonable_python from typing_extensions import Annotated, Self @@ -56,6 +57,10 @@ class DetailedServiceCost(BaseModel): alias="totalDiscount", ) total_quantity: StrictInt = Field(description="Total quantity", alias="totalQuantity") + total_quantity_decimal: StrictStr = Field( + description="Total quantity in decimal format, returned as string to preserve precision. NOTE: This field will be removed in future versions and `totalQuantity` will become a decimal. ", + alias="totalQuantityDecimal", + ) unit_label: Annotated[str, Field(min_length=1, strict=True, max_length=64)] = Field( description="Label for unit", alias="unitLabel" ) @@ -67,6 +72,7 @@ class DetailedServiceCost(BaseModel): "totalCharge", "totalDiscount", "totalQuantity", + "totalQuantityDecimal", "unitLabel", ] @@ -138,6 +144,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "totalCharge": obj.get("totalCharge"), "totalDiscount": obj.get("totalDiscount"), "totalQuantity": obj.get("totalQuantity"), + "totalQuantityDecimal": obj.get("totalQuantityDecimal"), "unitLabel": obj.get("unitLabel"), } ) diff --git a/services/cost/src/stackit/cost/models/report_data.py b/services/cost/src/stackit/cost/models/report_data.py index 309f2fa93..85cfa2519 100644 --- a/services/cost/src/stackit/cost/models/report_data.py +++ b/services/cost/src/stackit/cost/models/report_data.py @@ -23,6 +23,7 @@ Field, StrictFloat, StrictInt, + StrictStr, ) from pydantic_core import to_jsonable_python from typing_extensions import Self @@ -38,8 +39,12 @@ class ReportData(BaseModel): charge: Union[StrictFloat, StrictInt] = Field(description="Charge, value in cents") discount: Union[StrictFloat, StrictInt] = Field(description="Discount, value in cents") quantity: StrictInt = Field(description="Quantity") + quantity_decimal: StrictStr = Field( + description="Quantity in decimal format, returned as string to preserve precision. NOTE: This field will be removed in future versions and `totalQuantity` will become a decimal. ", + alias="quantityDecimal", + ) time_period: ReportDataTimePeriod = Field(alias="timePeriod") - __properties: ClassVar[List[str]] = ["charge", "discount", "quantity", "timePeriod"] + __properties: ClassVar[List[str]] = ["charge", "discount", "quantity", "quantityDecimal", "timePeriod"] model_config = ConfigDict( validate_by_name=True, @@ -97,6 +102,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "charge": obj.get("charge"), "discount": obj.get("discount"), "quantity": obj.get("quantity"), + "quantityDecimal": obj.get("quantityDecimal"), "timePeriod": ( ReportDataTimePeriod.from_dict(obj["timePeriod"]) if obj.get("timePeriod") is not None else None ),