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


@_attrs_define
class TypesNotice:
    """
    Attributes:
        field_id (str | Unset):
        attempts (int | Unset):
        bounced (bool | Unset):
        client (str | Unset):
        created_at (str | Unset):
        deleted_at (str | Unset):
        downloaded_at (str | Unset):
        email (str | Unset):
        file (str | Unset):
        first_name (str | Unset):
        for_participant (bool | Unset):
        ip (str | Unset):
        last_name (str | Unset):
        opened_at (str | Unset):
        resent_at (str | Unset):
        sent_at (str | Unset):
        task (str | Unset):
        team (str | Unset):
    """

    field_id: str | Unset = UNSET
    attempts: int | Unset = UNSET
    bounced: bool | Unset = UNSET
    client: str | Unset = UNSET
    created_at: str | Unset = UNSET
    deleted_at: str | Unset = UNSET
    downloaded_at: str | Unset = UNSET
    email: str | Unset = UNSET
    file: str | Unset = UNSET
    first_name: str | Unset = UNSET
    for_participant: bool | Unset = UNSET
    ip: str | Unset = UNSET
    last_name: str | Unset = UNSET
    opened_at: str | Unset = UNSET
    resent_at: str | Unset = UNSET
    sent_at: str | Unset = UNSET
    task: str | Unset = UNSET
    team: str | Unset = UNSET
    additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)

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

        attempts = self.attempts

        bounced = self.bounced

        client = self.client

        created_at = self.created_at

        deleted_at = self.deleted_at

        downloaded_at = self.downloaded_at

        email = self.email

        file = self.file

        first_name = self.first_name

        for_participant = self.for_participant

        ip = self.ip

        last_name = self.last_name

        opened_at = self.opened_at

        resent_at = self.resent_at

        sent_at = self.sent_at

        task = self.task

        team = self.team

        field_dict: dict[str, Any] = {}
        field_dict.update(self.additional_properties)
        field_dict.update({})
        if field_id is not UNSET:
            field_dict["_id"] = field_id
        if attempts is not UNSET:
            field_dict["attempts"] = attempts
        if bounced is not UNSET:
            field_dict["bounced"] = bounced
        if client is not UNSET:
            field_dict["client"] = client
        if created_at is not UNSET:
            field_dict["created_at"] = created_at
        if deleted_at is not UNSET:
            field_dict["deleted_at"] = deleted_at
        if downloaded_at is not UNSET:
            field_dict["downloaded_at"] = downloaded_at
        if email is not UNSET:
            field_dict["email"] = email
        if file is not UNSET:
            field_dict["file"] = file
        if first_name is not UNSET:
            field_dict["first_name"] = first_name
        if for_participant is not UNSET:
            field_dict["for_participant"] = for_participant
        if ip is not UNSET:
            field_dict["ip"] = ip
        if last_name is not UNSET:
            field_dict["last_name"] = last_name
        if opened_at is not UNSET:
            field_dict["opened_at"] = opened_at
        if resent_at is not UNSET:
            field_dict["resent_at"] = resent_at
        if sent_at is not UNSET:
            field_dict["sent_at"] = sent_at
        if task is not UNSET:
            field_dict["task"] = task
        if team is not UNSET:
            field_dict["team"] = team

        return field_dict

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        types_notice = cls(
            field_id=field_id,
            attempts=attempts,
            bounced=bounced,
            client=client,
            created_at=created_at,
            deleted_at=deleted_at,
            downloaded_at=downloaded_at,
            email=email,
            file=file,
            first_name=first_name,
            for_participant=for_participant,
            ip=ip,
            last_name=last_name,
            opened_at=opened_at,
            resent_at=resent_at,
            sent_at=sent_at,
            task=task,
            team=team,
        )

        types_notice.additional_properties = d
        return types_notice

    @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
