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

"""
zypev1

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


class RedemptionCode45(object):

    """Implementation of the 'redemption_code45' model.

    TODO: type model description here.

    Attributes:
        code (string): TODO: type description here.
        expiration_date (string): TODO: type description here.
        video_id (string): TODO: type description here.
        pass_plan_id (string): TODO: type description here.
        plan_id (string): TODO: type description here.
        playlist_id (string): TODO: type description here.
        transaction_id (string): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "code": 'code',
        "expiration_date": 'expiration_date',
        "video_id": 'video_id',
        "pass_plan_id": 'pass_plan_id',
        "plan_id": 'plan_id',
        "playlist_id": 'playlist_id',
        "transaction_id": 'transaction_id'
    }

    def __init__(self,
                 code=None,
                 expiration_date=None,
                 video_id=None,
                 pass_plan_id=None,
                 plan_id=None,
                 playlist_id=None,
                 transaction_id=None):
        """Constructor for the RedemptionCode45 class"""

        # Initialize members of the class
        self.code = code
        self.expiration_date = expiration_date
        self.video_id = video_id
        self.pass_plan_id = pass_plan_id
        self.plan_id = plan_id
        self.playlist_id = playlist_id
        self.transaction_id = transaction_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
        code = dictionary.get('code')
        expiration_date = dictionary.get('expiration_date')
        video_id = dictionary.get('video_id')
        pass_plan_id = dictionary.get('pass_plan_id')
        plan_id = dictionary.get('plan_id')
        playlist_id = dictionary.get('playlist_id')
        transaction_id = dictionary.get('transaction_id')

        # Return an object of this model
        return cls(code,
                   expiration_date,
                   video_id,
                   pass_plan_id,
                   plan_id,
                   playlist_id,
                   transaction_id)
