# coding: utf-8

"""
    Cherwell REST API

    Unofficial Python Cherwell REST API library.  # noqa: E501

    The version of the OpenAPI document: 9.3.2
    Contact: See AUTHORS.
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from pycherwell.configuration import Configuration


class Action(object):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    """
    Attributes:
      openapi_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.
    """
    openapi_types = {
        'action_command': 'str',
        'action_type': 'str',
        'always_text_and_image': 'bool',
        'begin_group': 'bool',
        'child_actions': 'list[Action]',
        'dependencies': 'list[str]',
        'display_text': 'str',
        'enabled': 'bool',
        'gallery_image': 'str',
        'help_text': 'str',
        'login_enabled_mode': 'str',
        'login_visibility_mode': 'str',
        'name': 'str',
        'parameters': 'list[KeyValuePairStringString]',
        'visible': 'bool'
    }

    attribute_map = {
        'action_command': 'actionCommand',
        'action_type': 'actionType',
        'always_text_and_image': 'alwaysTextAndImage',
        'begin_group': 'beginGroup',
        'child_actions': 'childActions',
        'dependencies': 'dependencies',
        'display_text': 'displayText',
        'enabled': 'enabled',
        'gallery_image': 'galleryImage',
        'help_text': 'helpText',
        'login_enabled_mode': 'loginEnabledMode',
        'login_visibility_mode': 'loginVisibilityMode',
        'name': 'name',
        'parameters': 'parameters',
        'visible': 'visible'
    }

    def __init__(self, action_command=None, action_type=None, always_text_and_image=None, begin_group=None, child_actions=None, dependencies=None, display_text=None, enabled=None, gallery_image=None, help_text=None, login_enabled_mode=None, login_visibility_mode=None, name=None, parameters=None, visible=None, local_vars_configuration=None):  # noqa: E501
        """Action - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._action_command = None
        self._action_type = None
        self._always_text_and_image = None
        self._begin_group = None
        self._child_actions = None
        self._dependencies = None
        self._display_text = None
        self._enabled = None
        self._gallery_image = None
        self._help_text = None
        self._login_enabled_mode = None
        self._login_visibility_mode = None
        self._name = None
        self._parameters = None
        self._visible = None
        self.discriminator = None

        if action_command is not None:
            self.action_command = action_command
        if action_type is not None:
            self.action_type = action_type
        if always_text_and_image is not None:
            self.always_text_and_image = always_text_and_image
        if begin_group is not None:
            self.begin_group = begin_group
        if child_actions is not None:
            self.child_actions = child_actions
        if dependencies is not None:
            self.dependencies = dependencies
        if display_text is not None:
            self.display_text = display_text
        if enabled is not None:
            self.enabled = enabled
        if gallery_image is not None:
            self.gallery_image = gallery_image
        if help_text is not None:
            self.help_text = help_text
        if login_enabled_mode is not None:
            self.login_enabled_mode = login_enabled_mode
        if login_visibility_mode is not None:
            self.login_visibility_mode = login_visibility_mode
        if name is not None:
            self.name = name
        if parameters is not None:
            self.parameters = parameters
        if visible is not None:
            self.visible = visible

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


        :return: The action_command of this Action.  # noqa: E501
        :rtype: str
        """
        return self._action_command

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


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

        self._action_command = action_command

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


        :return: The action_type of this Action.  # noqa: E501
        :rtype: str
        """
        return self._action_type

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


        :param action_type: The action_type of this Action.  # noqa: E501
        :type: str
        """
        allowed_values = ["None", "OneStep", "Command", "BuiltIn", "Category", "SearchGrp", "Report", "Dashboard", "Calendar", "Visualization", "Group", "Page", "DocRepository", "PortalCommand", "ActionCatalog", "OneStepForRecord"]  # noqa: E501
        if self.local_vars_configuration.client_side_validation and action_type not in allowed_values:  # noqa: E501
            raise ValueError(
                "Invalid value for `action_type` ({0}), must be one of {1}"  # noqa: E501
                .format(action_type, allowed_values)
            )

        self._action_type = action_type

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


        :return: The always_text_and_image of this Action.  # noqa: E501
        :rtype: bool
        """
        return self._always_text_and_image

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


        :param always_text_and_image: The always_text_and_image of this Action.  # noqa: E501
        :type: bool
        """

        self._always_text_and_image = always_text_and_image

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


        :return: The begin_group of this Action.  # noqa: E501
        :rtype: bool
        """
        return self._begin_group

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


        :param begin_group: The begin_group of this Action.  # noqa: E501
        :type: bool
        """

        self._begin_group = begin_group

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


        :return: The child_actions of this Action.  # noqa: E501
        :rtype: list[Action]
        """
        return self._child_actions

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


        :param child_actions: The child_actions of this Action.  # noqa: E501
        :type: list[Action]
        """

        self._child_actions = child_actions

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


        :return: The dependencies of this Action.  # noqa: E501
        :rtype: list[str]
        """
        return self._dependencies

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


        :param dependencies: The dependencies of this Action.  # noqa: E501
        :type: list[str]
        """

        self._dependencies = dependencies

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


        :return: The display_text of this Action.  # noqa: E501
        :rtype: str
        """
        return self._display_text

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


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

        self._display_text = display_text

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


        :return: The enabled of this Action.  # noqa: E501
        :rtype: bool
        """
        return self._enabled

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


        :param enabled: The enabled of this Action.  # noqa: E501
        :type: bool
        """

        self._enabled = enabled

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


        :return: The gallery_image of this Action.  # noqa: E501
        :rtype: str
        """
        return self._gallery_image

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


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

        self._gallery_image = gallery_image

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


        :return: The help_text of this Action.  # noqa: E501
        :rtype: str
        """
        return self._help_text

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


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

        self._help_text = help_text

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


        :return: The login_enabled_mode of this Action.  # noqa: E501
        :rtype: str
        """
        return self._login_enabled_mode

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


        :param login_enabled_mode: The login_enabled_mode of this Action.  # noqa: E501
        :type: str
        """
        allowed_values = ["Anonymous", "LoggedIn", "Both"]  # noqa: E501
        if self.local_vars_configuration.client_side_validation and login_enabled_mode not in allowed_values:  # noqa: E501
            raise ValueError(
                "Invalid value for `login_enabled_mode` ({0}), must be one of {1}"  # noqa: E501
                .format(login_enabled_mode, allowed_values)
            )

        self._login_enabled_mode = login_enabled_mode

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


        :return: The login_visibility_mode of this Action.  # noqa: E501
        :rtype: str
        """
        return self._login_visibility_mode

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


        :param login_visibility_mode: The login_visibility_mode of this Action.  # noqa: E501
        :type: str
        """
        allowed_values = ["Anonymous", "LoggedIn", "Both"]  # noqa: E501
        if self.local_vars_configuration.client_side_validation and login_visibility_mode not in allowed_values:  # noqa: E501
            raise ValueError(
                "Invalid value for `login_visibility_mode` ({0}), must be one of {1}"  # noqa: E501
                .format(login_visibility_mode, allowed_values)
            )

        self._login_visibility_mode = login_visibility_mode

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


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

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


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

        self._name = name

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


        :return: The parameters of this Action.  # noqa: E501
        :rtype: list[KeyValuePairStringString]
        """
        return self._parameters

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


        :param parameters: The parameters of this Action.  # noqa: E501
        :type: list[KeyValuePairStringString]
        """

        self._parameters = parameters

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


        :return: The visible of this Action.  # noqa: E501
        :rtype: bool
        """
        return self._visible

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


        :param visible: The visible of this Action.  # noqa: E501
        :type: bool
        """

        self._visible = visible

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

        for attr, _ in six.iteritems(self.openapi_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 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()
