# -*- coding: utf-8 -*-

"""
zypev1

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""
from zypev1.models.embedded_category import EmbeddedCategory
from zypev1.models.image import Image
from zypev1.models.segment import Segment


class Video(object):

    """Implementation of the 'Video' model.

    TODO: type model description here.

    Attributes:
        active (bool): TODO: type description here.
        country (string): The country the video was created in
        description (string): Full length description of the video
        short_description (string): Brief description of the video
        disable_at (string): Timestamp of when your video will become
            inactive
        enable_at (string): Timestamp of when your video will become active
        episode (float): Episode number
        season (float): Season number
        featured (bool): TODO: type description here.
        friendly_title (string): The URL friendly title of the video
        keywords (list of string): Keywords for the video
        mature_content (bool): Whether or not the video requires the viewer to
            be 18+ to view
        pass_required (bool): TODO: type description here.
        published_at (string): Timestamp when video was published
        subscription_required (bool): TODO: type description here.
        discovery_url (string): URL where your video can be discovered
        custom_thumbnail_url (string): URL where your custom thumbnail is
            stored
        subscription_ads_enabled (bool): TODO: type description here.
        title (string): Title of the video
        zobject_ids (object): IDs of Zobjects
        custom_attributes (object): Any custom attributes you want to
            attribute to the video
        categories_attributes (list of EmbeddedCategory): TODO: type
            description here.
        segments (list of Segment): TODO: type description here.
        images_attributes (list of Image): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "active": 'active',
        "country": 'country',
        "description": 'description',
        "short_description": 'short_description',
        "disable_at": 'disable_at',
        "enable_at": 'enable_at',
        "episode": 'episode',
        "season": 'season',
        "featured": 'featured',
        "friendly_title": 'friendly_title',
        "keywords": 'keywords',
        "mature_content": 'mature_content',
        "pass_required": 'pass_required',
        "published_at": 'published_at',
        "subscription_required": 'subscription_required',
        "discovery_url": 'discovery_url',
        "custom_thumbnail_url": 'custom_thumbnail_url',
        "subscription_ads_enabled": 'subscription_ads_enabled',
        "title": 'title',
        "zobject_ids": 'zobject_ids',
        "custom_attributes": 'custom_attributes',
        "categories_attributes": 'categories_attributes',
        "segments": 'segments',
        "images_attributes": 'images_attributes'
    }

    def __init__(self,
                 active=None,
                 country=None,
                 description=None,
                 short_description=None,
                 disable_at=None,
                 enable_at=None,
                 episode=None,
                 season=None,
                 featured=None,
                 friendly_title=None,
                 keywords=None,
                 mature_content=None,
                 pass_required=None,
                 published_at=None,
                 subscription_required=None,
                 discovery_url=None,
                 custom_thumbnail_url=None,
                 subscription_ads_enabled=None,
                 title=None,
                 zobject_ids=None,
                 custom_attributes=None,
                 categories_attributes=None,
                 segments=None,
                 images_attributes=None):
        """Constructor for the Video class"""

        # Initialize members of the class
        self.active = active
        self.country = country
        self.description = description
        self.short_description = short_description
        self.disable_at = disable_at
        self.enable_at = enable_at
        self.episode = episode
        self.season = season
        self.featured = featured
        self.friendly_title = friendly_title
        self.keywords = keywords
        self.mature_content = mature_content
        self.pass_required = pass_required
        self.published_at = published_at
        self.subscription_required = subscription_required
        self.discovery_url = discovery_url
        self.custom_thumbnail_url = custom_thumbnail_url
        self.subscription_ads_enabled = subscription_ads_enabled
        self.title = title
        self.zobject_ids = zobject_ids
        self.custom_attributes = custom_attributes
        self.categories_attributes = categories_attributes
        self.segments = segments
        self.images_attributes = images_attributes

    @classmethod
    def from_dictionary(cls,
                        dictionary):
        """Creates an instance of this model from a dictionary

        Args:
            dictionary (dictionary): A dictionary representation of the object
            as obtained from the deserialization of the server's response. The
            keys MUST match property names in the API description.

        Returns:
            object: An instance of this structure class.

        """
        if dictionary is None:
            return None

        # Extract variables from the dictionary
        active = dictionary.get('active')
        country = dictionary.get('country')
        description = dictionary.get('description')
        short_description = dictionary.get('short_description')
        disable_at = dictionary.get('disable_at')
        enable_at = dictionary.get('enable_at')
        episode = dictionary.get('episode')
        season = dictionary.get('season')
        featured = dictionary.get('featured')
        friendly_title = dictionary.get('friendly_title')
        keywords = dictionary.get('keywords')
        mature_content = dictionary.get('mature_content')
        pass_required = dictionary.get('pass_required')
        published_at = dictionary.get('published_at')
        subscription_required = dictionary.get('subscription_required')
        discovery_url = dictionary.get('discovery_url')
        custom_thumbnail_url = dictionary.get('custom_thumbnail_url')
        subscription_ads_enabled = dictionary.get('subscription_ads_enabled')
        title = dictionary.get('title')
        zobject_ids = dictionary.get('zobject_ids')
        custom_attributes = dictionary.get('custom_attributes')
        categories_attributes = None
        if dictionary.get('categories_attributes') is not None:
            categories_attributes = [EmbeddedCategory.from_dictionary(x) for x in dictionary.get('categories_attributes')]
        segments = None
        if dictionary.get('segments') is not None:
            segments = [Segment.from_dictionary(x) for x in dictionary.get('segments')]
        images_attributes = None
        if dictionary.get('images_attributes') is not None:
            images_attributes = [Image.from_dictionary(x) for x in dictionary.get('images_attributes')]

        # Return an object of this model
        return cls(active,
                   country,
                   description,
                   short_description,
                   disable_at,
                   enable_at,
                   episode,
                   season,
                   featured,
                   friendly_title,
                   keywords,
                   mature_content,
                   pass_required,
                   published_at,
                   subscription_required,
                   discovery_url,
                   custom_thumbnail_url,
                   subscription_ads_enabled,
                   title,
                   zobject_ids,
                   custom_attributes,
                   categories_attributes,
                   segments,
                   images_attributes)
