from typing import ( TYPE_CHECKING, Any, BinaryIO, Dict, List, Optional, TextIO, Tuple, Type, TypeVar, Union, ) import attr from ..models.campaign_call_to_action import CampaignCallToAction from ..models.campaign_content_type import CampaignContentType from ..models.campaign_link_type import CampaignLinkType from ..models.campaign_platform_selector import CampaignPlatformSelector from ..types import UNSET, Unset T = TypeVar("T", bound="MetaCampaignCreativeInput") @attr.s(auto_attribs=True) class MetaCampaignCreativeInput: """ Attributes: content_type (CampaignContentType): An enumeration. platform (CampaignPlatformSelector): An enumeration. link_type (CampaignLinkType): An enumeration. call_to_action (CampaignCallToAction): An enumeration. post_external_id (Union[Unset, None, str]): primary_text (Union[Unset, None, str]): headline (Union[Unset, None, str]): description (Union[Unset, None, str]): website_url (Union[Unset, None, str]): landing_page_path (Union[Unset, None, str]): Songwhip landing page path landing_page_product_id (Union[Unset, None, int]): Songwhip landing page product Id """ content_type: CampaignContentType platform: CampaignPlatformSelector link_type: CampaignLinkType call_to_action: CampaignCallToAction post_external_id: Union[Unset, None, str] = UNSET primary_text: Union[Unset, None, str] = UNSET headline: Union[Unset, None, str] = UNSET description: Union[Unset, None, str] = UNSET website_url: Union[Unset, None, str] = UNSET landing_page_path: Union[Unset, None, str] = UNSET landing_page_product_id: Union[Unset, None, int] = UNSET additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: content_type = self.content_type.value platform = self.platform.value link_type = self.link_type.value call_to_action = self.call_to_action.value post_external_id = self.post_external_id primary_text = self.primary_text headline = self.headline description = self.description website_url = self.website_url landing_page_path = self.landing_page_path landing_page_product_id = self.landing_page_product_id field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { "contentType": content_type, "platform": platform, "linkType": link_type, "callToAction": call_to_action, } ) if post_external_id is not UNSET: field_dict["postExternalId"] = post_external_id if primary_text is not UNSET: field_dict["primaryText"] = primary_text if headline is not UNSET: field_dict["headline"] = headline if description is not UNSET: field_dict["description"] = description if website_url is not UNSET: field_dict["websiteUrl"] = website_url if landing_page_path is not UNSET: field_dict["landingPagePath"] = landing_page_path if landing_page_product_id is not UNSET: field_dict["landingPageProductId"] = landing_page_product_id return field_dict @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() content_type = CampaignContentType(d.pop("contentType")) platform = CampaignPlatformSelector(d.pop("platform")) link_type = CampaignLinkType(d.pop("linkType")) call_to_action = CampaignCallToAction(d.pop("callToAction")) post_external_id = d.pop("postExternalId", UNSET) primary_text = d.pop("primaryText", UNSET) headline = d.pop("headline", UNSET) description = d.pop("description", UNSET) website_url = d.pop("websiteUrl", UNSET) landing_page_path = d.pop("landingPagePath", UNSET) landing_page_product_id = d.pop("landingPageProductId", UNSET) meta_campaign_creative_input = cls( content_type=content_type, platform=platform, link_type=link_type, call_to_action=call_to_action, post_external_id=post_external_id, primary_text=primary_text, headline=headline, description=description, website_url=website_url, landing_page_path=landing_page_path, landing_page_product_id=landing_page_product_id, ) meta_campaign_creative_input.additional_properties = d return meta_campaign_creative_input @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