from typing import Optional
from dcicutils.portal_utils import Portal as PortalFromUtils
from dcicutils.ff_utils import delete_metadata, purge_metadata


class Portal(PortalFromUtils):

    def delete_metadata(self, object_id: str) -> Optional[dict]:
        if self.key:
            return delete_metadata(obj_id=object_id, key=self.key)
        return None

    def purge_metadata(self, object_id: str) -> Optional[dict]:
        if self.key:
            return purge_metadata(obj_id=object_id, key=self.key)
        return None
