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

"""
uexcorpapi

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


class Data11(object):

    """Implementation of the 'Data11' model.

    Attributes:
        attribute_name (str): The model property of type str.
        category_name (str): The model property of type str.
        date_added (str): The model property of type str.
        date_modified (str): The model property of type str.
        id (str): The model property of type str.
        id_category (str): The model property of type str.
        id_category_attribute (str): The model property of type str.
        id_item (str): The model property of type str.
        item_name (str): The model property of type str.
        item_uuid (str): The model property of type str.
        unit (str): The model property of type str.
        value (str): The model property of type str.
        additional_properties (Dict[str, Any]): The additional properties for
            the model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "attribute_name": 'attribute_name',
        "category_name": 'category_name',
        "date_added": 'date_added',
        "date_modified": 'date_modified',
        "id": 'id',
        "id_category": 'id_category',
        "id_category_attribute": 'id_category_attribute',
        "id_item": 'id_item',
        "item_name": 'item_name',
        "item_uuid": 'item_uuid',
        "unit": 'unit',
        "value": 'value'
    }

    def __init__(self,
                 attribute_name=None,
                 category_name=None,
                 date_added=None,
                 date_modified=None,
                 id=None,
                 id_category=None,
                 id_category_attribute=None,
                 id_item=None,
                 item_name=None,
                 item_uuid=None,
                 unit=None,
                 value=None,
                 additional_properties=None):
        """Constructor for the Data11 class"""

        # Initialize members of the class
        self.attribute_name = attribute_name 
        self.category_name = category_name 
        self.date_added = date_added 
        self.date_modified = date_modified 
        self.id = id 
        self.id_category = id_category 
        self.id_category_attribute = id_category_attribute 
        self.id_item = id_item 
        self.item_name = item_name 
        self.item_uuid = item_uuid 
        self.unit = unit 
        self.value = value 

        # Add additional model properties to the instance
        if additional_properties is None:
            additional_properties = {}
        self.additional_properties = additional_properties

    @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
        attribute_name = dictionary.get("attribute_name") if dictionary.get("attribute_name") else None
        category_name = dictionary.get("category_name") if dictionary.get("category_name") else None
        date_added = dictionary.get("date_added") if dictionary.get("date_added") else None
        date_modified = dictionary.get("date_modified") if dictionary.get("date_modified") else None
        id = dictionary.get("id") if dictionary.get("id") else None
        id_category = dictionary.get("id_category") if dictionary.get("id_category") else None
        id_category_attribute = dictionary.get("id_category_attribute") if dictionary.get("id_category_attribute") else None
        id_item = dictionary.get("id_item") if dictionary.get("id_item") else None
        item_name = dictionary.get("item_name") if dictionary.get("item_name") else None
        item_uuid = dictionary.get("item_uuid") if dictionary.get("item_uuid") else None
        unit = dictionary.get("unit") if dictionary.get("unit") else None
        value = dictionary.get("value") if dictionary.get("value") else None
        additional_properties = APIHelper.get_additional_properties(
            dictionary={k: v for k, v in dictionary.items() if k not in cls._names.values()},
            unboxing_function=lambda value: value)
        # Return an object of this model
        return cls(attribute_name,
                   category_name,
                   date_added,
                   date_modified,
                   id,
                   id_category,
                   id_category_attribute,
                   id_item,
                   item_name,
                   item_uuid,
                   unit,
                   value,
                   additional_properties)

    def __repr__(self):
        return (f'{self.__class__.__name__}('
                f'attribute_name={self.attribute_name!r}, '
                f'category_name={self.category_name!r}, '
                f'date_added={self.date_added!r}, '
                f'date_modified={self.date_modified!r}, '
                f'id={self.id!r}, '
                f'id_category={self.id_category!r}, '
                f'id_category_attribute={self.id_category_attribute!r}, '
                f'id_item={self.id_item!r}, '
                f'item_name={self.item_name!r}, '
                f'item_uuid={self.item_uuid!r}, '
                f'unit={self.unit!r}, '
                f'value={self.value!r}, '
                f'additional_properties={self.additional_properties!r})')

    def __str__(self):
        return (f'{self.__class__.__name__}('
                f'attribute_name={self.attribute_name!s}, '
                f'category_name={self.category_name!s}, '
                f'date_added={self.date_added!s}, '
                f'date_modified={self.date_modified!s}, '
                f'id={self.id!s}, '
                f'id_category={self.id_category!s}, '
                f'id_category_attribute={self.id_category_attribute!s}, '
                f'id_item={self.id_item!s}, '
                f'item_name={self.item_name!s}, '
                f'item_uuid={self.item_uuid!s}, '
                f'unit={self.unit!s}, '
                f'value={self.value!s}, '
                f'additional_properties={self.additional_properties!s})')
