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


@_attrs_define
class PkgRoutesAdminStatsResult:
    """
    Attributes:
        assists_count (int | Unset):
        map_payroll_count (int | Unset):
        parse_docs_count (int | Unset):
    """

    assists_count: int | Unset = UNSET
    map_payroll_count: int | Unset = UNSET
    parse_docs_count: int | Unset = UNSET
    additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)

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

        map_payroll_count = self.map_payroll_count

        parse_docs_count = self.parse_docs_count

        field_dict: dict[str, Any] = {}
        field_dict.update(self.additional_properties)
        field_dict.update({})
        if assists_count is not UNSET:
            field_dict["assists_count"] = assists_count
        if map_payroll_count is not UNSET:
            field_dict["map_payroll_count"] = map_payroll_count
        if parse_docs_count is not UNSET:
            field_dict["parse_docs_count"] = parse_docs_count

        return field_dict

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

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

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

        pkg_routes_admin_stats_result = cls(
            assists_count=assists_count,
            map_payroll_count=map_payroll_count,
            parse_docs_count=parse_docs_count,
        )

        pkg_routes_admin_stats_result.additional_properties = d
        return pkg_routes_admin_stats_result

    @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
