# coding: utf-8

"""
    Tekton

    Python SDK for Tekton Pipeline  # noqa: E501

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


import pprint
import re  # noqa: F401

import six

from tekton.models.v1_time import V1Time  # noqa: F401,E501


class V1beta1CloudEventDeliveryState(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 = {
        'condition': 'str',
        'message': 'str',
        'retry_count': 'int',
        'sent_at': 'V1Time'
    }

    attribute_map = {
        'condition': 'condition',
        'message': 'message',
        'retry_count': 'retryCount',
        'sent_at': 'sentAt'
    }

    def __init__(self, condition=None, message=None, retry_count=None, sent_at=None):  # noqa: E501
        """V1beta1CloudEventDeliveryState - a model defined in Swagger"""  # noqa: E501

        self._condition = None
        self._message = None
        self._retry_count = None
        self._sent_at = None
        self.discriminator = None

        if condition is not None:
            self.condition = condition
        self.message = message
        self.retry_count = retry_count
        if sent_at is not None:
            self.sent_at = sent_at

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

        Current status  # noqa: E501

        :return: The condition of this V1beta1CloudEventDeliveryState.  # noqa: E501
        :rtype: str
        """
        return self._condition

    @condition.setter
    def condition(self, condition):
        """Sets the condition of this V1beta1CloudEventDeliveryState.

        Current status  # noqa: E501

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

        self._condition = condition

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

        Error is the text of error (if any)  # noqa: E501

        :return: The message of this V1beta1CloudEventDeliveryState.  # noqa: E501
        :rtype: str
        """
        return self._message

    @message.setter
    def message(self, message):
        """Sets the message of this V1beta1CloudEventDeliveryState.

        Error is the text of error (if any)  # noqa: E501

        :param message: The message of this V1beta1CloudEventDeliveryState.  # noqa: E501
        :type: str
        """
        if message is None:
            raise ValueError("Invalid value for `message`, must not be `None`")  # noqa: E501

        self._message = message

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

        RetryCount is the number of attempts of sending the cloud event  # noqa: E501

        :return: The retry_count of this V1beta1CloudEventDeliveryState.  # noqa: E501
        :rtype: int
        """
        return self._retry_count

    @retry_count.setter
    def retry_count(self, retry_count):
        """Sets the retry_count of this V1beta1CloudEventDeliveryState.

        RetryCount is the number of attempts of sending the cloud event  # noqa: E501

        :param retry_count: The retry_count of this V1beta1CloudEventDeliveryState.  # noqa: E501
        :type: int
        """
        if retry_count is None:
            raise ValueError("Invalid value for `retry_count`, must not be `None`")  # noqa: E501

        self._retry_count = retry_count

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

        SentAt is the time at which the last attempt to send the event was made  # noqa: E501

        :return: The sent_at of this V1beta1CloudEventDeliveryState.  # noqa: E501
        :rtype: V1Time
        """
        return self._sent_at

    @sent_at.setter
    def sent_at(self, sent_at):
        """Sets the sent_at of this V1beta1CloudEventDeliveryState.

        SentAt is the time at which the last attempt to send the event was made  # noqa: E501

        :param sent_at: The sent_at of this V1beta1CloudEventDeliveryState.  # noqa: E501
        :type: V1Time
        """

        self._sent_at = sent_at

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

        return self.__dict__ == other.__dict__

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