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

"""
zypev1

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


class Entitlement(object):

    """Implementation of the 'entitlement' model.

    TODO: type model description here.

    Attributes:
        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 = {
        "expires_at": 'expires_at',
        "transaction_id": 'transaction_id',
        "transaction_type": 'transaction_type',
        "video_id": 'video_id'
    }

    def __init__(self,
                 expires_at=None,
                 transaction_id=None,
                 transaction_type=None,
                 video_id=None):
        """Constructor for the Entitlement class"""

        # Initialize members of the class
        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
        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(expires_at,
                   transaction_id,
                   transaction_type,
                   video_id)
