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


@_attrs_define
class PkgRoutesAdminParseReportsPayrollRun:
    """
    Attributes:
        admin_note (str | Unset):
        check_date (str | Unset):
        client_payroll_id (str | Unset):
        created_at (str | Unset):
        num_employees (int | Unset):
        pay_period_end (str | Unset):
        pay_period_start (str | Unset):
        provider (str | Unset):
        reports (list[str] | Unset):
        status (str | Unset):
        total_gross_pay (float | Unset):
    """

    admin_note: str | Unset = UNSET
    check_date: str | Unset = UNSET
    client_payroll_id: str | Unset = UNSET
    created_at: str | Unset = UNSET
    num_employees: int | Unset = UNSET
    pay_period_end: str | Unset = UNSET
    pay_period_start: str | Unset = UNSET
    provider: str | Unset = UNSET
    reports: list[str] | Unset = UNSET
    status: str | Unset = UNSET
    total_gross_pay: float | 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

        check_date = self.check_date

        client_payroll_id = self.client_payroll_id

        created_at = self.created_at

        num_employees = self.num_employees

        pay_period_end = self.pay_period_end

        pay_period_start = self.pay_period_start

        provider = self.provider

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

        status = self.status

        total_gross_pay = self.total_gross_pay

        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 check_date is not UNSET:
            field_dict["check_date"] = check_date
        if client_payroll_id is not UNSET:
            field_dict["client_payroll_id"] = client_payroll_id
        if created_at is not UNSET:
            field_dict["created_at"] = created_at
        if num_employees is not UNSET:
            field_dict["num_employees"] = num_employees
        if pay_period_end is not UNSET:
            field_dict["pay_period_end"] = pay_period_end
        if pay_period_start is not UNSET:
            field_dict["pay_period_start"] = pay_period_start
        if provider is not UNSET:
            field_dict["provider"] = provider
        if reports is not UNSET:
            field_dict["reports"] = reports
        if status is not UNSET:
            field_dict["status"] = status
        if total_gross_pay is not UNSET:
            field_dict["total_gross_pay"] = total_gross_pay

        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)

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

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

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

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

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

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

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

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

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

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

        pkg_routes_admin_parse_reports_payroll_run = cls(
            admin_note=admin_note,
            check_date=check_date,
            client_payroll_id=client_payroll_id,
            created_at=created_at,
            num_employees=num_employees,
            pay_period_end=pay_period_end,
            pay_period_start=pay_period_start,
            provider=provider,
            reports=reports,
            status=status,
            total_gross_pay=total_gross_pay,
        )

        pkg_routes_admin_parse_reports_payroll_run.additional_properties = d
        return pkg_routes_admin_parse_reports_payroll_run

    @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
