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

"""
shelldatareportingapis

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""
from shelldatareportingapis.api_helper import APIHelper


class PricingHistory(object):

    """Implementation of the 'PricingHistory' model.

    TODO: type model description here.

    Attributes:
        from_date (str): Pricing History Period Start date and should be the
            first date of the month. Format: YYYYMMDD
        to_date (str): Pricing History Period end date and should be the last
            date of the period month. Format: YYYYMMDD
        fees_rule_id (int): Pricing History Period Fees Rule ID that is
            associated to the period of that associated payer.    Example: 8101
        fees_rule_description (str): Pricing History Period Fees Rule
            Description that is associated to the period of that associated
            payer.
        total_volume (float): Total Quantity for the Pricing History Period
            that is associated to that payer.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "from_date": 'FromDate',
        "to_date": 'ToDate',
        "fees_rule_id": 'FeesRuleID',
        "fees_rule_description": 'FeesRuleDescription',
        "total_volume": 'TotalVolume'
    }

    _optionals = [
        'from_date',
        'to_date',
        'fees_rule_id',
        'fees_rule_description',
        'total_volume',
    ]

    _nullables = [
        'from_date',
        'to_date',
        'fees_rule_id',
        'fees_rule_description',
        'total_volume',
    ]

    def __init__(self,
                 from_date=APIHelper.SKIP,
                 to_date=APIHelper.SKIP,
                 fees_rule_id=APIHelper.SKIP,
                 fees_rule_description=APIHelper.SKIP,
                 total_volume=APIHelper.SKIP):
        """Constructor for the PricingHistory class"""

        # Initialize members of the class
        if from_date is not APIHelper.SKIP:
            self.from_date = from_date 
        if to_date is not APIHelper.SKIP:
            self.to_date = to_date 
        if fees_rule_id is not APIHelper.SKIP:
            self.fees_rule_id = fees_rule_id 
        if fees_rule_description is not APIHelper.SKIP:
            self.fees_rule_description = fees_rule_description 
        if total_volume is not APIHelper.SKIP:
            self.total_volume = total_volume 

    @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 not isinstance(dictionary, dict) or dictionary is None:
            return None

        # Extract variables from the dictionary
        from_date = dictionary.get("FromDate") if "FromDate" in dictionary.keys() else APIHelper.SKIP
        to_date = dictionary.get("ToDate") if "ToDate" in dictionary.keys() else APIHelper.SKIP
        fees_rule_id = dictionary.get("FeesRuleID") if "FeesRuleID" in dictionary.keys() else APIHelper.SKIP
        fees_rule_description = dictionary.get("FeesRuleDescription") if "FeesRuleDescription" in dictionary.keys() else APIHelper.SKIP
        total_volume = dictionary.get("TotalVolume") if "TotalVolume" in dictionary.keys() else APIHelper.SKIP
        # Return an object of this model
        return cls(from_date,
                   to_date,
                   fees_rule_id,
                   fees_rule_description,
                   total_volume)
