# coding: utf-8

"""
    Prompt.io APIs

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

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

import pprint
import re  # noqa: F401

import six

class AutomationModel(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 = {
        'id': 'int',
        'type': 'str',
        'presence_condition': 'str',
        'keywords': 'list[str]',
        'inactivity_condition': 'str',
        'inactivity_timeout': 'int',
        'flags': 'int',
        'all_channels': 'bool',
        'fulfillment': 'FulfillmentModel'
    }

    attribute_map = {
        'id': 'id',
        'type': 'type',
        'presence_condition': 'presenceCondition',
        'keywords': 'keywords',
        'inactivity_condition': 'inactivityCondition',
        'inactivity_timeout': 'inactivityTimeout',
        'flags': 'flags',
        'all_channels': 'allChannels',
        'fulfillment': 'fulfillment'
    }

    def __init__(self, id=None, type=None, presence_condition=None, keywords=None, inactivity_condition=None, inactivity_timeout=None, flags=None, all_channels=None, fulfillment=None):  # noqa: E501
        """AutomationModel - a model defined in Swagger"""  # noqa: E501
        self._id = None
        self._type = None
        self._presence_condition = None
        self._keywords = None
        self._inactivity_condition = None
        self._inactivity_timeout = None
        self._flags = None
        self._all_channels = None
        self._fulfillment = None
        self.discriminator = None
        if id is not None:
            self.id = id
        if type is not None:
            self.type = type
        if presence_condition is not None:
            self.presence_condition = presence_condition
        if keywords is not None:
            self.keywords = keywords
        if inactivity_condition is not None:
            self.inactivity_condition = inactivity_condition
        if inactivity_timeout is not None:
            self.inactivity_timeout = inactivity_timeout
        if flags is not None:
            self.flags = flags
        if all_channels is not None:
            self.all_channels = all_channels
        if fulfillment is not None:
            self.fulfillment = fulfillment

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

        The system generated unique id for this Automation.  # noqa: E501

        :return: The id of this AutomationModel.  # noqa: E501
        :rtype: int
        """
        return self._id

    @id.setter
    def id(self, id):
        """Sets the id of this AutomationModel.

        The system generated unique id for this Automation.  # noqa: E501

        :param id: The id of this AutomationModel.  # noqa: E501
        :type: int
        """

        self._id = id

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

        The type of the Automation.  # noqa: E501

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

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

        The type of the Automation.  # noqa: E501

        :param type: The type of this AutomationModel.  # noqa: E501
        :type: str
        """
        allowed_values = ["KEYWORD", "STOP", "START", "UNMATCHED_TEXT", "INBOUND_FILE", "UNSUPPORTED_OUTBOUND_MMS", "AUTHENTICATED_SMS", "FIRST_CONTACT", "CONVERSATION_INACTIVITY", "CONVERSATION_COMPLETE", "INBOUND_FROM_BLOCKED", "CHANNEL_APP"]  # noqa: E501
        if type not in allowed_values:
            raise ValueError(
                "Invalid value for `type` ({0}), must be one of {1}"  # noqa: E501
                .format(type, allowed_values)
            )

        self._type = type

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

        Defines whether the automation will apply depending on the presence and activity status of team members in the conversation with the customer.  # noqa: E501

        :return: The presence_condition of this AutomationModel.  # noqa: E501
        :rtype: str
        """
        return self._presence_condition

    @presence_condition.setter
    def presence_condition(self, presence_condition):
        """Sets the presence_condition of this AutomationModel.

        Defines whether the automation will apply depending on the presence and activity status of team members in the conversation with the customer.  # noqa: E501

        :param presence_condition: The presence_condition of this AutomationModel.  # noqa: E501
        :type: str
        """
        allowed_values = ["NO_AGENT", "INACTIVE_AGENTS", "ALWAYS"]  # noqa: E501
        if presence_condition not in allowed_values:
            raise ValueError(
                "Invalid value for `presence_condition` ({0}), must be one of {1}"  # noqa: E501
                .format(presence_condition, allowed_values)
            )

        self._presence_condition = presence_condition

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

        The list of keywords to match on an incoming message. Only used when type is KEYWORD.  # noqa: E501

        :return: The keywords of this AutomationModel.  # noqa: E501
        :rtype: list[str]
        """
        return self._keywords

    @keywords.setter
    def keywords(self, keywords):
        """Sets the keywords of this AutomationModel.

        The list of keywords to match on an incoming message. Only used when type is KEYWORD.  # noqa: E501

        :param keywords: The keywords of this AutomationModel.  # noqa: E501
        :type: list[str]
        """

        self._keywords = keywords

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

        Whether the inactivity timer will be reset by a message from the customer, team member or both. Only used when the type is CONVERSATION_INACTIVITY.  # noqa: E501

        :return: The inactivity_condition of this AutomationModel.  # noqa: E501
        :rtype: str
        """
        return self._inactivity_condition

    @inactivity_condition.setter
    def inactivity_condition(self, inactivity_condition):
        """Sets the inactivity_condition of this AutomationModel.

        Whether the inactivity timer will be reset by a message from the customer, team member or both. Only used when the type is CONVERSATION_INACTIVITY.  # noqa: E501

        :param inactivity_condition: The inactivity_condition of this AutomationModel.  # noqa: E501
        :type: str
        """
        allowed_values = ["TEAM_MEMBER", "CUSTOMER", "BOTH"]  # noqa: E501
        if inactivity_condition not in allowed_values:
            raise ValueError(
                "Invalid value for `inactivity_condition` ({0}), must be one of {1}"  # noqa: E501
                .format(inactivity_condition, allowed_values)
            )

        self._inactivity_condition = inactivity_condition

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

        The length of time since the last message until the conversation is deemed inactive. Only used when the type is CONVERSATION_INACTIVITY.  # noqa: E501

        :return: The inactivity_timeout of this AutomationModel.  # noqa: E501
        :rtype: int
        """
        return self._inactivity_timeout

    @inactivity_timeout.setter
    def inactivity_timeout(self, inactivity_timeout):
        """Sets the inactivity_timeout of this AutomationModel.

        The length of time since the last message until the conversation is deemed inactive. Only used when the type is CONVERSATION_INACTIVITY.  # noqa: E501

        :param inactivity_timeout: The inactivity_timeout of this AutomationModel.  # noqa: E501
        :type: int
        """

        self._inactivity_timeout = inactivity_timeout

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

        Flags further configuring the automation, depending on the automation type.  # noqa: E501

        :return: The flags of this AutomationModel.  # noqa: E501
        :rtype: int
        """
        return self._flags

    @flags.setter
    def flags(self, flags):
        """Sets the flags of this AutomationModel.

        Flags further configuring the automation, depending on the automation type.  # noqa: E501

        :param flags: The flags of this AutomationModel.  # noqa: E501
        :type: int
        """

        self._flags = flags

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

        If true, this automation will apply to all channels.  # noqa: E501

        :return: The all_channels of this AutomationModel.  # noqa: E501
        :rtype: bool
        """
        return self._all_channels

    @all_channels.setter
    def all_channels(self, all_channels):
        """Sets the all_channels of this AutomationModel.

        If true, this automation will apply to all channels.  # noqa: E501

        :param all_channels: The all_channels of this AutomationModel.  # noqa: E501
        :type: bool
        """

        self._all_channels = all_channels

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


        :return: The fulfillment of this AutomationModel.  # noqa: E501
        :rtype: FulfillmentModel
        """
        return self._fulfillment

    @fulfillment.setter
    def fulfillment(self, fulfillment):
        """Sets the fulfillment of this AutomationModel.


        :param fulfillment: The fulfillment of this AutomationModel.  # noqa: E501
        :type: FulfillmentModel
        """

        self._fulfillment = fulfillment

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

        return self.__dict__ == other.__dict__

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