aboutsummaryrefslogtreecommitdiff
path: root/gn_auth/auth/authorisation/resources/base.py
blob: 02b738f9600641cc21e3f3b2e22f2c5e6238dc5f (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, asdict
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()