-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathgroup.py
More file actions
47 lines (34 loc) · 1.35 KB
/
group.py
File metadata and controls
47 lines (34 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from typing import TYPE_CHECKING
from typing import Annotated
from typing import Any
from typing import ClassVar
from typing import Union
from pydantic import Field
from ..annotations import Mutability
from ..attributes import ComplexAttribute
from ..path import URN
from ..reference import Reference
from .resource import Resource
if TYPE_CHECKING:
from .user import User
class GroupMember(ComplexAttribute):
value: Annotated[str | None, Mutability.immutable] = None
"""Identifier of the member of this Group."""
ref: Annotated[ # type: ignore[type-arg]
Reference[Union["User", "Group"]] | None,
Mutability.immutable,
] = Field(None, serialization_alias="$ref")
"""The reference URI of a target resource, if the attribute is a
reference."""
type: Annotated[str | None, Mutability.immutable] = Field(
None, examples=["User", "Group"]
)
"""A label indicating the attribute's function, e.g., "work" or "home"."""
display: Annotated[str | None, Mutability.read_only] = None
class Group(Resource[Any]):
__schema__ = URN("urn:ietf:params:scim:schemas:core:2.0:Group")
display_name: str | None = None
"""A human-readable name for the Group."""
members: list[GroupMember] | None = None
"""A list of members of the Group."""
Members: ClassVar[type[ComplexAttribute]] = GroupMember