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

"""
zypev1

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


class SubscriptionMetadata(object):

    """Implementation of the 'SubscriptionMetadata' model.

    TODO: type model description here.

    Attributes:
        id (string): ID of the record
        amount (string): TODO: type description here.
        created_at (string): TODO: type description here.
        currency (string): will match the Plan's currency
        current_period_end_at (string): TODO: type description here.
        current_period_start_at (string): TODO: type description here.
        discount_amount (float): TODO: type description here.
        discount_duration (string): TODO: type description here.
        discount_duration_months (float): TODO: type description here.
        discount_percent (float): TODO: type description here.
        mrr (float): TODO: type description here.
        plan_id (string): TODO: type description here.
        site_id (string): TODO: type description here.
        start_at (string): TODO: type description here.
        trial_period_days (float): TODO: type description here.
        updated_at (string): TODO: type description here.
        plan_name (string): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "id": '_id',
        "amount": 'amount',
        "created_at": 'created_at',
        "currency": 'currency',
        "current_period_end_at": 'current_period_end_at',
        "current_period_start_at": 'current_period_start_at',
        "discount_amount": 'discount_amount',
        "discount_duration": 'discount_duration',
        "discount_duration_months": 'discount_duration_months',
        "discount_percent": 'discount_percent',
        "mrr": 'mrr',
        "plan_id": 'plan_id',
        "site_id": 'site_id',
        "start_at": 'start_at',
        "trial_period_days": 'trial_period_days',
        "updated_at": 'updated_at',
        "plan_name": 'plan_name'
    }

    def __init__(self,
                 id=None,
                 amount=None,
                 created_at=None,
                 currency=None,
                 current_period_end_at=None,
                 current_period_start_at=None,
                 discount_amount=None,
                 discount_duration=None,
                 discount_duration_months=None,
                 discount_percent=None,
                 mrr=None,
                 plan_id=None,
                 site_id=None,
                 start_at=None,
                 trial_period_days=None,
                 updated_at=None,
                 plan_name=None):
        """Constructor for the SubscriptionMetadata class"""

        # Initialize members of the class
        self.id = id
        self.amount = amount
        self.created_at = created_at
        self.currency = currency
        self.current_period_end_at = current_period_end_at
        self.current_period_start_at = current_period_start_at
        self.discount_amount = discount_amount
        self.discount_duration = discount_duration
        self.discount_duration_months = discount_duration_months
        self.discount_percent = discount_percent
        self.mrr = mrr
        self.plan_id = plan_id
        self.site_id = site_id
        self.start_at = start_at
        self.trial_period_days = trial_period_days
        self.updated_at = updated_at
        self.plan_name = plan_name

    @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')
        amount = dictionary.get('amount')
        created_at = dictionary.get('created_at')
        currency = dictionary.get('currency')
        current_period_end_at = dictionary.get('current_period_end_at')
        current_period_start_at = dictionary.get('current_period_start_at')
        discount_amount = dictionary.get('discount_amount')
        discount_duration = dictionary.get('discount_duration')
        discount_duration_months = dictionary.get('discount_duration_months')
        discount_percent = dictionary.get('discount_percent')
        mrr = dictionary.get('mrr')
        plan_id = dictionary.get('plan_id')
        site_id = dictionary.get('site_id')
        start_at = dictionary.get('start_at')
        trial_period_days = dictionary.get('trial_period_days')
        updated_at = dictionary.get('updated_at')
        plan_name = dictionary.get('plan_name')

        # Return an object of this model
        return cls(id,
                   amount,
                   created_at,
                   currency,
                   current_period_end_at,
                   current_period_start_at,
                   discount_amount,
                   discount_duration,
                   discount_duration_months,
                   discount_percent,
                   mrr,
                   plan_id,
                   site_id,
                   start_at,
                   trial_period_days,
                   updated_at,
                   plan_name)
