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

"""
zypev1

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""


class PlaylistEntitlementMetadata(object):

    """Implementation of the 'PlaylistEntitlementMetadata' model.

    TODO: type model description here.

    Attributes:
        id (string): TODO: type description here.
        consumer_id (string): TODO: type description here.
        created_at (string): TODO: type description here.
        updated_at (string): TODO: type description here.
        video_title (string): TODO: type description here.
        expires_at (string): TODO: type description here.
        transaction_id (string): TODO: type description here.
        transaction_type (string): TODO: type description here.
        video_id (string): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "id": '_id',
        "consumer_id": 'consumer_id',
        "created_at": 'created_at',
        "updated_at": 'updated_at',
        "video_title": 'video_title',
        "expires_at": 'expires_at',
        "transaction_id": 'transaction_id',
        "transaction_type": 'transaction_type',
        "video_id": 'video_id'
    }

    def __init__(self,
                 id=None,
                 consumer_id=None,
                 created_at=None,
                 updated_at=None,
                 video_title=None,
                 expires_at=None,
                 transaction_id=None,
                 transaction_type=None,
                 video_id=None):
        """Constructor for the PlaylistEntitlementMetadata class"""

        # Initialize members of the class
        self.id = id
        self.consumer_id = consumer_id
        self.created_at = created_at
        self.updated_at = updated_at
        self.video_title = video_title
        self.expires_at = expires_at
        self.transaction_id = transaction_id
        self.transaction_type = transaction_type
        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
        id = dictionary.get('_id')
        consumer_id = dictionary.get('consumer_id')
        created_at = dictionary.get('created_at')
        updated_at = dictionary.get('updated_at')
        video_title = dictionary.get('video_title')
        expires_at = dictionary.get('expires_at')
        transaction_id = dictionary.get('transaction_id')
        transaction_type = dictionary.get('transaction_type')
        video_id = dictionary.get('video_id')

        # Return an object of this model
        return cls(id,
                   consumer_id,
                   created_at,
                   updated_at,
                   video_title,
                   expires_at,
                   transaction_id,
                   transaction_type,
                   video_id)
