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

"""
ctddocumentation

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


class BaseTask(object):

    """Implementation of the 'BaseTask' model.

    TODO: type model description here.

    Attributes:
        allowed_days (string): A string that represents specific days in a
            week, Sunday being 0 and Friday being 6. To select more than a
            specific day just concatenate the day number to the string
        allowed_run_time_end (string): TODO: type description here.
        allowed_run_time_start (string): TODO: type description here.
        mtype (int): TODO: type description here.
        end_time (string): TODO: type description here.
        interval (string): TODO: type description here.
        is_recurring (bool): TODO: type description here.
        name (string): TODO: type description here.
        resource_id (string): TODO: type description here.
        site_id (float): TODO: type description here.
        status (string): TODO: type description here.
        valid (bool): TODO: type description here.
        start_time (string): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "allowed_days": 'allowed_days',
        "allowed_run_time_end": 'allowed_run_time_end',
        "allowed_run_time_start": 'allowed_run_time_start',
        "mtype": 'type',
        "end_time": 'end_time',
        "interval": 'interval',
        "is_recurring": 'is_recurring',
        "name": 'name',
        "resource_id": 'resource_id',
        "site_id": 'site_id',
        "status": 'status',
        "valid": 'valid',
        "start_time": 'start_time'
    }

    _optionals = [
        'allowed_days',
        'allowed_run_time_end',
        'allowed_run_time_start',
        'mtype',
        'end_time',
        'interval',
        'is_recurring',
        'name',
        'resource_id',
        'site_id',
        'status',
        'valid',
        'start_time',
    ]

    def __init__(self,
                 allowed_days=APIHelper.SKIP,
                 allowed_run_time_end=APIHelper.SKIP,
                 allowed_run_time_start=APIHelper.SKIP,
                 mtype=APIHelper.SKIP,
                 end_time=APIHelper.SKIP,
                 interval=APIHelper.SKIP,
                 is_recurring=APIHelper.SKIP,
                 name=APIHelper.SKIP,
                 resource_id=APIHelper.SKIP,
                 site_id=APIHelper.SKIP,
                 status=APIHelper.SKIP,
                 valid=APIHelper.SKIP,
                 start_time=APIHelper.SKIP):
        """Constructor for the BaseTask class"""

        # Initialize members of the class
        if allowed_days is not APIHelper.SKIP:
            self.allowed_days = allowed_days 
        if allowed_run_time_end is not APIHelper.SKIP:
            self.allowed_run_time_end = allowed_run_time_end 
        if allowed_run_time_start is not APIHelper.SKIP:
            self.allowed_run_time_start = allowed_run_time_start 
        if mtype is not APIHelper.SKIP:
            self.mtype = mtype 
        if end_time is not APIHelper.SKIP:
            self.end_time = end_time 
        if interval is not APIHelper.SKIP:
            self.interval = interval 
        if is_recurring is not APIHelper.SKIP:
            self.is_recurring = is_recurring 
        if name is not APIHelper.SKIP:
            self.name = name 
        if resource_id is not APIHelper.SKIP:
            self.resource_id = resource_id 
        if site_id is not APIHelper.SKIP:
            self.site_id = site_id 
        if status is not APIHelper.SKIP:
            self.status = status 
        if valid is not APIHelper.SKIP:
            self.valid = valid 
        if start_time is not APIHelper.SKIP:
            self.start_time = start_time 

    @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

        allowed_days = dictionary.get("allowed_days") if dictionary.get("allowed_days") else APIHelper.SKIP
        allowed_run_time_end = dictionary.get("allowed_run_time_end") if dictionary.get("allowed_run_time_end") else APIHelper.SKIP
        allowed_run_time_start = dictionary.get("allowed_run_time_start") if dictionary.get("allowed_run_time_start") else APIHelper.SKIP
        mtype = dictionary.get("type") if dictionary.get("type") else APIHelper.SKIP
        end_time = dictionary.get("end_time") if dictionary.get("end_time") else APIHelper.SKIP
        interval = dictionary.get("interval") if dictionary.get("interval") else APIHelper.SKIP
        is_recurring = dictionary.get("is_recurring") if "is_recurring" in dictionary.keys() else APIHelper.SKIP
        name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP
        resource_id = dictionary.get("resource_id") if dictionary.get("resource_id") else APIHelper.SKIP
        site_id = dictionary.get("site_id") if dictionary.get("site_id") else APIHelper.SKIP
        status = dictionary.get("status") if dictionary.get("status") else APIHelper.SKIP
        valid = dictionary.get("valid") if "valid" in dictionary.keys() else APIHelper.SKIP
        start_time = dictionary.get("start_time") if dictionary.get("start_time") else APIHelper.SKIP
        # Return an object of this model
        return cls(allowed_days,
                   allowed_run_time_end,
                   allowed_run_time_start,
                   mtype,
                   end_time,
                   interval,
                   is_recurring,
                   name,
                   resource_id,
                   site_id,
                   status,
                   valid,
                   start_time)
