57 lines
1012 B
Python
57 lines
1012 B
Python
from dataclasses import dataclass
|
|
from enum import Enum
|
|
|
|
|
|
class CheckpointStatus(Enum):
|
|
STARTED = "STARTED"
|
|
COMPLETED = "COMPLETED"
|
|
FAILED = "FAILED"
|
|
|
|
@dataclass
|
|
class CheckpointMetadata:
|
|
_metadata: str
|
|
_type: str
|
|
|
|
def __init__(self, metadata: str, _type: str):
|
|
self._metadata = metadata
|
|
self._type = _type
|
|
|
|
@property
|
|
def metadata(self):
|
|
return self._metadata
|
|
|
|
@property
|
|
def type(self):
|
|
return self._type
|
|
|
|
|
|
@dataclass
|
|
class Checkpoint:
|
|
_name: str
|
|
_hash: str
|
|
_status: CheckpointStatus
|
|
_id: int
|
|
|
|
|
|
def __init__(self, id: int, name: str, hash: str, status: CheckpointStatus):
|
|
self._name = name
|
|
self._hash = hash
|
|
self._status = status
|
|
self._id = id
|
|
|
|
|
|
@property
|
|
def name(self):
|
|
return self._name
|
|
|
|
@property
|
|
def hash(self):
|
|
return self._hash
|
|
|
|
@property
|
|
def status(self):
|
|
return self._status
|
|
|
|
@property
|
|
def id(self):
|
|
return self._id |