# coding: utf-8

"""
    CampaignManagementService

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

    The version of the OpenAPI document: 1.0.0
    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 datetime import datetime
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional, Union, Set
from typing_extensions import Self

class VideoRecommendationImageData(BaseModel):
    """
    VideoRecommendationImageData
    """ # noqa: E501
    width: Optional[StrictInt] = Field(default=None, alias="width")
    height: Optional[StrictInt] = Field(default=None, alias="height")
    item_id: Optional[StrictStr] = Field(default=None, alias="itemId")
    cropped_image_url: Optional[StrictStr] = Field(default=None, alias="croppedImageUrl")
    video_clip_url: Optional[StrictStr] = Field(default=None, alias="videoClipUrl")
    is_video_feasible: Optional[StrictBool] = Field(default=None, alias="isVideoFeasible")
    __properties: ClassVar[List[str]] = ["width", "height", "itemId", "croppedImageUrl", "videoClipUrl", "isVideoFeasible"]

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

    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,
        )
        # set to None if width (nullable) is None
        # and model_fields_set contains the field
        if self.width is None and "width" in self.model_fields_set:
            _dict['width'] = None

        # set to None if height (nullable) is None
        # and model_fields_set contains the field
        if self.height is None and "height" in self.model_fields_set:
            _dict['height'] = None

        # set to None if item_id (nullable) is None
        # and model_fields_set contains the field
        if self.item_id is None and "item_id" in self.model_fields_set:
            _dict['itemId'] = None

        # set to None if cropped_image_url (nullable) is None
        # and model_fields_set contains the field
        if self.cropped_image_url is None and "cropped_image_url" in self.model_fields_set:
            _dict['croppedImageUrl'] = None

        # set to None if video_clip_url (nullable) is None
        # and model_fields_set contains the field
        if self.video_clip_url is None and "video_clip_url" in self.model_fields_set:
            _dict['videoClipUrl'] = None

        # set to None if is_video_feasible (nullable) is None
        # and model_fields_set contains the field
        if self.is_video_feasible is None and "is_video_feasible" in self.model_fields_set:
            _dict['isVideoFeasible'] = None

        return _dict

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

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

        _obj = cls.model_validate({
            "width": obj.get("Width") if obj.get("Width") is not None else None,
                        "height": obj.get("Height") if obj.get("Height") is not None else None,
                        "itemId": obj.get("ItemId") if obj.get("ItemId") is not None else None,
                        "croppedImageUrl": obj.get("CroppedImageUrl") if obj.get("CroppedImageUrl") is not None else None,
                        "videoClipUrl": obj.get("VideoClipUrl") if obj.get("VideoClipUrl") is not None else None,
                        "isVideoFeasible": obj.get("IsVideoFeasible") if obj.get("IsVideoFeasible") is not None else None
        })
        return _obj
