-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathgroup.py
More file actions
47 lines (35 loc) · 1.39 KB
/
group.py
File metadata and controls
47 lines (35 loc) · 1.39 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 Annotated
from typing import Any
from typing import ClassVar
from typing import Literal
from typing import Optional
from typing import Union
from pydantic import Field
from ..annotations import Mutability
from ..annotations import Required
from ..attributes import ComplexAttribute
from ..reference import Reference
from .resource import Resource
class GroupMember(ComplexAttribute):
value: Annotated[Optional[str], Mutability.immutable] = None
"""Identifier of the member of this Group."""
ref: Annotated[
Optional[Reference[Union[Literal["User"], Literal["Group"]]]],
Mutability.immutable,
] = Field(None, serialization_alias="$ref")
"""The reference URI of a target resource, if the attribute is a
reference."""
type: Annotated[Optional[str], Mutability.immutable] = Field(
None, examples=["User", "Group"]
)
"""A label indicating the attribute's function, e.g., "work" or "home"."""
display: Annotated[Optional[str], Mutability.read_only] = None
class Group(Resource[Any]):
schemas: Annotated[list[str], Required.true] = [
"urn:ietf:params:scim:schemas:core:2.0:Group"
]
display_name: Optional[str] = None
"""A human-readable name for the Group."""
members: Optional[list[GroupMember]] = None
"""A list of members of the Group."""
Members: ClassVar[type[ComplexAttribute]] = GroupMember