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

"""
shelldatareportingapis

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


class CurrentVolume(object):

    """Implementation of the 'CurrentVolume' model.

    TODO: type model description here.

    Attributes:
        fee_rule_id (int): Bonus or association bonus configuration identifier
            that is associated to the payer
        fee_rule_description (str): Bonus or association bonus configuration
            description that is associated to the payer.
        month (int): Consumption(Volume) of the month.
        year (str): Consumption (Volume) of the year.
        total_volume (float): Total volume consumption for the month/year
            above.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "fee_rule_id": 'FeeRuleId',
        "fee_rule_description": 'FeeRuleDescription',
        "month": 'Month',
        "year": 'Year',
        "total_volume": 'TotalVolume'
    }

    _optionals = [
        'fee_rule_id',
        'fee_rule_description',
        'month',
        'year',
        'total_volume',
    ]

    _nullables = [
        'fee_rule_id',
        'fee_rule_description',
        'month',
        'year',
        'total_volume',
    ]

    def __init__(self,
                 fee_rule_id=APIHelper.SKIP,
                 fee_rule_description=APIHelper.SKIP,
                 month=APIHelper.SKIP,
                 year=APIHelper.SKIP,
                 total_volume=APIHelper.SKIP):
        """Constructor for the CurrentVolume class"""

        # Initialize members of the class
        if fee_rule_id is not APIHelper.SKIP:
            self.fee_rule_id = fee_rule_id 
        if fee_rule_description is not APIHelper.SKIP:
            self.fee_rule_description = fee_rule_description 
        if month is not APIHelper.SKIP:
            self.month = month 
        if year is not APIHelper.SKIP:
            self.year = year 
        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
        fee_rule_id = dictionary.get("FeeRuleId") if "FeeRuleId" in dictionary.keys() else APIHelper.SKIP
        fee_rule_description = dictionary.get("FeeRuleDescription") if "FeeRuleDescription" in dictionary.keys() else APIHelper.SKIP
        month = dictionary.get("Month") if "Month" in dictionary.keys() else APIHelper.SKIP
        year = dictionary.get("Year") if "Year" 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(fee_rule_id,
                   fee_rule_description,
                   month,
                   year,
                   total_volume)
