# -*- 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
from zypev1.models.thumbnail import Thumbnail
from zypev1.models.zobject import Zobject


class VideoMetadata(object):

    """Implementation of the 'VideoMetadata' model.

    TODO: type model description here.

    Attributes:
        id (string): ID of the record
        created_at (string): Timestamp video was created
        deleted_at (string): Timestamp video was deleted
        updated_at (string): Timestamp of when video was last updated
        on_air (bool): TODO: type description here.
        purchase_price (float): Amount to purchase the video
        purchase_required (bool): Whether or not the video must be purchased
        rating (float): Overall rating of the video
        related_playlist_ids (list of float): IDs of related playlists
        rental_duration (float): Number of days video can be rented
        rental_price (float): Price to rent video
        rental_required (bool): TODO: type description here.
        request_count (float): Number of times a video has be requested
        site_id (string): Site the videos is related to
        status (string): Status of the video. Options are: - created - ready
        crunchyroll_id (string): ID of Crunchyroll source
        hulu_id (string): ID of Hulu source
        mrss_id (string): ID of MRSS source
        kaltura_id (string): ID of Kaltura source
        vimeo_id (string): ID of the Vimeo source
        youtube_id (string): ID of the YouTube source
        thumbnails (list of Thumbnail): TODO: type description here.
        transcoded (bool): TODO: type description here.
        video_zobjects (list of Zobject): TODO: type description here.
        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 = {
        "id": '_id',
        "created_at": 'created_at',
        "deleted_at": 'deleted_at',
        "updated_at": 'updated_at',
        "on_air": 'on_air',
        "purchase_price": 'purchase_price',
        "purchase_required": 'purchase_required',
        "rating": 'rating',
        "related_playlist_ids": 'related_playlist_ids',
        "rental_duration": 'rental_duration',
        "rental_price": 'rental_price',
        "rental_required": 'rental_required',
        "request_count": 'request_count',
        "site_id": 'site_id',
        "status": 'status',
        "crunchyroll_id": 'crunchyroll_id',
        "hulu_id": 'hulu_id',
        "mrss_id": 'mrss_id',
        "kaltura_id": 'kaltura_id',
        "vimeo_id": 'vimeo_id',
        "youtube_id": 'youtube_id',
        "thumbnails": 'thumbnails',
        "transcoded": 'transcoded',
        "video_zobjects": 'video_zobjects',
        "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,
                 id=None,
                 created_at=None,
                 deleted_at=None,
                 updated_at=None,
                 on_air=None,
                 purchase_price=None,
                 purchase_required=None,
                 rating=None,
                 related_playlist_ids=None,
                 rental_duration=None,
                 rental_price=None,
                 rental_required=None,
                 request_count=None,
                 site_id=None,
                 status=None,
                 crunchyroll_id=None,
                 hulu_id=None,
                 mrss_id=None,
                 kaltura_id=None,
                 vimeo_id=None,
                 youtube_id=None,
                 thumbnails=None,
                 transcoded=None,
                 video_zobjects=None,
                 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 VideoMetadata class"""

        # Initialize members of the class
        self.id = id
        self.created_at = created_at
        self.deleted_at = deleted_at
        self.updated_at = updated_at
        self.on_air = on_air
        self.purchase_price = purchase_price
        self.purchase_required = purchase_required
        self.rating = rating
        self.related_playlist_ids = related_playlist_ids
        self.rental_duration = rental_duration
        self.rental_price = rental_price
        self.rental_required = rental_required
        self.request_count = request_count
        self.site_id = site_id
        self.status = status
        self.crunchyroll_id = crunchyroll_id
        self.hulu_id = hulu_id
        self.mrss_id = mrss_id
        self.kaltura_id = kaltura_id
        self.vimeo_id = vimeo_id
        self.youtube_id = youtube_id
        self.thumbnails = thumbnails
        self.transcoded = transcoded
        self.video_zobjects = video_zobjects
        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
        id = dictionary.get('_id')
        created_at = dictionary.get('created_at')
        deleted_at = dictionary.get('deleted_at')
        updated_at = dictionary.get('updated_at')
        on_air = dictionary.get('on_air')
        purchase_price = dictionary.get('purchase_price')
        purchase_required = dictionary.get('purchase_required')
        rating = dictionary.get('rating')
        related_playlist_ids = dictionary.get('related_playlist_ids')
        rental_duration = dictionary.get('rental_duration')
        rental_price = dictionary.get('rental_price')
        rental_required = dictionary.get('rental_required')
        request_count = dictionary.get('request_count')
        site_id = dictionary.get('site_id')
        status = dictionary.get('status')
        crunchyroll_id = dictionary.get('crunchyroll_id')
        hulu_id = dictionary.get('hulu_id')
        mrss_id = dictionary.get('mrss_id')
        kaltura_id = dictionary.get('kaltura_id')
        vimeo_id = dictionary.get('vimeo_id')
        youtube_id = dictionary.get('youtube_id')
        thumbnails = None
        if dictionary.get('thumbnails') is not None:
            thumbnails = [Thumbnail.from_dictionary(x) for x in dictionary.get('thumbnails')]
        transcoded = dictionary.get('transcoded')
        video_zobjects = None
        if dictionary.get('video_zobjects') is not None:
            video_zobjects = [Zobject.from_dictionary(x) for x in dictionary.get('video_zobjects')]
        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(id,
                   created_at,
                   deleted_at,
                   updated_at,
                   on_air,
                   purchase_price,
                   purchase_required,
                   rating,
                   related_playlist_ids,
                   rental_duration,
                   rental_price,
                   rental_required,
                   request_count,
                   site_id,
                   status,
                   crunchyroll_id,
                   hulu_id,
                   mrss_id,
                   kaltura_id,
                   vimeo_id,
                   youtube_id,
                   thumbnails,
                   transcoded,
                   video_zobjects,
                   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)
