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

"""
cookiesapi

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""
from cookiesapi.models.regular_hours import RegularHours


class Hours(object):

    """Implementation of the 'Hours' model.

    Describes regular and special store hours.

    Attributes:
        regular (list of RegularHours): Specifies regular store hours.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "regular": 'regular'
    }

    def __init__(self,
                 regular=None):
        """Constructor for the Hours class"""

        # Initialize members of the class
        self.regular = regular

    @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
        regular = None
        if dictionary.get('regular') is not None:
            regular = [RegularHours.from_dictionary(x) for x in dictionary.get('regular')]

        # Return an object of this model
        return cls(regular)
