Skip to content

Commit 348b9a5

Browse files
committed
build json object
1 parent 2a6d0da commit 348b9a5

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

linode_api4/objects/object_storage.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,16 @@ class ObjectStorageEndpoint(JSONObject):
5151
s3_endpoint: Optional[str] = None
5252

5353

54+
@dataclass
55+
class ObjectStorageQuotaUsage(JSONObject):
56+
"""
57+
ObjectStorageQuotaUsage contains the fields of an object storage quota usage information.
58+
"""
59+
60+
quota_limit: int = 0
61+
usage: int = 0
62+
63+
5464
class ObjectStorageType(Base):
5565
"""
5666
An ObjectStorageType represents the structure of a valid Object Storage type.
@@ -596,12 +606,12 @@ def usage(self):
596606
API documentation: TBD
597607
598608
:returns: The Object Storage Quota usage.
599-
:rtype: MappedObject
609+
:rtype: ObjectStorageQuotaUsage
600610
"""
601611

602612
result = self._client.get(
603613
f"{type(self).api_endpoint}/usage",
604614
model=self,
605615
)
606616

607-
return MappedObject(**result)
617+
return ObjectStorageQuotaUsage.from_json(result)

0 commit comments

Comments
 (0)