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="PkgRoutesPackagesRetirementParticipantsLookupEmployeeFields")


@_attrs_define
class PkgRoutesPackagesRetirementParticipantsLookupEmployeeFields:
    """
    Attributes:
        birth_date (str | Unset):
        first_name (str | Unset):
        last_name (str | Unset):
        middle_name (str | Unset):
        ssn (str | Unset):
    """

    birth_date: str | Unset = UNSET
    first_name: str | Unset = UNSET
    last_name: str | Unset = UNSET
    middle_name: str | Unset = UNSET
    ssn: str | Unset = UNSET
    additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)

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

        first_name = self.first_name

        last_name = self.last_name

        middle_name = self.middle_name

        ssn = self.ssn

        field_dict: dict[str, Any] = {}
        field_dict.update(self.additional_properties)
        field_dict.update({})
        if birth_date is not UNSET:
            field_dict["birth_date"] = birth_date
        if first_name is not UNSET:
            field_dict["first_name"] = first_name
        if last_name is not UNSET:
            field_dict["last_name"] = last_name
        if middle_name is not UNSET:
            field_dict["middle_name"] = middle_name
        if ssn is not UNSET:
            field_dict["ssn"] = ssn

        return field_dict

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

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

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

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

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

        pkg_routes_packages_retirement_participants_lookup_employee_fields = cls(
            birth_date=birth_date,
            first_name=first_name,
            last_name=last_name,
            middle_name=middle_name,
            ssn=ssn,
        )

        pkg_routes_packages_retirement_participants_lookup_employee_fields.additional_properties = d
        return pkg_routes_packages_retirement_participants_lookup_employee_fields

    @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
