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

"""
    weatherapi

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


class SearchJsonResponse(object):

    """Implementation of the 'SearchJson Response' model.

    TODO: type model description here.

    Attributes:
        id (int): TODO: type description here.
        name (string): Local area name.
        region (string): Local area region.
        country (string): Country
        lat (float): Area latitude
        lon (float): Area longitude
        url (string): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "id":'id',
        "name":'name',
        "region":'region',
        "country":'country',
        "lat":'lat',
        "lon":'lon',
        "url":'url'
    }

    def __init__(self,
                 id=None,
                 name=None,
                 region=None,
                 country=None,
                 lat=None,
                 lon=None,
                 url=None):
        """Constructor for the SearchJsonResponse class"""

        # Initialize members of the class
        self.id = id
        self.name = name
        self.region = region
        self.country = country
        self.lat = lat
        self.lon = lon
        self.url = url


    @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')
        name = dictionary.get('name')
        region = dictionary.get('region')
        country = dictionary.get('country')
        lat = dictionary.get('lat')
        lon = dictionary.get('lon')
        url = dictionary.get('url')

        # Return an object of this model
        return cls(id,
                   name,
                   region,
                   country,
                   lat,
                   lon,
                   url)


