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


@_attrs_define
class TypesClientTaskDataTemplate:
    """
    Attributes:
        destination (str | Unset):
        download_file (str | Unset):
        form_template (str | Unset):
        notice_file (str | Unset):
        payroll_enabled (str | Unset):
        py (str | Unset):
        url (str | Unset):
    """

    destination: str | Unset = UNSET
    download_file: str | Unset = UNSET
    form_template: str | Unset = UNSET
    notice_file: str | Unset = UNSET
    payroll_enabled: str | Unset = UNSET
    py: str | Unset = UNSET
    url: str | Unset = UNSET
    additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)

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

        download_file = self.download_file

        form_template = self.form_template

        notice_file = self.notice_file

        payroll_enabled = self.payroll_enabled

        py = self.py

        url = self.url

        field_dict: dict[str, Any] = {}
        field_dict.update(self.additional_properties)
        field_dict.update({})
        if destination is not UNSET:
            field_dict["destination"] = destination
        if download_file is not UNSET:
            field_dict["download_file"] = download_file
        if form_template is not UNSET:
            field_dict["form_template"] = form_template
        if notice_file is not UNSET:
            field_dict["notice_file"] = notice_file
        if payroll_enabled is not UNSET:
            field_dict["payroll_enabled"] = payroll_enabled
        if py is not UNSET:
            field_dict["py"] = py
        if url is not UNSET:
            field_dict["url"] = url

        return field_dict

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

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

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

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

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

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

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

        types_client_task_data_template = cls(
            destination=destination,
            download_file=download_file,
            form_template=form_template,
            notice_file=notice_file,
            payroll_enabled=payroll_enabled,
            py=py,
            url=url,
        )

        types_client_task_data_template.additional_properties = d
        return types_client_task_data_template

    @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
