# generated by datamodel-codegen:
#   filename:  schema/entity/policies/accessControl/tagBased.json
#   timestamp: 2022-01-16T19:33:03+00:00

from __future__ import annotations

from typing import List, Union

from pydantic import BaseModel, Extra, Field

from ....type import tagLabel
from ...teams import team, user


class TagBased(BaseModel):
    class Config:
        extra = Extra.forbid

    tags: List[tagLabel.TagLabel] = Field(
        ..., description='Tags that are associated with the entities.', min_items=1
    )
    allow: List[Union[team.Team, user.User]] = Field(
        ...,
        description='Teams and Users who are able to access the tagged entities.',
        min_items=1,
    )
