# coding: utf-8

"""
    3blades API

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

    OpenAPI spec version: 1.0
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from pprint import pformat
from six import iteritems
import re


class ServerConfig(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """


    """
    Attributes:
      swagger_types (dict): The key is attribute name
                            and the value is attribute type.
      attribute_map (dict): The key is attribute name
                            and the value is json key in definition.
    """
    swagger_types = {
        'type': 'str',
        'script': 'str',
        'function': 'str',
        'command': 'str'
    }

    attribute_map = {
        'type': 'type',
        'script': 'script',
        'function': 'function',
        'command': 'command'
    }

    def __init__(self, type=None, script=None, function=None, command=None):
        """
        ServerConfig - a model defined in Swagger
        """

        self._type = None
        self._script = None
        self._function = None
        self._command = None

        if type is not None:
          self.type = type
        if script is not None:
          self.script = script
        if function is not None:
          self.function = function
        if command is not None:
          self.command = command

    @property
    def type(self):
        """
        Gets the type of this ServerConfig.
        Server type.

        :return: The type of this ServerConfig.
        :rtype: str
        """
        return self._type

    @type.setter
    def type(self, type):
        """
        Sets the type of this ServerConfig.
        Server type.

        :param type: The type of this ServerConfig.
        :type: str
        """
        allowed_values = ["jupyter", "restful", "cron"]
        if type not in allowed_values:
            raise ValueError(
                "Invalid value for `type` ({0}), must be one of {1}"
                .format(type, allowed_values)
            )

        self._type = type

    @property
    def script(self):
        """
        Gets the script of this ServerConfig.
        Server script file.

        :return: The script of this ServerConfig.
        :rtype: str
        """
        return self._script

    @script.setter
    def script(self, script):
        """
        Sets the script of this ServerConfig.
        Server script file.

        :param script: The script of this ServerConfig.
        :type: str
        """

        self._script = script

    @property
    def function(self):
        """
        Gets the function of this ServerConfig.
        Server function.

        :return: The function of this ServerConfig.
        :rtype: str
        """
        return self._function

    @function.setter
    def function(self, function):
        """
        Sets the function of this ServerConfig.
        Server function.

        :param function: The function of this ServerConfig.
        :type: str
        """

        self._function = function

    @property
    def command(self):
        """
        Gets the command of this ServerConfig.
        Command to run

        :return: The command of this ServerConfig.
        :rtype: str
        """
        return self._command

    @command.setter
    def command(self, command):
        """
        Sets the command of this ServerConfig.
        Command to run

        :param command: The command of this ServerConfig.
        :type: str
        """

        self._command = command

    def to_dict(self):
        """
        Returns the model properties as a dict
        """
        result = {}

        for attr, _ in iteritems(self.swagger_types):
            value = getattr(self, attr)
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
                    value
                ))
            elif hasattr(value, "to_dict"):
                result[attr] = value.to_dict()
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], item[1].to_dict())
                    if hasattr(item[1], "to_dict") else item,
                    value.items()
                ))
            else:
                result[attr] = value

        return result

    def to_str(self):
        """
        Returns the string representation of the model
        """
        return pformat(self.to_dict())

    def __repr__(self):
        """
        For `print` and `pprint`
        """
        return self.to_str()

    def __eq__(self, other):
        """
        Returns true if both objects are equal
        """
        if not isinstance(other, ServerConfig):
            return False

        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        """
        Returns true if both objects are not equal
        """
        return not self == other
