Skip to content

Commit

Permalink
runtime_checkable
Browse files Browse the repository at this point in the history
  • Loading branch information
jnussbaum committed Aug 12, 2024
1 parent be78881 commit 6783474
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dsp_permissions_scripts/doap/doap_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

from typing import Protocol
from typing import Self
from typing import runtime_checkable

from pydantic import BaseModel
from pydantic import ConfigDict
from pydantic import model_validator

from dsp_permissions_scripts.models.group import Group
Expand All @@ -13,11 +15,14 @@
class Doap(BaseModel):
"""Model representing a DOAP, containing the target, the scope and the IRI of the DOAP."""

model_config = ConfigDict(arbitrary_types_allowed=True)

target: DoapTarget
scope: PermissionScope
doap_iri: str


@runtime_checkable
class DoapTarget(Protocol):
"""
A DOAP can be defined for either a Group, or for a ResourceClass, or for a Property,
Expand Down

0 comments on commit 6783474

Please sign in to comment.