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


@_attrs_define
class TypesRetirementConfig:
    """
    Attributes:
        address_requirement (bool | Unset):
        collect_eligible_compensation (bool | Unset):
        collect_statutory_compensation (bool | Unset):
        email_requirement (bool | Unset):
        hours_assumption (bool | Unset):
        phone_requirement (bool | Unset):
    """

    address_requirement: bool | Unset = UNSET
    collect_eligible_compensation: bool | Unset = UNSET
    collect_statutory_compensation: bool | Unset = UNSET
    email_requirement: bool | Unset = UNSET
    hours_assumption: bool | Unset = UNSET
    phone_requirement: bool | Unset = UNSET
    additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)

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

        collect_eligible_compensation = self.collect_eligible_compensation

        collect_statutory_compensation = self.collect_statutory_compensation

        email_requirement = self.email_requirement

        hours_assumption = self.hours_assumption

        phone_requirement = self.phone_requirement

        field_dict: dict[str, Any] = {}
        field_dict.update(self.additional_properties)
        field_dict.update({})
        if address_requirement is not UNSET:
            field_dict["address_requirement"] = address_requirement
        if collect_eligible_compensation is not UNSET:
            field_dict["collect_eligible_compensation"] = collect_eligible_compensation
        if collect_statutory_compensation is not UNSET:
            field_dict["collect_statutory_compensation"] = collect_statutory_compensation
        if email_requirement is not UNSET:
            field_dict["email_requirement"] = email_requirement
        if hours_assumption is not UNSET:
            field_dict["hours_assumption"] = hours_assumption
        if phone_requirement is not UNSET:
            field_dict["phone_requirement"] = phone_requirement

        return field_dict

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

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

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

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

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

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

        types_retirement_config = cls(
            address_requirement=address_requirement,
            collect_eligible_compensation=collect_eligible_compensation,
            collect_statutory_compensation=collect_statutory_compensation,
            email_requirement=email_requirement,
            hours_assumption=hours_assumption,
            phone_requirement=phone_requirement,
        )

        types_retirement_config.additional_properties = d
        return types_retirement_config

    @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
