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

"""
shelldatareportingapis

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


class FeeRuleProduct(object):

    """Implementation of the 'FeeRuleProduct' model.

    TODO: type model description here.

    Attributes:
        product_group_id (int): Product Group Id
        product_group_name (str): Product Group name
        product_code (str): Client Product Code
        product_id (int): Product Id
        product_name (str): Product name in English

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "product_group_id": 'ProductGroupId',
        "product_group_name": 'ProductGroupName',
        "product_code": 'ProductCode',
        "product_id": 'ProductId',
        "product_name": 'ProductName'
    }

    _optionals = [
        'product_group_id',
        'product_group_name',
        'product_code',
        'product_id',
        'product_name',
    ]

    _nullables = [
        'product_group_id',
        'product_group_name',
        'product_code',
        'product_id',
        'product_name',
    ]

    def __init__(self,
                 product_group_id=APIHelper.SKIP,
                 product_group_name=APIHelper.SKIP,
                 product_code=APIHelper.SKIP,
                 product_id=APIHelper.SKIP,
                 product_name=APIHelper.SKIP):
        """Constructor for the FeeRuleProduct class"""

        # Initialize members of the class
        if product_group_id is not APIHelper.SKIP:
            self.product_group_id = product_group_id 
        if product_group_name is not APIHelper.SKIP:
            self.product_group_name = product_group_name 
        if product_code is not APIHelper.SKIP:
            self.product_code = product_code 
        if product_id is not APIHelper.SKIP:
            self.product_id = product_id 
        if product_name is not APIHelper.SKIP:
            self.product_name = product_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 not isinstance(dictionary, dict) or dictionary is None:
            return None

        # Extract variables from the dictionary
        product_group_id = dictionary.get("ProductGroupId") if "ProductGroupId" in dictionary.keys() else APIHelper.SKIP
        product_group_name = dictionary.get("ProductGroupName") if "ProductGroupName" in dictionary.keys() else APIHelper.SKIP
        product_code = dictionary.get("ProductCode") if "ProductCode" in dictionary.keys() else APIHelper.SKIP
        product_id = dictionary.get("ProductId") if "ProductId" in dictionary.keys() else APIHelper.SKIP
        product_name = dictionary.get("ProductName") if "ProductName" in dictionary.keys() else APIHelper.SKIP
        # Return an object of this model
        return cls(product_group_id,
                   product_group_name,
                   product_code,
                   product_id,
                   product_name)
