# 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 Video(BaseModel):
    """
    Video
    """ # noqa: E501
    id: Optional[StrictStr] = Field(default=None, alias="Id")
    description: Optional[StrictStr] = Field(default=None, alias="Description")
    thumbnail_url: Optional[StrictStr] = Field(default=None, alias="ThumbnailUrl")
    source_url: Optional[StrictStr] = Field(default=None, alias="SourceUrl")
    url: Optional[StrictStr] = Field(default=None, alias="Url")
    aspect_ratio: Optional[StrictStr] = Field(default=None, alias="AspectRatio")
    duration_in_milliseconds: Optional[StrictInt] = Field(default=None, alias="DurationInMilliseconds")
    status: Optional[StrictStr] = Field(default=None, alias="Status")
    created_date_time_in_utc: Optional[datetime] = Field(default=None, alias="CreatedDateTimeInUTC")
    modified_date_time_in_utc: Optional[datetime] = Field(default=None, alias="ModifiedDateTimeInUTC")
    failure_code: Optional[StrictStr] = Field(default=None, alias="FailureCode")
    __properties: ClassVar[List[str]] = ["Id", "Description", "ThumbnailUrl", "SourceUrl", "Url", "AspectRatio", "DurationInMilliseconds", "Status", "CreatedDateTimeInUTC", "ModifiedDateTimeInUTC", "FailureCode"]

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

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

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

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

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

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

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

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

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

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

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

        return _dict

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

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

        _obj = cls.model_validate({
            "Id": obj.get("Id") if obj.get("Id") is not None else None,
                        "Description": obj.get("Description") if obj.get("Description") is not None else None,
                        "ThumbnailUrl": obj.get("ThumbnailUrl") if obj.get("ThumbnailUrl") is not None else None,
                        "SourceUrl": obj.get("SourceUrl") if obj.get("SourceUrl") is not None else None,
                        "Url": obj.get("Url") if obj.get("Url") is not None else None,
                        "AspectRatio": obj.get("AspectRatio") if obj.get("AspectRatio") is not None else None,
                        "DurationInMilliseconds": obj.get("DurationInMilliseconds") if obj.get("DurationInMilliseconds") is not None else None,
                        "Status": obj.get("Status") if obj.get("Status") is not None else None,
                        "CreatedDateTimeInUTC": obj.get("CreatedDateTimeInUTC") if obj.get("CreatedDateTimeInUTC") is not None else None,
                        "ModifiedDateTimeInUTC": obj.get("ModifiedDateTimeInUTC") if obj.get("ModifiedDateTimeInUTC") is not None else None,
                        "FailureCode": obj.get("FailureCode") if obj.get("FailureCode") is not None else None
        })
        return _obj
