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


@_attrs_define
class PkgRoutesAdminParseReportsClientReports:
    """
    Attributes:
        admin_note (str | Unset):
        assignees (list[str] | Unset):
        client (str | Unset):
        client_name (str | Unset):
        mapping_statuses (list[str] | Unset):
        missing_provisions (bool | Unset):
        num_reports (int | Unset):
        team (str | Unset):
        uploaded_at (str | Unset):
    """

    admin_note: str | Unset = UNSET
    assignees: list[str] | Unset = UNSET
    client: str | Unset = UNSET
    client_name: str | Unset = UNSET
    mapping_statuses: list[str] | Unset = UNSET
    missing_provisions: bool | Unset = UNSET
    num_reports: int | Unset = UNSET
    team: str | Unset = UNSET
    uploaded_at: str | Unset = UNSET
    additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)

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

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

        client = self.client

        client_name = self.client_name

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

        missing_provisions = self.missing_provisions

        num_reports = self.num_reports

        team = self.team

        uploaded_at = self.uploaded_at

        field_dict: dict[str, Any] = {}
        field_dict.update(self.additional_properties)
        field_dict.update({})
        if admin_note is not UNSET:
            field_dict["admin_note"] = admin_note
        if assignees is not UNSET:
            field_dict["assignees"] = assignees
        if client is not UNSET:
            field_dict["client"] = client
        if client_name is not UNSET:
            field_dict["client_name"] = client_name
        if mapping_statuses is not UNSET:
            field_dict["mapping_statuses"] = mapping_statuses
        if missing_provisions is not UNSET:
            field_dict["missing_provisions"] = missing_provisions
        if num_reports is not UNSET:
            field_dict["num_reports"] = num_reports
        if team is not UNSET:
            field_dict["team"] = team
        if uploaded_at is not UNSET:
            field_dict["uploaded_at"] = uploaded_at

        return field_dict

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

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

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

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

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

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

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

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

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

        pkg_routes_admin_parse_reports_client_reports = cls(
            admin_note=admin_note,
            assignees=assignees,
            client=client,
            client_name=client_name,
            mapping_statuses=mapping_statuses,
            missing_provisions=missing_provisions,
            num_reports=num_reports,
            team=team,
            uploaded_at=uploaded_at,
        )

        pkg_routes_admin_parse_reports_client_reports.additional_properties = d
        return pkg_routes_admin_parse_reports_client_reports

    @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
