# coding: utf-8

"""
    Cyclos 4.11.5 API

    The REST API for Cyclos 4.11.5  # noqa: E501

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


import pprint
import re  # noqa: F401

import six

from swagger_client.configuration import Configuration


class Operation(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 = {
        'scope': 'OperationScopeEnum',
        'result_type': 'OperationResultTypeEnum',
        'icon': 'str',
        'label': 'str',
        'information_text': 'str',
        'confirmation_text': 'str',
        'require_confirmation_password': 'bool',
        'has_file_upload': 'bool',
        'allow_export': 'bool',
        'allow_print': 'bool',
        'missing_optional_parameters': 'list[str]',
        'missing_required_parameters': 'list[str]',
        'show_form_for_missing_optional_parameters': 'bool',
        'can_run_directly': 'bool'
    }

    attribute_map = {
        'scope': 'scope',
        'result_type': 'resultType',
        'icon': 'icon',
        'label': 'label',
        'information_text': 'informationText',
        'confirmation_text': 'confirmationText',
        'require_confirmation_password': 'requireConfirmationPassword',
        'has_file_upload': 'hasFileUpload',
        'allow_export': 'allowExport',
        'allow_print': 'allowPrint',
        'missing_optional_parameters': 'missingOptionalParameters',
        'missing_required_parameters': 'missingRequiredParameters',
        'show_form_for_missing_optional_parameters': 'showFormForMissingOptionalParameters',
        'can_run_directly': 'canRunDirectly'
    }

    def __init__(self, scope=None, result_type=None, icon=None, label=None, information_text=None, confirmation_text=None, require_confirmation_password=None, has_file_upload=None, allow_export=None, allow_print=None, missing_optional_parameters=None, missing_required_parameters=None, show_form_for_missing_optional_parameters=None, can_run_directly=None, _configuration=None):  # noqa: E501
        """Operation - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._scope = None
        self._result_type = None
        self._icon = None
        self._label = None
        self._information_text = None
        self._confirmation_text = None
        self._require_confirmation_password = None
        self._has_file_upload = None
        self._allow_export = None
        self._allow_print = None
        self._missing_optional_parameters = None
        self._missing_required_parameters = None
        self._show_form_for_missing_optional_parameters = None
        self._can_run_directly = None
        self.discriminator = None

        if scope is not None:
            self.scope = scope
        if result_type is not None:
            self.result_type = result_type
        if icon is not None:
            self.icon = icon
        if label is not None:
            self.label = label
        if information_text is not None:
            self.information_text = information_text
        if confirmation_text is not None:
            self.confirmation_text = confirmation_text
        if require_confirmation_password is not None:
            self.require_confirmation_password = require_confirmation_password
        if has_file_upload is not None:
            self.has_file_upload = has_file_upload
        if allow_export is not None:
            self.allow_export = allow_export
        if allow_print is not None:
            self.allow_print = allow_print
        if missing_optional_parameters is not None:
            self.missing_optional_parameters = missing_optional_parameters
        if missing_required_parameters is not None:
            self.missing_required_parameters = missing_required_parameters
        if show_form_for_missing_optional_parameters is not None:
            self.show_form_for_missing_optional_parameters = show_form_for_missing_optional_parameters
        if can_run_directly is not None:
            self.can_run_directly = can_run_directly

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

        The scope determines where does a custom operation can be executed Possible values are: * advertisement: A custom operation which is executed over an advertisement * bulkAction: A custom operation executed over a set of users (one at a time) * contact: A custom operation which is executed over a contact in a user's contact list * contactInfo: A custom operation which is executed over an additional contact information, which is part of the user profile * internal: A custom operation which is executed by another custom operation * menu: A custom operation which is visible in a custom menu item * record: A custom operation which is executed over a record * system: A general, system custom operation * transfer: A custom operation which is executed over a transfer * user: A custom operation over a single user   # noqa: E501

        :return: The scope of this Operation.  # noqa: E501
        :rtype: OperationScopeEnum
        """
        return self._scope

    @scope.setter
    def scope(self, scope):
        """Sets the scope of this Operation.

        The scope determines where does a custom operation can be executed Possible values are: * advertisement: A custom operation which is executed over an advertisement * bulkAction: A custom operation executed over a set of users (one at a time) * contact: A custom operation which is executed over a contact in a user's contact list * contactInfo: A custom operation which is executed over an additional contact information, which is part of the user profile * internal: A custom operation which is executed by another custom operation * menu: A custom operation which is visible in a custom menu item * record: A custom operation which is executed over a record * system: A general, system custom operation * transfer: A custom operation which is executed over a transfer * user: A custom operation over a single user   # noqa: E501

        :param scope: The scope of this Operation.  # noqa: E501
        :type: OperationScopeEnum
        """

        self._scope = scope

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

        The kind of data a custom operation execution is expected to return Possible values are: * externalRedirect: The main execution returns an URL for another service. Then a second execution is expected when this other service redirects the client back to Cyclos * fileDownload: Returns a file, which can be downloaded * notification: Returns a text to be displayed as a simple notification * plainText: Returns a plain text to be displayed in a page, and optionally printed * resultPage: Returns a page or list of results, which should be displayed in a table like any other search / list * richText: Returns an HTML formatted text to be displayed in a page, and optionally printed * url: The result should be an URL to which the client should be redirected to   # noqa: E501

        :return: The result_type of this Operation.  # noqa: E501
        :rtype: OperationResultTypeEnum
        """
        return self._result_type

    @result_type.setter
    def result_type(self, result_type):
        """Sets the result_type of this Operation.

        The kind of data a custom operation execution is expected to return Possible values are: * externalRedirect: The main execution returns an URL for another service. Then a second execution is expected when this other service redirects the client back to Cyclos * fileDownload: Returns a file, which can be downloaded * notification: Returns a text to be displayed as a simple notification * plainText: Returns a plain text to be displayed in a page, and optionally printed * resultPage: Returns a page or list of results, which should be displayed in a table like any other search / list * richText: Returns an HTML formatted text to be displayed in a page, and optionally printed * url: The result should be an URL to which the client should be redirected to   # noqa: E501

        :param result_type: The result_type of this Operation.  # noqa: E501
        :type: OperationResultTypeEnum
        """

        self._result_type = result_type

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

        The character that represents the icon in the Cyclos font  # noqa: E501

        :return: The icon of this Operation.  # noqa: E501
        :rtype: str
        """
        return self._icon

    @icon.setter
    def icon(self, icon):
        """Sets the icon of this Operation.

        The character that represents the icon in the Cyclos font  # noqa: E501

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

        self._icon = icon

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

        A representative label about the operation  # noqa: E501

        :return: The label of this Operation.  # noqa: E501
        :rtype: str
        """
        return self._label

    @label.setter
    def label(self, label):
        """Sets the label of this Operation.

        A representative label about the operation  # noqa: E501

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

        self._label = label

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

        A message to be displayed to the user when displaying the parameters form   # noqa: E501

        :return: The information_text of this Operation.  # noqa: E501
        :rtype: str
        """
        return self._information_text

    @information_text.setter
    def information_text(self, information_text):
        """Sets the information_text of this Operation.

        A message to be displayed to the user when displaying the parameters form   # noqa: E501

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

        self._information_text = information_text

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

        A message to be shown to the user in order to confirm the operation execution   # noqa: E501

        :return: The confirmation_text of this Operation.  # noqa: E501
        :rtype: str
        """
        return self._confirmation_text

    @confirmation_text.setter
    def confirmation_text(self, confirmation_text):
        """Sets the confirmation_text of this Operation.

        A message to be shown to the user in order to confirm the operation execution   # noqa: E501

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

        self._confirmation_text = confirmation_text

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

        Indicates whether this operation requires confirmation password   # noqa: E501

        :return: The require_confirmation_password of this Operation.  # noqa: E501
        :rtype: bool
        """
        return self._require_confirmation_password

    @require_confirmation_password.setter
    def require_confirmation_password(self, require_confirmation_password):
        """Sets the require_confirmation_password of this Operation.

        Indicates whether this operation requires confirmation password   # noqa: E501

        :param require_confirmation_password: The require_confirmation_password of this Operation.  # noqa: E501
        :type: bool
        """

        self._require_confirmation_password = require_confirmation_password

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

        Indicates whether this operation accepts a file upload as input   # noqa: E501

        :return: The has_file_upload of this Operation.  # noqa: E501
        :rtype: bool
        """
        return self._has_file_upload

    @has_file_upload.setter
    def has_file_upload(self, has_file_upload):
        """Sets the has_file_upload of this Operation.

        Indicates whether this operation accepts a file upload as input   # noqa: E501

        :param has_file_upload: The has_file_upload of this Operation.  # noqa: E501
        :type: bool
        """

        self._has_file_upload = has_file_upload

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

        Does this operation allows exporting the results as CSV? Only returned if `resultType` is `resultPage`   # noqa: E501

        :return: The allow_export of this Operation.  # noqa: E501
        :rtype: bool
        """
        return self._allow_export

    @allow_export.setter
    def allow_export(self, allow_export):
        """Sets the allow_export of this Operation.

        Does this operation allows exporting the results as CSV? Only returned if `resultType` is `resultPage`   # noqa: E501

        :param allow_export: The allow_export of this Operation.  # noqa: E501
        :type: bool
        """

        self._allow_export = allow_export

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

        Does this operation allows printing the results as PDF? Only returned if `resultType` is `resultPage`   # noqa: E501

        :return: The allow_print of this Operation.  # noqa: E501
        :rtype: bool
        """
        return self._allow_print

    @allow_print.setter
    def allow_print(self, allow_print):
        """Sets the allow_print of this Operation.

        Does this operation allows printing the results as PDF? Only returned if `resultType` is `resultPage`   # noqa: E501

        :param allow_print: The allow_print of this Operation.  # noqa: E501
        :type: bool
        """

        self._allow_print = allow_print

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

        The optional custom fields without a value. The front-end could opt-in to rely on the `showFormForMissingOptionalParameters` flag to wether show or not  an input form   # noqa: E501

        :return: The missing_optional_parameters of this Operation.  # noqa: E501
        :rtype: list[str]
        """
        return self._missing_optional_parameters

    @missing_optional_parameters.setter
    def missing_optional_parameters(self, missing_optional_parameters):
        """Sets the missing_optional_parameters of this Operation.

        The optional custom fields without a value. The front-end could opt-in to rely on the `showFormForMissingOptionalParameters` flag to wether show or not  an input form   # noqa: E501

        :param missing_optional_parameters: The missing_optional_parameters of this Operation.  # noqa: E501
        :type: list[str]
        """

        self._missing_optional_parameters = missing_optional_parameters

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

        The required custom fields without a value.  This means the operation will fail with a validation error if the parameters present in this list are not  given when run it   # noqa: E501

        :return: The missing_required_parameters of this Operation.  # noqa: E501
        :rtype: list[str]
        """
        return self._missing_required_parameters

    @missing_required_parameters.setter
    def missing_required_parameters(self, missing_required_parameters):
        """Sets the missing_required_parameters of this Operation.

        The required custom fields without a value.  This means the operation will fail with a validation error if the parameters present in this list are not  given when run it   # noqa: E501

        :param missing_required_parameters: The missing_required_parameters of this Operation.  # noqa: E501
        :type: list[str]
        """

        self._missing_required_parameters = missing_required_parameters

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

        Indicates whether a form to enter the missing optional parameters must be shown. Only returned if the `missingOptionalParameters` list is not empty and `scope` is  `internal`   # noqa: E501

        :return: The show_form_for_missing_optional_parameters of this Operation.  # noqa: E501
        :rtype: bool
        """
        return self._show_form_for_missing_optional_parameters

    @show_form_for_missing_optional_parameters.setter
    def show_form_for_missing_optional_parameters(self, show_form_for_missing_optional_parameters):
        """Sets the show_form_for_missing_optional_parameters of this Operation.

        Indicates whether a form to enter the missing optional parameters must be shown. Only returned if the `missingOptionalParameters` list is not empty and `scope` is  `internal`   # noqa: E501

        :param show_form_for_missing_optional_parameters: The show_form_for_missing_optional_parameters of this Operation.  # noqa: E501
        :type: bool
        """

        self._show_form_for_missing_optional_parameters = show_form_for_missing_optional_parameters

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

        (Deprecated) Indicates whether this operation can be executed directly, without showing a form page. More specifically, this flag is true if: * There are no confirmation text nor informational text * File upload is not allowed * Confirmation password is not required * All required parameters were set * All optional parametes were set or, if not, the option to show the form in case of missing parameters is false.   # noqa: E501

        :return: The can_run_directly of this Operation.  # noqa: E501
        :rtype: bool
        """
        return self._can_run_directly

    @can_run_directly.setter
    def can_run_directly(self, can_run_directly):
        """Sets the can_run_directly of this Operation.

        (Deprecated) Indicates whether this operation can be executed directly, without showing a form page. More specifically, this flag is true if: * There are no confirmation text nor informational text * File upload is not allowed * Confirmation password is not required * All required parameters were set * All optional parametes were set or, if not, the option to show the form in case of missing parameters is false.   # noqa: E501

        :param can_run_directly: The can_run_directly of this Operation.  # noqa: E501
        :type: bool
        """

        self._can_run_directly = can_run_directly

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

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