# coding: utf-8

"""
    DigitalRebar Provision Server

    # An RestFUL API-driven Provisioner and DHCP server  # noqa: E501

    OpenAPI spec version: 4.14.0
    Contact: support@rackn.com
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from drppy_client.configuration import Configuration


class ElementAction(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 = {
        'action': 'str',
        'actual_version': 'str',
        'name': 'str',
        'replace_writable': 'bool',
        'type': 'str',
        'value': 'object',
        'version': 'str'
    }

    attribute_map = {
        'action': 'Action',
        'actual_version': 'ActualVersion',
        'name': 'Name',
        'replace_writable': 'ReplaceWritable',
        'type': 'Type',
        'value': 'Value',
        'version': 'Version'
    }

    def __init__(self, action=None, actual_version=None, name=None, replace_writable=None, type=None, value=None, version=None, _configuration=None):  # noqa: E501
        """ElementAction - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._action = None
        self._actual_version = None
        self._name = None
        self._replace_writable = None
        self._type = None
        self._value = None
        self._version = None
        self.discriminator = None

        if action is not None:
            self.action = action
        if actual_version is not None:
            self.actual_version = actual_version
        if name is not None:
            self.name = name
        if replace_writable is not None:
            self.replace_writable = replace_writable
        if type is not None:
            self.type = type
        if value is not None:
            self.value = value
        if version is not None:
            self.version = version

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

        Action defines what is to be done to this element. These can be Set for Pref, Global. These can be AddOrUpdate and Delete for the reset of the elements. This field is ignored for the DRP and DRPUX element.  It is assumed AddOrUpdate.  # noqa: E501

        :return: The action of this ElementAction.  # noqa: E501
        :rtype: str
        """
        return self._action

    @action.setter
    def action(self, action):
        """Sets the action of this ElementAction.

        Action defines what is to be done to this element. These can be Set for Pref, Global. These can be AddOrUpdate and Delete for the reset of the elements. This field is ignored for the DRP and DRPUX element.  It is assumed AddOrUpdate.  # noqa: E501

        :param action: The action of this ElementAction.  # noqa: E501
        :type: str
        """

        self._action = action

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

        ActualVersion is the actual catalog version referenced by this element. This is used for translating tip and stable into a real version. This is the source of the file element.  This can be a relative or absolute path or an URL.  # noqa: E501

        :return: The actual_version of this ElementAction.  # noqa: E501
        :rtype: str
        """
        return self._actual_version

    @actual_version.setter
    def actual_version(self, actual_version):
        """Sets the actual_version of this ElementAction.

        ActualVersion is the actual catalog version referenced by this element. This is used for translating tip and stable into a real version. This is the source of the file element.  This can be a relative or absolute path or an URL.  # noqa: E501

        :param actual_version: The actual_version of this ElementAction.  # noqa: E501
        :type: str
        """

        self._actual_version = actual_version

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

        Name defines the name of the element.  Normally, this is the name of the the DRP, DRPUX, filename, plugin, ContentPackage, or PluginProvider Name. For Global and Pref, these are the name of the global parameter or preference.  # noqa: E501

        :return: The name of this ElementAction.  # noqa: E501
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """Sets the name of this ElementAction.

        Name defines the name of the element.  Normally, this is the name of the the DRP, DRPUX, filename, plugin, ContentPackage, or PluginProvider Name. For Global and Pref, these are the name of the global parameter or preference.  # noqa: E501

        :param name: The name of this ElementAction.  # noqa: E501
        :type: str
        """

        self._name = name

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

        ReplaceWritable tells whether or not content packs should replace writable content Defaults to false.  # noqa: E501

        :return: The replace_writable of this ElementAction.  # noqa: E501
        :rtype: bool
        """
        return self._replace_writable

    @replace_writable.setter
    def replace_writable(self, replace_writable):
        """Sets the replace_writable of this ElementAction.

        ReplaceWritable tells whether or not content packs should replace writable content Defaults to false.  # noqa: E501

        :param replace_writable: The replace_writable of this ElementAction.  # noqa: E501
        :type: bool
        """

        self._replace_writable = replace_writable

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

        Type defines the type of element This can be: DRP, DRPUX, File, Global, Plugin, Pref, PluginProvider, ContentPackage  # noqa: E501

        :return: The type of this ElementAction.  # noqa: E501
        :rtype: str
        """
        return self._type

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

        Type defines the type of element This can be: DRP, DRPUX, File, Global, Plugin, Pref, PluginProvider, ContentPackage  # noqa: E501

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

        self._type = type

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

        Value defines what should be set or applied.  This field is used for the  plugin, pref, global, and file elements.  Plugin, Pref, and Global elements use this as the value for the element. File elements use this field to determine if it should be exploded.  # noqa: E501

        :return: The value of this ElementAction.  # noqa: E501
        :rtype: object
        """
        return self._value

    @value.setter
    def value(self, value):
        """Sets the value of this ElementAction.

        Value defines what should be set or applied.  This field is used for the  plugin, pref, global, and file elements.  Plugin, Pref, and Global elements use this as the value for the element. File elements use this field to determine if it should be exploded.  # noqa: E501

        :param value: The value of this ElementAction.  # noqa: E501
        :type: object
        """

        self._value = value

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

        Version defines the short or reference version of the element. e.g. tip, stable, v4.3.6  # noqa: E501

        :return: The version of this ElementAction.  # noqa: E501
        :rtype: str
        """
        return self._version

    @version.setter
    def version(self, version):
        """Sets the version of this ElementAction.

        Version defines the short or reference version of the element. e.g. tip, stable, v4.3.6  # noqa: E501

        :param version: The version of this ElementAction.  # noqa: E501
        :type: str
        """

        self._version = version

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

        return self.to_dict() == other.to_dict()

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

        return self.to_dict() != other.to_dict()
