@_attrs_define
class ScheduleConfigUpdatePayloadV2:
"""
Example:
{'rotations': [{'effective_from': '2021-08-17T13:28:57.801578Z', 'handover_start_at':
'2021-08-17T13:28:57.801578Z', 'handovers': [{'interval': 1, 'interval_type': 'daily'}], 'id':
'01G0J1EXE7AXZ2C93K61WBPYEH', 'layers': [{'id': '01G0J1EXE7AXZ2C93K61WBPYEH', 'name': 'Layer 1'}], 'name': 'My
Rotation', 'users': [{'email': 'bob@example.com', 'id': '01G0J1EXE7AXZ2C93K61WBPYEH', 'slack_user_id':
'USER123'}], 'working_interval': [{'end_time': '17:00', 'start_time': '09:00', 'weekday': 'tuesday'}]}]}
Attributes:
rotations (Union[Unset, List['ScheduleRotationUpdatePayloadV2']]): Example: [{'effective_from':
'2021-08-17T13:28:57.801578Z', 'handover_start_at': '2021-08-17T13:28:57.801578Z', 'handovers': [{'interval': 1,
'interval_type': 'daily'}], 'id': '01G0J1EXE7AXZ2C93K61WBPYEH', 'layers': [{'id': '01G0J1EXE7AXZ2C93K61WBPYEH',
'name': 'Layer 1'}], 'name': 'My Rotation', 'users': [{'email': 'bob@example.com', 'id':
'01G0J1EXE7AXZ2C93K61WBPYEH', 'slack_user_id': 'USER123'}], 'working_interval': [{'end_time': '17:00',
'start_time': '09:00', 'weekday': 'tuesday'}]}].
"""
rotations: Union[Unset, List["ScheduleRotationUpdatePayloadV2"]] = UNSET
additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
rotations: Union[Unset, List[Dict[str, Any]]] = UNSET
if not isinstance(self.rotations, Unset):
rotations = []
for rotations_item_data in self.rotations:
rotations_item = rotations_item_data.to_dict()
rotations.append(rotations_item)
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if rotations is not UNSET:
field_dict["rotations"] = rotations
return field_dict
@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
from ..models.schedule_rotation_update_payload_v2 import (
ScheduleRotationUpdatePayloadV2,
)
d = src_dict.copy()
rotations = []
_rotations = d.pop("rotations", UNSET)
for rotations_item_data in _rotations or []:
rotations_item = ScheduleRotationUpdatePayloadV2.from_dict(rotations_item_data)
rotations.append(rotations_item)
schedule_config_update_payload_v2 = cls(
rotations=rotations,
)
schedule_config_update_payload_v2.additional_properties = d
return schedule_config_update_payload_v2
@property
def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())
def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]
def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value
def __delitem__(self, key: str) -> None:
del self.additional_properties[key]
def __contains__(self, key: str) -> bool:
return key in self.additional_properties