from typing import Optional
from tdw_catalog.organization_member import OrganizationMember
from tdw_catalog.utils import MetadataFieldType
import tdw_catalog.metadata.field as field
[docs]class Field(field.MetadataField[OrganizationMember]):
"""
Someone who is associated with the data
Attributes
----------
None
"""
def __init__(self, key: str, value: Optional[OrganizationMember]) -> None:
super().__init__(key, value)
def serialize(self) -> dict:
res = super().serialize()
res["value"] = self.value.user_id if self.value is not None else None
res["field_type"] = MetadataFieldType.FT_USER
return res