# coding: utf-8

"""
    Octopus Server API

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

    OpenAPI spec version: 2019.6.7+Branch.tags-2019.6.7.Sha.aa18dc6809953218c66f57eff7d26481d9b23d6a
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six


class MachineScriptPolicy(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 = {
        'run_type': 'str',
        'script_body': 'str'
    }

    attribute_map = {
        'run_type': 'RunType',
        'script_body': 'ScriptBody'
    }

    def __init__(self, run_type=None, script_body=None):  # noqa: E501
        """MachineScriptPolicy - a model defined in Swagger"""  # noqa: E501

        self._run_type = None
        self._script_body = None
        self.discriminator = None

        if run_type is not None:
            self.run_type = run_type
        if script_body is not None:
            self.script_body = script_body

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


        :return: The run_type of this MachineScriptPolicy.  # noqa: E501
        :rtype: str
        """
        return self._run_type

    @run_type.setter
    def run_type(self, run_type):
        """Sets the run_type of this MachineScriptPolicy.


        :param run_type: The run_type of this MachineScriptPolicy.  # noqa: E501
        :type: str
        """
        allowed_values = ["InheritFromDefault", "Inline", "OnlyConnectivity"]  # noqa: E501
        if run_type not in allowed_values:
            raise ValueError(
                "Invalid value for `run_type` ({0}), must be one of {1}"  # noqa: E501
                .format(run_type, allowed_values)
            )

        self._run_type = run_type

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


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

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


        :param script_body: The script_body of this MachineScriptPolicy.  # noqa: E501
        :type: str
        """

        self._script_body = script_body

    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(MachineScriptPolicy, 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, MachineScriptPolicy):
            return False

        return self.__dict__ == other.__dict__

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