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

"""
    test_meraki

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

import test_meraki.models.monday
import test_meraki.models.tuesday
import test_meraki.models.wednesday
import test_meraki.models.thursday
import test_meraki.models.friday
import test_meraki.models.saturday
import test_meraki.models.sunday

class Scheduling(object):

    """Implementation of the 'Scheduling' model.

    The schedule for the group policy. Schedules are applied to days of the
    week.

    Attributes:
        enabled (bool): Whether scheduling is enabled (true) or disabled
            (false). Defaults to false. If true, the schedule objects for each
            day of the week (monday - sunday) are parsed.
        monday (Monday): The schedule object for Monday.
        tuesday (Tuesday): The schedule object for Tuesday.
        wednesday (Wednesday): The schedule object for Wednesday.
        thursday (Thursday): The schedule object for Thursday.
        friday (Friday): The schedule object for Friday.
        saturday (Saturday): The schedule object for Saturday.
        sunday (Sunday): The schedule object for Sunday.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "enabled":'enabled',
        "monday":'monday',
        "tuesday":'tuesday',
        "wednesday":'wednesday',
        "thursday":'thursday',
        "friday":'friday',
        "saturday":'saturday',
        "sunday":'sunday'
    }

    def __init__(self,
                 enabled=None,
                 monday=None,
                 tuesday=None,
                 wednesday=None,
                 thursday=None,
                 friday=None,
                 saturday=None,
                 sunday=None):
        """Constructor for the Scheduling class"""

        # Initialize members of the class
        self.enabled = enabled
        self.monday = monday
        self.tuesday = tuesday
        self.wednesday = wednesday
        self.thursday = thursday
        self.friday = friday
        self.saturday = saturday
        self.sunday = sunday


    @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
        enabled = dictionary.get('enabled')
        monday = test_meraki.models.monday.Monday.from_dictionary(dictionary.get('monday')) if dictionary.get('monday') else None
        tuesday = test_meraki.models.tuesday.Tuesday.from_dictionary(dictionary.get('tuesday')) if dictionary.get('tuesday') else None
        wednesday = test_meraki.models.wednesday.Wednesday.from_dictionary(dictionary.get('wednesday')) if dictionary.get('wednesday') else None
        thursday = test_meraki.models.thursday.Thursday.from_dictionary(dictionary.get('thursday')) if dictionary.get('thursday') else None
        friday = test_meraki.models.friday.Friday.from_dictionary(dictionary.get('friday')) if dictionary.get('friday') else None
        saturday = test_meraki.models.saturday.Saturday.from_dictionary(dictionary.get('saturday')) if dictionary.get('saturday') else None
        sunday = test_meraki.models.sunday.Sunday.from_dictionary(dictionary.get('sunday')) if dictionary.get('sunday') else None

        # Return an object of this model
        return cls(enabled,
                   monday,
                   tuesday,
                   wednesday,
                   thursday,
                   friday,
                   saturday,
                   sunday)


