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


@_attrs_define
class PkgRoutesAdminParseReportsListClientsFilters:
    """
    Attributes:
        assignee (list[str] | Unset):
        hide_errors (bool | Unset):
        mapping_status (list[str] | Unset):
        search (str | Unset):
        team (list[str] | Unset):
    """

    assignee: list[str] | Unset = UNSET
    hide_errors: bool | Unset = UNSET
    mapping_status: list[str] | Unset = UNSET
    search: str | Unset = UNSET
    team: list[str] | Unset = UNSET
    additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)

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

        hide_errors = self.hide_errors

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

        search = self.search

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

        field_dict: dict[str, Any] = {}
        field_dict.update(self.additional_properties)
        field_dict.update({})
        if assignee is not UNSET:
            field_dict["assignee"] = assignee
        if hide_errors is not UNSET:
            field_dict["hide_errors"] = hide_errors
        if mapping_status is not UNSET:
            field_dict["mapping_status"] = mapping_status
        if search is not UNSET:
            field_dict["search"] = search
        if team is not UNSET:
            field_dict["team"] = team

        return field_dict

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

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

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

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

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

        pkg_routes_admin_parse_reports_list_clients_filters = cls(
            assignee=assignee,
            hide_errors=hide_errors,
            mapping_status=mapping_status,
            search=search,
            team=team,
        )

        pkg_routes_admin_parse_reports_list_clients_filters.additional_properties = d
        return pkg_routes_admin_parse_reports_list_clients_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
