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

"""
zypev1

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""
from zypev1.models.file_24 import File24
from zypev1.models.thumbnail import Thumbnail


class VideoImport(object):

    """Implementation of the 'VideoImport' model.

    TODO: type model description here.

    Attributes:
        title (string): TODO: type description here.
        video_source_id (string): TODO: type description here.
        id (string): ID of video import
        created_at (string): Timestamp video import was created
        deleted_at (string): Timestamp video was deleted
        updated_at (string): Timestamp of when video was last updated
        description (string): Description of the video import
        duration (float): Length of video import
        episode (float): Episode number
        expires_at (string): Timestamp of when video import expires
        files (list of File24): TODO: type description here.
        keywords (list of string): Keywords for the video import
        published_at (string): Timestamp when video from video import will be
            published
        season (float): TODO: type description here.
        site_id (string): TODO: type description here.
        starts_at (string): TODO: type description here.
        status (string): TODO: type description here.
        thumbnails (list of Thumbnail): TODO: type description here.
        upload_id (string): TODO: type description here.
        video_id (string): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "title": 'title',
        "video_source_id": 'video_source_id',
        "id": '_id',
        "created_at": 'created_at',
        "deleted_at": 'deleted_at',
        "updated_at": 'updated_at',
        "description": 'description',
        "duration": 'duration',
        "episode": 'episode',
        "expires_at": 'expires_at',
        "files": 'files',
        "keywords": 'keywords',
        "published_at": 'published_at',
        "season": 'season',
        "site_id": 'site_id',
        "starts_at": 'starts_at',
        "status": 'status',
        "thumbnails": 'thumbnails',
        "upload_id": 'upload_id',
        "video_id": 'video_id'
    }

    def __init__(self,
                 title=None,
                 video_source_id=None,
                 id=None,
                 created_at=None,
                 deleted_at=None,
                 updated_at=None,
                 description=None,
                 duration=None,
                 episode=None,
                 expires_at=None,
                 files=None,
                 keywords=None,
                 published_at=None,
                 season=None,
                 site_id=None,
                 starts_at=None,
                 status=None,
                 thumbnails=None,
                 upload_id=None,
                 video_id=None):
        """Constructor for the VideoImport class"""

        # Initialize members of the class
        self.title = title
        self.video_source_id = video_source_id
        self.id = id
        self.created_at = created_at
        self.deleted_at = deleted_at
        self.updated_at = updated_at
        self.description = description
        self.duration = duration
        self.episode = episode
        self.expires_at = expires_at
        self.files = files
        self.keywords = keywords
        self.published_at = published_at
        self.season = season
        self.site_id = site_id
        self.starts_at = starts_at
        self.status = status
        self.thumbnails = thumbnails
        self.upload_id = upload_id
        self.video_id = video_id

    @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
        title = dictionary.get('title')
        video_source_id = dictionary.get('video_source_id')
        id = dictionary.get('_id')
        created_at = dictionary.get('created_at')
        deleted_at = dictionary.get('deleted_at')
        updated_at = dictionary.get('updated_at')
        description = dictionary.get('description')
        duration = dictionary.get('duration')
        episode = dictionary.get('episode')
        expires_at = dictionary.get('expires_at')
        files = None
        if dictionary.get('files') is not None:
            files = [File24.from_dictionary(x) for x in dictionary.get('files')]
        keywords = dictionary.get('keywords')
        published_at = dictionary.get('published_at')
        season = dictionary.get('season')
        site_id = dictionary.get('site_id')
        starts_at = dictionary.get('starts_at')
        status = dictionary.get('status')
        thumbnails = None
        if dictionary.get('thumbnails') is not None:
            thumbnails = [Thumbnail.from_dictionary(x) for x in dictionary.get('thumbnails')]
        upload_id = dictionary.get('upload_id')
        video_id = dictionary.get('video_id')

        # Return an object of this model
        return cls(title,
                   video_source_id,
                   id,
                   created_at,
                   deleted_at,
                   updated_at,
                   description,
                   duration,
                   episode,
                   expires_at,
                   files,
                   keywords,
                   published_at,
                   season,
                   site_id,
                   starts_at,
                   status,
                   thumbnails,
                   upload_id,
                   video_id)
