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

"""
shelldatareportingapis

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""
from shelldatareportingapis.api_helper import APIHelper


class CardDayTimeRestrictions(object):

    """Implementation of the 'CardDayTimeRestrictions' model.

    TODO: type model description here.

    Attributes:
        level (str): Describes at which level the restriction is set at. 
            Possible values:  OU = Restriction set at ColCo card type  
            Customer = Restriction set at customer card type
        monday (bool): Whether the transaction is allowed on Mondays or not.
        tuesday (bool): Whether the transaction is allowed on Tuesdays or not.
        wednesday (bool): Whether the transaction is allowed on Wednesdays or
            not.
        thursday (bool): Whether the transaction is allowed on Thursdays or
            not.
        friday (bool): Whether the transaction is allowed on Fridays or not.
        saturday (bool): Whether the transaction is allowed on Saturdays or
            not.
        sunday (bool): Whether the transaction is allowed on Sundays or not.
        time_from (str): The time in the day from when the transaction is
            allowed.  Format: HH:mm: ss  E.g., 21:00:00    Note:   1) The
            client application has to convert the value to the required
            date-time data type.  2) The value will be 00:00:00 when no
            restriction set for this field.
        time_to (str): allowed.  Format: HH:mm: ss  E.g., 21:00:00    Note:  
            1) The client application has to convert the value to the required
            date-time data type.  2) The value will be 00:00:00 when no
            restriction set for this field.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "level": 'Level',
        "monday": 'Monday',
        "tuesday": 'Tuesday',
        "wednesday": 'Wednesday',
        "thursday": 'Thursday',
        "friday": 'Friday',
        "saturday": 'Saturday',
        "sunday": 'Sunday',
        "time_from": 'TimeFrom',
        "time_to": 'TimeTo'
    }

    _optionals = [
        'level',
        'monday',
        'tuesday',
        'wednesday',
        'thursday',
        'friday',
        'saturday',
        'sunday',
        'time_from',
        'time_to',
    ]

    _nullables = [
        'level',
        'time_from',
        'time_to',
    ]

    def __init__(self,
                 level=APIHelper.SKIP,
                 monday=APIHelper.SKIP,
                 tuesday=APIHelper.SKIP,
                 wednesday=APIHelper.SKIP,
                 thursday=APIHelper.SKIP,
                 friday=APIHelper.SKIP,
                 saturday=APIHelper.SKIP,
                 sunday=APIHelper.SKIP,
                 time_from=APIHelper.SKIP,
                 time_to=APIHelper.SKIP):
        """Constructor for the CardDayTimeRestrictions class"""

        # Initialize members of the class
        if level is not APIHelper.SKIP:
            self.level = level 
        if monday is not APIHelper.SKIP:
            self.monday = monday 
        if tuesday is not APIHelper.SKIP:
            self.tuesday = tuesday 
        if wednesday is not APIHelper.SKIP:
            self.wednesday = wednesday 
        if thursday is not APIHelper.SKIP:
            self.thursday = thursday 
        if friday is not APIHelper.SKIP:
            self.friday = friday 
        if saturday is not APIHelper.SKIP:
            self.saturday = saturday 
        if sunday is not APIHelper.SKIP:
            self.sunday = sunday 
        if time_from is not APIHelper.SKIP:
            self.time_from = time_from 
        if time_to is not APIHelper.SKIP:
            self.time_to = time_to 

    @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 not isinstance(dictionary, dict) or dictionary is None:
            return None

        # Extract variables from the dictionary
        level = dictionary.get("Level") if "Level" in dictionary.keys() else APIHelper.SKIP
        monday = dictionary.get("Monday") if "Monday" in dictionary.keys() else APIHelper.SKIP
        tuesday = dictionary.get("Tuesday") if "Tuesday" in dictionary.keys() else APIHelper.SKIP
        wednesday = dictionary.get("Wednesday") if "Wednesday" in dictionary.keys() else APIHelper.SKIP
        thursday = dictionary.get("Thursday") if "Thursday" in dictionary.keys() else APIHelper.SKIP
        friday = dictionary.get("Friday") if "Friday" in dictionary.keys() else APIHelper.SKIP
        saturday = dictionary.get("Saturday") if "Saturday" in dictionary.keys() else APIHelper.SKIP
        sunday = dictionary.get("Sunday") if "Sunday" in dictionary.keys() else APIHelper.SKIP
        time_from = dictionary.get("TimeFrom") if "TimeFrom" in dictionary.keys() else APIHelper.SKIP
        time_to = dictionary.get("TimeTo") if "TimeTo" in dictionary.keys() else APIHelper.SKIP
        # Return an object of this model
        return cls(level,
                   monday,
                   tuesday,
                   wednesday,
                   thursday,
                   friday,
                   saturday,
                   sunday,
                   time_from,
                   time_to)
