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


class PlaylistMetadata(object):

    """Implementation of the 'PlaylistMetadata' model.

    TODO: type model description here.

    Attributes:
        id (string): ID of the record
        keywords (list of string): Keywords for a playlist
        created_at (string): Timestamp playlist was created
        deleted_at (string): Timestamp playlist was deleted
        updated_at (string): Timestamp of when video was last updated
        discovery_url (string): URL where you playlist can be discovered
        playlist_item_count (float): Number of videos in a playlist
        thumbnails (list of Thumbnail): TODO: type description here.
        active (bool): Whether or not the playlist is active true
        auto_remove_video_entitlements (bool): Automatically remove a
            customer's entitlement to view a video if it is removed from the
            playlist
        auto_update_video_entitlements (bool): Automatically update a
            customer's entitlement to view a video if it is added to the
            playlist
        description (string): Description of the playlist
        friendly_title (string): The URL friendly title of the playlist
        title (string): Title of the playlist
        playlist_type (string): Determine if videos will automatically be
            added to this playlist based off the category values assigned to
            them. If you would like this feature, set to 'category',
            otherwise, set to 'manual' to disable. If enabled, you may not
            manually add videos to this playlist. Options are: - manual -
            category
        match_type (string): Used to specify matching categories to a playlist
            by ALL category values or ANY category values - any - all
        parent_id (string): The parent playlist id. If this value is null, the
            playlist is a root playlist and can be used as the primary
            playlist within an app where all your other playlists and videos
            are nested under
        priority (float): The priority of the playlist related with its
            siblings. Playlists are ordered ascending by priority value
        purchase_price (float): Amount to purchase the playlist bundle
        purchase_required (bool): Whether or not the playlist must be
            purchased
        rental_duration (float): Number of days a playlist bundle can be
            rented
        rental_price (float): Price to rent the playlist bundle
        rental_required (bool): Whether or not the playlist bundle must be
            rented
        thumnbail_layout (string): Orientation of the playlist thumbnail
            Layout must be one of:     + landscape     + poster     + square
        site_id (string): Site the playlist is related to
        video_ids (object): IDs of videos that are associated with Playlist
        images (list of Image): TODO: type description here.
        categories (list of EmbeddedCategory): TODO: type description here.
        sort_options (list of SortOption): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "id": '_id',
        "keywords": '_keywords',
        "created_at": 'created_at',
        "deleted_at": 'deleted_at',
        "updated_at": 'updated_at',
        "discovery_url": 'discovery_url',
        "playlist_item_count": 'playlist_item_count',
        "thumbnails": 'thumbnails',
        "active": 'active',
        "auto_remove_video_entitlements": 'auto_remove_video_entitlements',
        "auto_update_video_entitlements": 'auto_update_video_entitlements',
        "description": 'description',
        "friendly_title": 'friendly_title',
        "title": 'title',
        "playlist_type": 'playlist_type',
        "match_type": 'match_type',
        "parent_id": 'parent_id',
        "priority": 'priority',
        "purchase_price": 'purchase_price',
        "purchase_required": 'purchase_required',
        "rental_duration": 'rental_duration',
        "rental_price": 'rental_price',
        "rental_required": 'rental_required',
        "thumnbail_layout": 'thumnbail_layout',
        "site_id": 'site_id',
        "video_ids": 'video_ids',
        "images": 'images',
        "categories": 'categories',
        "sort_options": 'sort_options'
    }

    def __init__(self,
                 id=None,
                 keywords=None,
                 created_at=None,
                 deleted_at=None,
                 updated_at=None,
                 discovery_url=None,
                 playlist_item_count=None,
                 thumbnails=None,
                 active=None,
                 auto_remove_video_entitlements=None,
                 auto_update_video_entitlements=None,
                 description=None,
                 friendly_title=None,
                 title=None,
                 playlist_type=None,
                 match_type=None,
                 parent_id=None,
                 priority=None,
                 purchase_price=None,
                 purchase_required=None,
                 rental_duration=None,
                 rental_price=None,
                 rental_required=None,
                 thumnbail_layout=None,
                 site_id=None,
                 video_ids=None,
                 images=None,
                 categories=None,
                 sort_options=None):
        """Constructor for the PlaylistMetadata class"""

        # Initialize members of the class
        self.id = id
        self.keywords = keywords
        self.created_at = created_at
        self.deleted_at = deleted_at
        self.updated_at = updated_at
        self.discovery_url = discovery_url
        self.playlist_item_count = playlist_item_count
        self.thumbnails = thumbnails
        self.active = active
        self.auto_remove_video_entitlements = auto_remove_video_entitlements
        self.auto_update_video_entitlements = auto_update_video_entitlements
        self.description = description
        self.friendly_title = friendly_title
        self.title = title
        self.playlist_type = playlist_type
        self.match_type = match_type
        self.parent_id = parent_id
        self.priority = priority
        self.purchase_price = purchase_price
        self.purchase_required = purchase_required
        self.rental_duration = rental_duration
        self.rental_price = rental_price
        self.rental_required = rental_required
        self.thumnbail_layout = thumnbail_layout
        self.site_id = site_id
        self.video_ids = video_ids
        self.images = images
        self.categories = categories
        self.sort_options = sort_options

    @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')
        keywords = dictionary.get('_keywords')
        created_at = dictionary.get('created_at')
        deleted_at = dictionary.get('deleted_at')
        updated_at = dictionary.get('updated_at')
        discovery_url = dictionary.get('discovery_url')
        playlist_item_count = dictionary.get('playlist_item_count')
        thumbnails = None
        if dictionary.get('thumbnails') is not None:
            thumbnails = [Thumbnail.from_dictionary(x) for x in dictionary.get('thumbnails')]
        active = dictionary.get('active')
        auto_remove_video_entitlements = dictionary.get('auto_remove_video_entitlements')
        auto_update_video_entitlements = dictionary.get('auto_update_video_entitlements')
        description = dictionary.get('description')
        friendly_title = dictionary.get('friendly_title')
        title = dictionary.get('title')
        playlist_type = dictionary.get('playlist_type')
        match_type = dictionary.get('match_type')
        parent_id = dictionary.get('parent_id')
        priority = dictionary.get('priority')
        purchase_price = dictionary.get('purchase_price')
        purchase_required = dictionary.get('purchase_required')
        rental_duration = dictionary.get('rental_duration')
        rental_price = dictionary.get('rental_price')
        rental_required = dictionary.get('rental_required')
        thumnbail_layout = dictionary.get('thumnbail_layout')
        site_id = dictionary.get('site_id')
        video_ids = dictionary.get('video_ids')
        images = None
        if dictionary.get('images') is not None:
            images = [Image.from_dictionary(x) for x in dictionary.get('images')]
        categories = None
        if dictionary.get('categories') is not None:
            categories = [EmbeddedCategory.from_dictionary(x) for x in dictionary.get('categories')]
        sort_options = None
        if dictionary.get('sort_options') is not None:
            sort_options = [SortOption.from_dictionary(x) for x in dictionary.get('sort_options')]

        # Return an object of this model
        return cls(id,
                   keywords,
                   created_at,
                   deleted_at,
                   updated_at,
                   discovery_url,
                   playlist_item_count,
                   thumbnails,
                   active,
                   auto_remove_video_entitlements,
                   auto_update_video_entitlements,
                   description,
                   friendly_title,
                   title,
                   playlist_type,
                   match_type,
                   parent_id,
                   priority,
                   purchase_price,
                   purchase_required,
                   rental_duration,
                   rental_price,
                   rental_required,
                   thumnbail_layout,
                   site_id,
                   video_ids,
                   images,
                   categories,
                   sort_options)
