from typing import ( TYPE_CHECKING, Any, BinaryIO, Dict, List, Optional, TextIO, Tuple, Type, TypeVar, Union, cast, ) import attr from ..types import UNSET, Unset T = TypeVar("T", bound="FacebookTargetingInterest") @attr.s(auto_attribs=True) class FacebookTargetingInterest: """ Attributes: id (str): name (str): path (List[str]): disambiguation_category (Union[Unset, None, str]): topic (Union[Unset, None, str]): """ id: str name: str path: List[str] disambiguation_category: Union[Unset, None, str] = UNSET topic: Union[Unset, None, str] = UNSET additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: id = self.id name = self.name path = self.path disambiguation_category = self.disambiguation_category topic = self.topic field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { "id": id, "name": name, "path": path, } ) if disambiguation_category is not UNSET: field_dict["disambiguationCategory"] = disambiguation_category if topic is not UNSET: field_dict["topic"] = topic return field_dict @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() id = d.pop("id") name = d.pop("name") path = cast(List[str], d.pop("path")) disambiguation_category = d.pop("disambiguationCategory", UNSET) topic = d.pop("topic", UNSET) facebook_targeting_interest = cls( id=id, name=name, path=path, disambiguation_category=disambiguation_category, topic=topic, ) facebook_targeting_interest.additional_properties = d return facebook_targeting_interest @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