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

"""
    weatherapi

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


class Astro(object):

    """Implementation of the 'Astro' model.

    TODO: type model description here.

    Attributes:
        sunrise (string): Sunrise time
        sunset (string): Sunset time
        moonrise (string): Moonrise time
        moonset (string): Moonset time

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "sunrise":'sunrise',
        "sunset":'sunset',
        "moonrise":'moonrise',
        "moonset":'moonset'
    }

    def __init__(self,
                 sunrise=None,
                 sunset=None,
                 moonrise=None,
                 moonset=None):
        """Constructor for the Astro class"""

        # Initialize members of the class
        self.sunrise = sunrise
        self.sunset = sunset
        self.moonrise = moonrise
        self.moonset = moonset


    @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
        sunrise = dictionary.get('sunrise')
        sunset = dictionary.get('sunset')
        moonrise = dictionary.get('moonrise')
        moonset = dictionary.get('moonset')

        # Return an object of this model
        return cls(sunrise,
                   sunset,
                   moonrise,
                   moonset)


