# coding: utf-8

"""
    The Plaid API

    The Plaid REST API. Please see https://plaid.com/docs/api for more details.  # noqa: E501

    The version of the OpenAPI document: 2020-09-14_1.0.11
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from plaid.generated_plaid.configuration import Configuration


class ProductStatusBreakdown(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 = {
        'success': 'float',
        'error_plaid': 'float',
        'error_institution': 'float',
        'refresh_interval': 'str'
    }

    attribute_map = {
        'success': 'success',
        'error_plaid': 'error_plaid',
        'error_institution': 'error_institution',
        'refresh_interval': 'refresh_interval'
    }

    def __init__(self, success=None, error_plaid=None, error_institution=None, refresh_interval=None, local_vars_configuration=None):  # noqa: E501
        """ProductStatusBreakdown - 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._success = None
        self._error_plaid = None
        self._error_institution = None
        self._refresh_interval = None
        self.discriminator = None

        if success is not None:
            self.success = success
        if error_plaid is not None:
            self.error_plaid = error_plaid
        if error_institution is not None:
            self.error_institution = error_institution
        self.refresh_interval = refresh_interval

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

        The percentage of login attempts that are successful, expressed as a decimal.  # noqa: E501

        :return: The success of this ProductStatusBreakdown.  # noqa: E501
        :rtype: float
        """
        return self._success

    @success.setter
    def success(self, success):
        """Sets the success of this ProductStatusBreakdown.

        The percentage of login attempts that are successful, expressed as a decimal.  # noqa: E501

        :param success: The success of this ProductStatusBreakdown.  # noqa: E501
        :type success: float
        """

        self._success = success

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

        The percentage of logins that are failing due to an internal Plaid issue, expressed as a decimal.   # noqa: E501

        :return: The error_plaid of this ProductStatusBreakdown.  # noqa: E501
        :rtype: float
        """
        return self._error_plaid

    @error_plaid.setter
    def error_plaid(self, error_plaid):
        """Sets the error_plaid of this ProductStatusBreakdown.

        The percentage of logins that are failing due to an internal Plaid issue, expressed as a decimal.   # noqa: E501

        :param error_plaid: The error_plaid of this ProductStatusBreakdown.  # noqa: E501
        :type error_plaid: float
        """

        self._error_plaid = error_plaid

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

        The percentage of logins that are failing due to an issue in the institution's system, expressed as a decimal.  # noqa: E501

        :return: The error_institution of this ProductStatusBreakdown.  # noqa: E501
        :rtype: float
        """
        return self._error_institution

    @error_institution.setter
    def error_institution(self, error_institution):
        """Sets the error_institution of this ProductStatusBreakdown.

        The percentage of logins that are failing due to an issue in the institution's system, expressed as a decimal.  # noqa: E501

        :param error_institution: The error_institution of this ProductStatusBreakdown.  # noqa: E501
        :type error_institution: float
        """

        self._error_institution = error_institution

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

        The `refresh_interval` may be `DELAYED` or `STOPPED` even when the success rate is high. This value is only returned for Transactions status breakdowns.  # noqa: E501

        :return: The refresh_interval of this ProductStatusBreakdown.  # noqa: E501
        :rtype: str
        """
        return self._refresh_interval

    @refresh_interval.setter
    def refresh_interval(self, refresh_interval):
        """Sets the refresh_interval of this ProductStatusBreakdown.

        The `refresh_interval` may be `DELAYED` or `STOPPED` even when the success rate is high. This value is only returned for Transactions status breakdowns.  # noqa: E501

        :param refresh_interval: The refresh_interval of this ProductStatusBreakdown.  # noqa: E501
        :type refresh_interval: str
        """
        allowed_values = [None,"NORMAL", "DELAYED", "STOPPED"]  # noqa: E501
        if self.local_vars_configuration.client_side_validation and refresh_interval not in allowed_values:  # noqa: E501
            raise ValueError(
                "Invalid value for `refresh_interval` ({0}), must be one of {1}"  # noqa: E501
                .format(refresh_interval, allowed_values)
            )

        self._refresh_interval = refresh_interval

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

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