snapshot.py 505 Bytes
Newer Older
1 2 3
import json


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

        self.id = id
15
        self.volume_id = volume_id
adamtorok committed
16
        self.size = size
17 18 19 20 21 22 23 24
        self.status = status
        self.created_at = created_at

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

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