-
Notifications
You must be signed in to change notification settings - Fork 87
Expand file tree
/
Copy pathassigned_place_mode.py
More file actions
61 lines (51 loc) · 2.37 KB
/
assigned_place_mode.py
File metadata and controls
61 lines (51 loc) · 2.37 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
48
49
50
51
52
53
54
55
56
57
58
59
60
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass, field
from kiota_abstractions.serialization import Parsable, ParseNode, SerializationWriter
from typing import Any, Optional, TYPE_CHECKING, Union
if TYPE_CHECKING:
from .place_mode import PlaceMode
from .place_mode import PlaceMode
@dataclass
class AssignedPlaceMode(PlaceMode, Parsable):
# The OdataType property
odata_type: Optional[str] = "#microsoft.graph.assignedPlaceMode"
# The email address of the user to whom the desk is assigned.
assigned_user_email_address: Optional[str] = None
# The user ID of the user to whom the desk is assigned.
assigned_user_id: Optional[str] = None
@staticmethod
def create_from_discriminator_value(parse_node: ParseNode) -> AssignedPlaceMode:
"""
Creates a new instance of the appropriate class based on discriminator value
param parse_node: The parse node to use to read the discriminator value and create the object
Returns: AssignedPlaceMode
"""
if parse_node is None:
raise TypeError("parse_node cannot be null.")
return AssignedPlaceMode()
def get_field_deserializers(self,) -> dict[str, Callable[[ParseNode], None]]:
"""
The deserialization information for the current model
Returns: dict[str, Callable[[ParseNode], None]]
"""
from .place_mode import PlaceMode
from .place_mode import PlaceMode
fields: dict[str, Callable[[Any], None]] = {
"assignedUserEmailAddress": lambda n : setattr(self, 'assigned_user_email_address', n.get_str_value()),
"assignedUserId": lambda n : setattr(self, 'assigned_user_id', n.get_str_value()),
}
super_fields = super().get_field_deserializers()
fields.update(super_fields)
return fields
def serialize(self,writer: SerializationWriter) -> None:
"""
Serializes information the current object
param writer: Serialization writer to use to serialize this model
Returns: None
"""
if writer is None:
raise TypeError("writer cannot be null.")
super().serialize(writer)
writer.write_str_value("assignedUserEmailAddress", self.assigned_user_email_address)
writer.write_str_value("assignedUserId", self.assigned_user_id)