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


@_attrs_define
class PkgRoutesIamLoginRequest:
    """
    Attributes:
        client (str | Unset):
        code (str | Unset):
        email (str | Unset):
        password (str | Unset):
        password_reset (bool | Unset):
        remember (bool | Unset):
        team (str | Unset):
        to (str | Unset):
        to_cp (bool | Unset):
    """

    client: str | Unset = UNSET
    code: str | Unset = UNSET
    email: str | Unset = UNSET
    password: str | Unset = UNSET
    password_reset: bool | Unset = UNSET
    remember: bool | Unset = UNSET
    team: str | Unset = UNSET
    to: str | Unset = UNSET
    to_cp: bool | Unset = UNSET
    additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)

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

        code = self.code

        email = self.email

        password = self.password

        password_reset = self.password_reset

        remember = self.remember

        team = self.team

        to = self.to

        to_cp = self.to_cp

        field_dict: dict[str, Any] = {}
        field_dict.update(self.additional_properties)
        field_dict.update({})
        if client is not UNSET:
            field_dict["client"] = client
        if code is not UNSET:
            field_dict["code"] = code
        if email is not UNSET:
            field_dict["email"] = email
        if password is not UNSET:
            field_dict["password"] = password
        if password_reset is not UNSET:
            field_dict["password_reset"] = password_reset
        if remember is not UNSET:
            field_dict["remember"] = remember
        if team is not UNSET:
            field_dict["team"] = team
        if to is not UNSET:
            field_dict["to"] = to
        if to_cp is not UNSET:
            field_dict["to_cp"] = to_cp

        return field_dict

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

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

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

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

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

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

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

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

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

        pkg_routes_iam_login_request = cls(
            client=client,
            code=code,
            email=email,
            password=password,
            password_reset=password_reset,
            remember=remember,
            team=team,
            to=to,
            to_cp=to_cp,
        )

        pkg_routes_iam_login_request.additional_properties = d
        return pkg_routes_iam_login_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
