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


@_attrs_define
class LegacytypesBrandConfig:
    """
    Attributes:
        color (str | Unset):
        display (str | Unset):
        domain (str | Unset):
        edges (str | Unset):
        logo (str | Unset):
        wallpaper (str | Unset):
    """

    color: str | Unset = UNSET
    display: str | Unset = UNSET
    domain: str | Unset = UNSET
    edges: str | Unset = UNSET
    logo: str | Unset = UNSET
    wallpaper: str | Unset = UNSET
    additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)

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

        display = self.display

        domain = self.domain

        edges = self.edges

        logo = self.logo

        wallpaper = self.wallpaper

        field_dict: dict[str, Any] = {}
        field_dict.update(self.additional_properties)
        field_dict.update({})
        if color is not UNSET:
            field_dict["color"] = color
        if display is not UNSET:
            field_dict["display"] = display
        if domain is not UNSET:
            field_dict["domain"] = domain
        if edges is not UNSET:
            field_dict["edges"] = edges
        if logo is not UNSET:
            field_dict["logo"] = logo
        if wallpaper is not UNSET:
            field_dict["wallpaper"] = wallpaper

        return field_dict

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

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

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

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

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

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

        legacytypes_brand_config = cls(
            color=color,
            display=display,
            domain=domain,
            edges=edges,
            logo=logo,
            wallpaper=wallpaper,
        )

        legacytypes_brand_config.additional_properties = d
        return legacytypes_brand_config

    @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
