# coding: utf-8

"""
    YouTube Data API v3

    The YouTube Data API v3 is an API that provides access to YouTube data, such as videos, playlists, and channels.

    The version of the OpenAPI document: v3
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


from __future__ import annotations
import pprint
import re  # noqa: F401
import json

from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from youtube_ti.models.localized_property import LocalizedProperty
from typing import Optional, Set
from typing_extensions import Self

class ImageSettings(BaseModel):
    """
    Branding properties for images associated with the channel.
    """ # noqa: E501
    background_image_url: Optional[LocalizedProperty] = Field(default=None, alias="backgroundImageUrl")
    banner_external_url: Optional[StrictStr] = Field(default=None, description="This is generated when a ChannelBanner.Insert request has succeeded for the given channel.", alias="bannerExternalUrl")
    banner_image_url: Optional[StrictStr] = Field(default=None, description="Banner image. Desktop size (1060x175).", alias="bannerImageUrl")
    banner_mobile_extra_hd_image_url: Optional[StrictStr] = Field(default=None, description="Banner image. Mobile size high resolution (1440x395).", alias="bannerMobileExtraHdImageUrl")
    banner_mobile_hd_image_url: Optional[StrictStr] = Field(default=None, description="Banner image. Mobile size high resolution (1280x360).", alias="bannerMobileHdImageUrl")
    banner_mobile_image_url: Optional[StrictStr] = Field(default=None, description="Banner image. Mobile size (640x175).", alias="bannerMobileImageUrl")
    banner_mobile_low_image_url: Optional[StrictStr] = Field(default=None, description="Banner image. Mobile size low resolution (320x88).", alias="bannerMobileLowImageUrl")
    banner_mobile_medium_hd_image_url: Optional[StrictStr] = Field(default=None, description="Banner image. Mobile size medium/high resolution (960x263).", alias="bannerMobileMediumHdImageUrl")
    banner_tablet_extra_hd_image_url: Optional[StrictStr] = Field(default=None, description="Banner image. Tablet size extra high resolution (2560x424).", alias="bannerTabletExtraHdImageUrl")
    banner_tablet_hd_image_url: Optional[StrictStr] = Field(default=None, description="Banner image. Tablet size high resolution (2276x377).", alias="bannerTabletHdImageUrl")
    banner_tablet_image_url: Optional[StrictStr] = Field(default=None, description="Banner image. Tablet size (1707x283).", alias="bannerTabletImageUrl")
    banner_tablet_low_image_url: Optional[StrictStr] = Field(default=None, description="Banner image. Tablet size low resolution (1138x188).", alias="bannerTabletLowImageUrl")
    banner_tv_high_image_url: Optional[StrictStr] = Field(default=None, description="Banner image. TV size high resolution (1920x1080).", alias="bannerTvHighImageUrl")
    banner_tv_image_url: Optional[StrictStr] = Field(default=None, description="Banner image. TV size extra high resolution (2120x1192).", alias="bannerTvImageUrl")
    banner_tv_low_image_url: Optional[StrictStr] = Field(default=None, description="Banner image. TV size low resolution (854x480).", alias="bannerTvLowImageUrl")
    banner_tv_medium_image_url: Optional[StrictStr] = Field(default=None, description="Banner image. TV size medium resolution (1280x720).", alias="bannerTvMediumImageUrl")
    large_branded_banner_image_imap_script: Optional[LocalizedProperty] = Field(default=None, alias="largeBrandedBannerImageImapScript")
    large_branded_banner_image_url: Optional[LocalizedProperty] = Field(default=None, alias="largeBrandedBannerImageUrl")
    small_branded_banner_image_imap_script: Optional[LocalizedProperty] = Field(default=None, alias="smallBrandedBannerImageImapScript")
    small_branded_banner_image_url: Optional[LocalizedProperty] = Field(default=None, alias="smallBrandedBannerImageUrl")
    tracking_image_url: Optional[StrictStr] = Field(default=None, description="The URL for a 1px by 1px tracking pixel that can be used to collect statistics for views of the channel or video pages.", alias="trackingImageUrl")
    watch_icon_image_url: Optional[StrictStr] = Field(default=None, alias="watchIconImageUrl")
    __properties: ClassVar[List[str]] = ["backgroundImageUrl", "bannerExternalUrl", "bannerImageUrl", "bannerMobileExtraHdImageUrl", "bannerMobileHdImageUrl", "bannerMobileImageUrl", "bannerMobileLowImageUrl", "bannerMobileMediumHdImageUrl", "bannerTabletExtraHdImageUrl", "bannerTabletHdImageUrl", "bannerTabletImageUrl", "bannerTabletLowImageUrl", "bannerTvHighImageUrl", "bannerTvImageUrl", "bannerTvLowImageUrl", "bannerTvMediumImageUrl", "largeBrandedBannerImageImapScript", "largeBrandedBannerImageUrl", "smallBrandedBannerImageImapScript", "smallBrandedBannerImageUrl", "trackingImageUrl", "watchIconImageUrl"]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of ImageSettings from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        # override the default output from pydantic by calling `to_dict()` of background_image_url
        if self.background_image_url:
            _dict['backgroundImageUrl'] = self.background_image_url.to_dict()
        # override the default output from pydantic by calling `to_dict()` of large_branded_banner_image_imap_script
        if self.large_branded_banner_image_imap_script:
            _dict['largeBrandedBannerImageImapScript'] = self.large_branded_banner_image_imap_script.to_dict()
        # override the default output from pydantic by calling `to_dict()` of large_branded_banner_image_url
        if self.large_branded_banner_image_url:
            _dict['largeBrandedBannerImageUrl'] = self.large_branded_banner_image_url.to_dict()
        # override the default output from pydantic by calling `to_dict()` of small_branded_banner_image_imap_script
        if self.small_branded_banner_image_imap_script:
            _dict['smallBrandedBannerImageImapScript'] = self.small_branded_banner_image_imap_script.to_dict()
        # override the default output from pydantic by calling `to_dict()` of small_branded_banner_image_url
        if self.small_branded_banner_image_url:
            _dict['smallBrandedBannerImageUrl'] = self.small_branded_banner_image_url.to_dict()
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of ImageSettings from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "backgroundImageUrl": LocalizedProperty.from_dict(obj["backgroundImageUrl"]) if obj.get("backgroundImageUrl") is not None else None,
            "bannerExternalUrl": obj.get("bannerExternalUrl"),
            "bannerImageUrl": obj.get("bannerImageUrl"),
            "bannerMobileExtraHdImageUrl": obj.get("bannerMobileExtraHdImageUrl"),
            "bannerMobileHdImageUrl": obj.get("bannerMobileHdImageUrl"),
            "bannerMobileImageUrl": obj.get("bannerMobileImageUrl"),
            "bannerMobileLowImageUrl": obj.get("bannerMobileLowImageUrl"),
            "bannerMobileMediumHdImageUrl": obj.get("bannerMobileMediumHdImageUrl"),
            "bannerTabletExtraHdImageUrl": obj.get("bannerTabletExtraHdImageUrl"),
            "bannerTabletHdImageUrl": obj.get("bannerTabletHdImageUrl"),
            "bannerTabletImageUrl": obj.get("bannerTabletImageUrl"),
            "bannerTabletLowImageUrl": obj.get("bannerTabletLowImageUrl"),
            "bannerTvHighImageUrl": obj.get("bannerTvHighImageUrl"),
            "bannerTvImageUrl": obj.get("bannerTvImageUrl"),
            "bannerTvLowImageUrl": obj.get("bannerTvLowImageUrl"),
            "bannerTvMediumImageUrl": obj.get("bannerTvMediumImageUrl"),
            "largeBrandedBannerImageImapScript": LocalizedProperty.from_dict(obj["largeBrandedBannerImageImapScript"]) if obj.get("largeBrandedBannerImageImapScript") is not None else None,
            "largeBrandedBannerImageUrl": LocalizedProperty.from_dict(obj["largeBrandedBannerImageUrl"]) if obj.get("largeBrandedBannerImageUrl") is not None else None,
            "smallBrandedBannerImageImapScript": LocalizedProperty.from_dict(obj["smallBrandedBannerImageImapScript"]) if obj.get("smallBrandedBannerImageImapScript") is not None else None,
            "smallBrandedBannerImageUrl": LocalizedProperty.from_dict(obj["smallBrandedBannerImageUrl"]) if obj.get("smallBrandedBannerImageUrl") is not None else None,
            "trackingImageUrl": obj.get("trackingImageUrl"),
            "watchIconImageUrl": obj.get("watchIconImageUrl")
        })
        return _obj


