Changeset View
Changeset View
Standalone View
Standalone View
swh/model/model.py
Show First 20 Lines • Show All 96 Lines • ▼ Show 20 Lines | class Origin(BaseModel): | ||||
url = attr.ib(type=str) | url = attr.ib(type=str) | ||||
type = attr.ib(type=Optional[str], default=None) | type = attr.ib(type=Optional[str], default=None) | ||||
@attr.s | @attr.s | ||||
class OriginVisit(BaseModel): | class OriginVisit(BaseModel): | ||||
"""Represents a visit of an origin at a given point in time, by a | """Represents a visit of an origin at a given point in time, by a | ||||
SWH loader.""" | SWH loader.""" | ||||
origin = attr.ib(type=Origin) | origin = attr.ib(type=str) | ||||
date = attr.ib(type=datetime.datetime) | date = attr.ib(type=datetime.datetime) | ||||
status = attr.ib( | status = attr.ib( | ||||
type=str, | type=str, | ||||
validator=attr.validators.in_(['ongoing', 'full', 'partial'])) | validator=attr.validators.in_(['ongoing', 'full', 'partial'])) | ||||
type = attr.ib(type=str) | type = attr.ib(type=str) | ||||
snapshot = attr.ib(type=Sha1Git) | snapshot = attr.ib(type=Sha1Git) | ||||
metadata = attr.ib(type=Optional[Dict[str, object]], | metadata = attr.ib(type=Optional[Dict[str, object]], | ||||
default=None) | default=None) | ||||
▲ Show 20 Lines • Show All 260 Lines • Show Last 20 Lines |