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


@_attrs_define
class PkgRoutesEfastMergeEfastFormsRequest:
    """
    Attributes:
        attachments (list[Any] | Unset):
        dcg_attachments (list[Any] | Unset):
        forms (list[Any] | Unset):
        project (str | Unset):
        schedules (list[Any] | Unset):
        task (str | Unset):
    """

    attachments: list[Any] | Unset = UNSET
    dcg_attachments: list[Any] | Unset = UNSET
    forms: list[Any] | Unset = UNSET
    project: str | Unset = UNSET
    schedules: list[Any] | Unset = UNSET
    task: str | Unset = UNSET
    additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)

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

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

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

        project = self.project

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

        task = self.task

        field_dict: dict[str, Any] = {}
        field_dict.update(self.additional_properties)
        field_dict.update({})
        if attachments is not UNSET:
            field_dict["attachments"] = attachments
        if dcg_attachments is not UNSET:
            field_dict["dcg_attachments"] = dcg_attachments
        if forms is not UNSET:
            field_dict["forms"] = forms
        if project is not UNSET:
            field_dict["project"] = project
        if schedules is not UNSET:
            field_dict["schedules"] = schedules
        if task is not UNSET:
            field_dict["task"] = task

        return field_dict

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

        dcg_attachments = cast(list[Any], d.pop("dcg_attachments", UNSET))

        forms = cast(list[Any], d.pop("forms", UNSET))

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

        schedules = cast(list[Any], d.pop("schedules", UNSET))

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

        pkg_routes_efast_merge_efast_forms_request = cls(
            attachments=attachments,
            dcg_attachments=dcg_attachments,
            forms=forms,
            project=project,
            schedules=schedules,
            task=task,
        )

        pkg_routes_efast_merge_efast_forms_request.additional_properties = d
        return pkg_routes_efast_merge_efast_forms_request

    @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
