# 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 Action(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 = {
        'command': 'str',
        'command_set': 'str',
        'job': 'str',
        'model': 'object',
        'params': 'dict(str, object)',
        'plugin': 'str'
    }

    attribute_map = {
        'command': 'Command',
        'command_set': 'CommandSet',
        'job': 'Job',
        'model': 'Model',
        'params': 'Params',
        'plugin': 'Plugin'
    }

    def __init__(self, command=None, command_set=None, job=None, model=None, params=None, plugin=None, _configuration=None):  # noqa: E501
        """Action - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._command = None
        self._command_set = None
        self._job = None
        self._model = None
        self._params = None
        self._plugin = None
        self.discriminator = None

        if command is not None:
            self.command = command
        if command_set is not None:
            self.command_set = command_set
        if job is not None:
            self.job = job
        if model is not None:
            self.model = model
        if params is not None:
            self.params = params
        if plugin is not None:
            self.plugin = plugin

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

        Command is the command within the plugin  # noqa: E501

        :return: The command of this Action.  # noqa: E501
        :rtype: str
        """
        return self._command

    @command.setter
    def command(self, command):
        """Sets the command of this Action.

        Command is the command within the plugin  # noqa: E501

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

        self._command = command

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

        CommandSet is the scope of the commands (usually the model's Prefix) e.g. machines  # noqa: E501

        :return: The command_set of this Action.  # noqa: E501
        :rtype: str
        """
        return self._command_set

    @command_set.setter
    def command_set(self, command_set):
        """Sets the command_set of this Action.

        CommandSet is the scope of the commands (usually the model's Prefix) e.g. machines  # noqa: E501

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

        self._command_set = command_set

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

        Job contains the job created to track this action  # noqa: E501

        :return: The job of this Action.  # noqa: E501
        :rtype: str
        """
        return self._job

    @job.setter
    def job(self, job):
        """Sets the job of this Action.

        Job contains the job created to track this action  # noqa: E501

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

        self._job = job

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

        Model is the object being acted upon  # noqa: E501

        :return: The model of this Action.  # noqa: E501
        :rtype: object
        """
        return self._model

    @model.setter
    def model(self, model):
        """Sets the model of this Action.

        Model is the object being acted upon  # noqa: E501

        :param model: The model of this Action.  # noqa: E501
        :type: object
        """

        self._model = model

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

        Params contains additional parameters that the action should operate from  # noqa: E501

        :return: The params of this Action.  # noqa: E501
        :rtype: dict(str, object)
        """
        return self._params

    @params.setter
    def params(self, params):
        """Sets the params of this Action.

        Params contains additional parameters that the action should operate from  # noqa: E501

        :param params: The params of this Action.  # noqa: E501
        :type: dict(str, object)
        """

        self._params = params

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

        Plugin is the handler of this action  # noqa: E501

        :return: The plugin of this Action.  # noqa: E501
        :rtype: str
        """
        return self._plugin

    @plugin.setter
    def plugin(self, plugin):
        """Sets the plugin of this Action.

        Plugin is the handler of this action  # noqa: E501

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

        self._plugin = plugin

    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(Action, 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, Action):
            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, Action):
            return True

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