from __future__ import annotations

from collections.abc import Mapping
from typing import Any, TypeVar

from attrs import define as _attrs_define
from attrs import field as _attrs_field

from ..types import UNSET, Unset

T = TypeVar("T", bound="PkgRoutesPackagesRetirementParticipantsEmployeeCensusUpdateEntryDateRequest")


@_attrs_define
class PkgRoutesPackagesRetirementParticipantsEmployeeCensusUpdateEntryDateRequest:
    """
    Attributes:
        clear_given (bool | Unset):
        key (str | Unset):
        override_key (str | Unset):
        override_value (Any | Unset):
        plan (str | Unset):
        skipped (Any | Unset):
        value (Any | Unset):
    """

    clear_given: bool | Unset = UNSET
    key: str | Unset = UNSET
    override_key: str | Unset = UNSET
    override_value: Any | Unset = UNSET
    plan: str | Unset = UNSET
    skipped: Any | Unset = UNSET
    value: Any | Unset = UNSET
    additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)

    def to_dict(self) -> dict[str, Any]:
        clear_given = self.clear_given

        key = self.key

        override_key = self.override_key

        override_value = self.override_value

        plan = self.plan

        skipped = self.skipped

        value = self.value

        field_dict: dict[str, Any] = {}
        field_dict.update(self.additional_properties)
        field_dict.update({})
        if clear_given is not UNSET:
            field_dict["clear_given"] = clear_given
        if key is not UNSET:
            field_dict["key"] = key
        if override_key is not UNSET:
            field_dict["override_key"] = override_key
        if override_value is not UNSET:
            field_dict["override_value"] = override_value
        if plan is not UNSET:
            field_dict["plan"] = plan
        if skipped is not UNSET:
            field_dict["skipped"] = skipped
        if value is not UNSET:
            field_dict["value"] = value

        return field_dict

    @classmethod
    def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
        d = dict(src_dict)
        clear_given = d.pop("clear_given", UNSET)

        key = d.pop("key", UNSET)

        override_key = d.pop("override_key", UNSET)

        override_value = d.pop("override_value", UNSET)

        plan = d.pop("plan", UNSET)

        skipped = d.pop("skipped", UNSET)

        value = d.pop("value", UNSET)

        pkg_routes_packages_retirement_participants_employee_census_update_entry_date_request = cls(
            clear_given=clear_given,
            key=key,
            override_key=override_key,
            override_value=override_value,
            plan=plan,
            skipped=skipped,
            value=value,
        )

        pkg_routes_packages_retirement_participants_employee_census_update_entry_date_request.additional_properties = d
        return pkg_routes_packages_retirement_participants_employee_census_update_entry_date_request

    @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
