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

"""
cookiesapi

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


class TimeSpec(object):

    """Implementation of the 'TimeSpec' model.

    Specifies a place in time in relative terms to the start of a given day.

    Attributes:
        hours (int): Hours value for this time specification.
        minutes (string): Minutes value for this time specification.

    """

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

    def __init__(self,
                 hours=None,
                 minutes=None):
        """Constructor for the TimeSpec class"""

        # Initialize members of the class
        self.hours = hours
        self.minutes = minutes

    @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
        hours = dictionary.get('hours')
        minutes = dictionary.get('minutes')

        # Return an object of this model
        return cls(hours,
                   minutes)
