aboutsummaryrefslogtreecommitdiff
path: root/gn_auth/auth/authorisation/resources/base.py
blob: ac930496bc2776f1689c826d4a5196d36500c361 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"""Base types for resources."""
from uuid import UUID
from dataclasses import dataclass
from typing import Any, Sequence


@dataclass(frozen=True)
class ResourceCategory:
    """Class representing a resource category."""
    resource_category_id: UUID
    resource_category_key: str
    resource_category_description: str


@dataclass(frozen=True)
class Resource:
    """Class representing a resource."""
    resource_id: UUID
    resource_name: str
    resource_category: ResourceCategory
    public: bool
    resource_data: Sequence[dict[str, Any]] = tuple()