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

"""
billbeeapi

This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
"""
from billbeeapi.models.billbee_interfaces_billbee_api_model_article_api_custom_field_definition_model import BillbeeInterfacesBillbeeAPIModelArticleApiCustomFieldDefinitionModel


class BillbeeInterfacesBillbeeAPIModelArticleApiCustomFieldValueModel(object):

    """Implementation of the 'Billbee.Interfaces.BillbeeAPI.Model.ArticleApiCustomFieldValueModel' model.

    TODO: type model description here.

    Attributes:
        id (long|int): TODO: type description here.
        definition_id (long|int): TODO: type description here.
        definition
            (BillbeeInterfacesBillbeeAPIModelArticleApiCustomFieldDefinitionMod
            el): TODO: type description here.
        article_id (long|int): TODO: type description here.
        value (object): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "id": 'Id',
        "definition_id": 'DefinitionId',
        "definition": 'Definition',
        "article_id": 'ArticleId',
        "value": 'Value'
    }

    def __init__(self,
                 id=None,
                 definition_id=None,
                 definition=None,
                 article_id=None,
                 value=None):
        """Constructor for the BillbeeInterfacesBillbeeAPIModelArticleApiCustomFieldValueModel class"""

        # Initialize members of the class
        self.id = id
        self.definition_id = definition_id
        self.definition = definition
        self.article_id = article_id
        self.value = value

    @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 dictionary is None:
            return None

        # Extract variables from the dictionary
        id = dictionary.get('Id')
        definition_id = dictionary.get('DefinitionId')
        definition = BillbeeInterfacesBillbeeAPIModelArticleApiCustomFieldDefinitionModel.from_dictionary(dictionary.get('Definition')) if dictionary.get('Definition') else None
        article_id = dictionary.get('ArticleId')
        value = dictionary.get('Value')

        # Return an object of this model
        return cls(id,
                   definition_id,
                   definition,
                   article_id,
                   value)
