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

"""
shelldatareportingapis

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


class MonthlyInvoiceTrend(object):

    """Implementation of the 'MonthlyInvoiceTrend' model.

    TODO: type model description here.

    Attributes:
        currency_code (str): ISO code of invoice currency.   Example: EUR
        currency_symbol (str): Symbol of invoice currency.   Example: €
        month (int): Month.
        total_net_amount (float): Total net amount invoiced in this month.
        total_vat_amount (float): Total VAT amount invoiced in this month.
        year (int): Year.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "currency_code": 'CurrencyCode',
        "currency_symbol": 'CurrencySymbol',
        "month": 'Month',
        "total_net_amount": 'TotalNetAmount',
        "total_vat_amount": 'TotalVATAmount',
        "year": 'Year'
    }

    _optionals = [
        'currency_code',
        'currency_symbol',
        'month',
        'total_net_amount',
        'total_vat_amount',
        'year',
    ]

    _nullables = [
        'currency_code',
        'currency_symbol',
        'month',
        'total_net_amount',
        'total_vat_amount',
        'year',
    ]

    def __init__(self,
                 currency_code=APIHelper.SKIP,
                 currency_symbol=APIHelper.SKIP,
                 month=APIHelper.SKIP,
                 total_net_amount=APIHelper.SKIP,
                 total_vat_amount=APIHelper.SKIP,
                 year=APIHelper.SKIP):
        """Constructor for the MonthlyInvoiceTrend class"""

        # Initialize members of the class
        if currency_code is not APIHelper.SKIP:
            self.currency_code = currency_code 
        if currency_symbol is not APIHelper.SKIP:
            self.currency_symbol = currency_symbol 
        if month is not APIHelper.SKIP:
            self.month = month 
        if total_net_amount is not APIHelper.SKIP:
            self.total_net_amount = total_net_amount 
        if total_vat_amount is not APIHelper.SKIP:
            self.total_vat_amount = total_vat_amount 
        if year is not APIHelper.SKIP:
            self.year = year 

    @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
        currency_code = dictionary.get("CurrencyCode") if "CurrencyCode" in dictionary.keys() else APIHelper.SKIP
        currency_symbol = dictionary.get("CurrencySymbol") if "CurrencySymbol" in dictionary.keys() else APIHelper.SKIP
        month = dictionary.get("Month") if "Month" in dictionary.keys() else APIHelper.SKIP
        total_net_amount = dictionary.get("TotalNetAmount") if "TotalNetAmount" in dictionary.keys() else APIHelper.SKIP
        total_vat_amount = dictionary.get("TotalVATAmount") if "TotalVATAmount" in dictionary.keys() else APIHelper.SKIP
        year = dictionary.get("Year") if "Year" in dictionary.keys() else APIHelper.SKIP
        # Return an object of this model
        return cls(currency_code,
                   currency_symbol,
                   month,
                   total_net_amount,
                   total_vat_amount,
                   year)
