volume.py 560 Bytes
Newer Older
adamtorok committed
1 2 3
import json


adamtorok committed
4
class Volume:
adamtorok committed
5 6
    def __init__(self,
                 id,
7
                 image_id,
adamtorok committed
8 9 10 11 12
                 size,
                 bootable,
                 status,
                 created_at
                 ) -> None:
adamtorok committed
13 14 15
        super().__init__()

        self.id = id
16
        self.image_id = image_id
adamtorok committed
17 18
        self.size = size
        self.bootable = bootable
adamtorok committed
19 20 21 22 23 24 25 26
        self.status = status
        self.created_at = created_at

    def __str__(self) -> str:
        return self.toJSON()

    def toJSON(self):
        return json.dumps(self.__dict__)