diff --git a/src/aind_data_schema_models/pid_names.py b/src/aind_data_schema_models/pid_names.py new file mode 100644 index 0000000..76da602 --- /dev/null +++ b/src/aind_data_schema_models/pid_names.py @@ -0,0 +1,24 @@ +"""Module for pidname definitions""" + +from typing import Optional + +from pydantic import BaseModel, ConfigDict, Field + + +class BaseName(BaseModel): + """A simple model associating a name with an abbreviation""" + + model_config = ConfigDict(extra="forbid", use_enum_values=True) + + name: str = Field(..., title="Name") + abbreviation: Optional[str] = Field(default=None, title="Abbreviation") + + +class PIDName(BaseName): + """ + Model for associate a name with a persistent identifier (PID), + the registry for that PID, and abbreviation for that registry + """ + + registry: Optional[BaseName] = Field(default=None, title="Registry") + registry_identifier: Optional[str] = Field(default=None, title="Registry identifier")