Skip to content
Snippets Groups Projects
Verified Commit 09dcc04a authored by Antoine R. Dumont's avatar Antoine R. Dumont
Browse files

model: Add final object_type field on metadata related model objects

parent 37cdd849
No related branches found
Tags v0.6.5
1 merge request!131model: Add final object_type field on metadata related model objects
......@@ -736,6 +736,8 @@ class MetadataAuthority(BaseModel):
"""Represents an entity that provides metadata about an origin or
software artifact."""
object_type: Final = "metadata_authority"
type = attr.ib(type=MetadataAuthorityType, validator=type_validator())
url = attr.ib(type=str, validator=type_validator())
metadata = attr.ib(
......@@ -762,6 +764,8 @@ class MetadataFetcher(BaseModel):
"""Represents a software component used to fetch metadata from a metadata
authority, and ingest them into the Software Heritage archive."""
object_type: Final = "metadata_fetcher"
name = attr.ib(type=str, validator=type_validator())
version = attr.ib(type=str, validator=type_validator())
metadata = attr.ib(
......@@ -791,6 +795,8 @@ class MetadataTargetType(Enum):
@attr.s(frozen=True)
class RawExtrinsicMetadata(BaseModel):
object_type: Final = "raw_extrinsic_metadata"
# target object
type = attr.ib(type=MetadataTargetType, validator=type_validator())
id = attr.ib(type=Union[str, SWHID], validator=type_validator())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment