Changeset View
Changeset View
Standalone View
Standalone View
swh/model/model.py
Show First 20 Lines • Show All 720 Lines • ▼ Show 20 Lines | class SkippedContent(BaseContent): | ||||
def from_dict(cls, d): | def from_dict(cls, d): | ||||
d2 = d.copy() | d2 = d.copy() | ||||
if d2.pop("data", None) is not None: | if d2.pop("data", None) is not None: | ||||
raise ValueError('SkippedContent has no "data" attribute %r' % d) | raise ValueError('SkippedContent has no "data" attribute %r' % d) | ||||
return super().from_dict(d2, use_subclass=False) | return super().from_dict(d2, use_subclass=False) | ||||
class MetadataAuthorityType(Enum): | class MetadataAuthorityType(Enum): | ||||
DEPOSIT = "deposit" | DEPOSIT_CLIENT = "deposit_client" | ||||
FORGE = "forge" | FORGE = "forge" | ||||
REGISTRY = "registry" | REGISTRY = "registry" | ||||
@attr.s(frozen=True) | @attr.s(frozen=True) | ||||
class MetadataAuthority(BaseModel): | class MetadataAuthority(BaseModel): | ||||
"""Represents an entity that provides metadata about an origin or | """Represents an entity that provides metadata about an origin or | ||||
software artifact.""" | software artifact.""" | ||||
▲ Show 20 Lines • Show All 249 Lines • Show Last 20 Lines |