# coding: utf-8

"""
    AristaFlowREST/LicenceManager

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

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

import pprint
import re  # noqa: F401

import six
from af_licence_manager.models.ilm_exception import IlmException  # noqa: F401,E501

class ScriptException(IlmException):
    """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 = {
        'script_type': 'str',
        'script_name': 'str',
        'script_body': 'str'
    }
    if hasattr(IlmException, "swagger_types"):
        swagger_types.update(IlmException.swagger_types)

    attribute_map = {
        'script_type': 'scriptType',
        'script_name': 'scriptName',
        'script_body': 'scriptBody'
    }
    if hasattr(IlmException, "attribute_map"):
        attribute_map.update(IlmException.attribute_map)

    discriminator_value_class_map = {
          'ScriptEvaluationException': 'ScriptEvaluationException',
'ScriptEnvironmentException': 'ScriptEnvironmentException'    }

    def __init__(self, script_type=None, script_name=None, script_body=None, *args, **kwargs):  # noqa: E501
        """ScriptException - a model defined in Swagger"""  # noqa: E501
        self._script_type = None
        self._script_name = None
        self._script_body = None
        if not(hasattr(self, "discriminator")) or not(self.discriminator):
            self.discriminator = 'sub_class'
        self.script_type = script_type
        if script_name is not None:
            self.script_name = script_name
        self.script_body = script_body
        IlmException.__init__(self, *args, **kwargs)

    @property
    def script_type(self):
        """Gets the script_type of this ScriptException.  # noqa: E501


        :return: The script_type of this ScriptException.  # noqa: E501
        :rtype: str
        """
        return self._script_type

    @script_type.setter
    def script_type(self, script_type):
        """Sets the script_type of this ScriptException.


        :param script_type: The script_type of this ScriptException.  # noqa: E501
        :type: str
        """
        if script_type is None:
            raise ValueError("Invalid value for `script_type`, must not be `None`")  # noqa: E501

        self._script_type = script_type

    @property
    def script_name(self):
        """Gets the script_name of this ScriptException.  # noqa: E501


        :return: The script_name of this ScriptException.  # noqa: E501
        :rtype: str
        """
        return self._script_name

    @script_name.setter
    def script_name(self, script_name):
        """Sets the script_name of this ScriptException.


        :param script_name: The script_name of this ScriptException.  # noqa: E501
        :type: str
        """

        self._script_name = script_name

    @property
    def script_body(self):
        """Gets the script_body of this ScriptException.  # noqa: E501


        :return: The script_body of this ScriptException.  # noqa: E501
        :rtype: str
        """
        return self._script_body

    @script_body.setter
    def script_body(self, script_body):
        """Sets the script_body of this ScriptException.


        :param script_body: The script_body of this ScriptException.  # noqa: E501
        :type: str
        """
        if script_body is None:
            raise ValueError("Invalid value for `script_body`, must not be `None`")  # noqa: E501

        self._script_body = script_body

    def get_real_child_model(self, data):
        """Returns the real base class specified by the discriminator"""
        discriminator_value = data[self.attribute_map[self.discriminator]]
        return discriminator_value if not(self.__class__.__name__ == discriminator_value) else None

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

        for attr, _ in six.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
        if issubclass(ScriptException, dict):
            for key, value in self.items():
                result[key] = value

        return result

    def to_str(self):
        """Returns the string representation of the model"""
        return pprint.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, ScriptException):
            return False

        return self.__dict__ == other.__dict__

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