from __future__ import annotations

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

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

from ..types import UNSET, Unset

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


@_attrs_define
class PkgRoutesPackagesRetirementParticipantsCensusStatusFilters:
    """
    Attributes:
        census_status (list[str] | Unset): Census Status
        client (list[str] | Unset): Client IDs
        payroll_status (list[str] | Unset): Payroll Status
        pye (Any | Unset):
        search (str | Unset): Plan Name/Code
        status (list[str] | Unset): Plan Status
        tags (list[str] | Unset): Client Tags
        type_ (list[str] | Unset): Plan Types
    """

    census_status: list[str] | Unset = UNSET
    client: list[str] | Unset = UNSET
    payroll_status: list[str] | Unset = UNSET
    pye: Any | Unset = UNSET
    search: str | Unset = UNSET
    status: list[str] | Unset = UNSET
    tags: list[str] | Unset = UNSET
    type_: list[str] | Unset = UNSET
    additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)

    def to_dict(self) -> dict[str, Any]:
        census_status: list[str] | Unset = UNSET
        if not isinstance(self.census_status, Unset):
            census_status = self.census_status

        client: list[str] | Unset = UNSET
        if not isinstance(self.client, Unset):
            client = self.client

        payroll_status: list[str] | Unset = UNSET
        if not isinstance(self.payroll_status, Unset):
            payroll_status = self.payroll_status

        pye = self.pye

        search = self.search

        status: list[str] | Unset = UNSET
        if not isinstance(self.status, Unset):
            status = self.status

        tags: list[str] | Unset = UNSET
        if not isinstance(self.tags, Unset):
            tags = self.tags

        type_: list[str] | Unset = UNSET
        if not isinstance(self.type_, Unset):
            type_ = self.type_

        field_dict: dict[str, Any] = {}
        field_dict.update(self.additional_properties)
        field_dict.update({})
        if census_status is not UNSET:
            field_dict["census_status"] = census_status
        if client is not UNSET:
            field_dict["client"] = client
        if payroll_status is not UNSET:
            field_dict["payroll_status"] = payroll_status
        if pye is not UNSET:
            field_dict["pye"] = pye
        if search is not UNSET:
            field_dict["search"] = search
        if status is not UNSET:
            field_dict["status"] = status
        if tags is not UNSET:
            field_dict["tags"] = tags
        if type_ is not UNSET:
            field_dict["type"] = type_

        return field_dict

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

        client = cast(list[str], d.pop("client", UNSET))

        payroll_status = cast(list[str], d.pop("payroll_status", UNSET))

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

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

        status = cast(list[str], d.pop("status", UNSET))

        tags = cast(list[str], d.pop("tags", UNSET))

        type_ = cast(list[str], d.pop("type", UNSET))

        pkg_routes_packages_retirement_participants_census_status_filters = cls(
            census_status=census_status,
            client=client,
            payroll_status=payroll_status,
            pye=pye,
            search=search,
            status=status,
            tags=tags,
            type_=type_,
        )

        pkg_routes_packages_retirement_participants_census_status_filters.additional_properties = d
        return pkg_routes_packages_retirement_participants_census_status_filters

    @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
