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

"""
    weatherapi

    This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
"""


class Condition(object):

    """Implementation of the 'Condition' model.

    TODO: type model description here.

    Attributes:
        text (string): Weather condition text
        icon (string): Weather icon url
        code (int): Weather condition unique code.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "text":'text',
        "icon":'icon',
        "code":'code'
    }

    def __init__(self,
                 text=None,
                 icon=None,
                 code=None):
        """Constructor for the Condition class"""

        # Initialize members of the class
        self.text = text
        self.icon = icon
        self.code = code


    @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
        text = dictionary.get('text')
        icon = dictionary.get('icon')
        code = dictionary.get('code')

        # Return an object of this model
        return cls(text,
                   icon,
                   code)


