# coding: utf-8

"""
    MailSlurp API

    MailSlurp is an API for sending and receiving emails and SMS from dynamically allocated email addresses and phone numbers. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more.  ## Resources  - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://docs.mailslurp.com/) - [Examples](https://github.com/mailslurp/examples) repository  # noqa: E501

    The version of the OpenAPI document: 6.5.2
    Contact: contact@mailslurp.dev
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from mailslurp_client.configuration import Configuration


class CodeCandidate(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 = {
        'code': 'str',
        'confidence': 'float',
        'method': 'str',
        'source': 'str',
        'context': 'str'
    }

    attribute_map = {
        'code': 'code',
        'confidence': 'confidence',
        'method': 'method',
        'source': 'source',
        'context': 'context'
    }

    def __init__(self, code=None, confidence=None, method=None, source=None, context=None, local_vars_configuration=None):  # noqa: E501
        """CodeCandidate - 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._code = None
        self._confidence = None
        self._method = None
        self._source = None
        self._context = None
        self.discriminator = None

        self.code = code
        self.confidence = confidence
        self.method = method
        self.source = source
        self.context = context

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

        Extracted code value  # noqa: E501

        :return: The code of this CodeCandidate.  # noqa: E501
        :rtype: str
        """
        return self._code

    @code.setter
    def code(self, code):
        """Sets the code of this CodeCandidate.

        Extracted code value  # noqa: E501

        :param code: The code of this CodeCandidate.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and code is None:  # noqa: E501
            raise ValueError("Invalid value for `code`, must not be `None`")  # noqa: E501

        self._code = code

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

        Relative confidence score from 0 to 1  # noqa: E501

        :return: The confidence of this CodeCandidate.  # noqa: E501
        :rtype: float
        """
        return self._confidence

    @confidence.setter
    def confidence(self, confidence):
        """Sets the confidence of this CodeCandidate.

        Relative confidence score from 0 to 1  # noqa: E501

        :param confidence: The confidence of this CodeCandidate.  # noqa: E501
        :type: float
        """
        if self.local_vars_configuration.client_side_validation and confidence is None:  # noqa: E501
            raise ValueError("Invalid value for `confidence`, must not be `None`")  # noqa: E501

        self._confidence = confidence

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

        Extraction strategy for verification codes. Unsupported strategies may fall back when allowFallback is true.  # noqa: E501

        :return: The method of this CodeCandidate.  # noqa: E501
        :rtype: str
        """
        return self._method

    @method.setter
    def method(self, method):
        """Sets the method of this CodeCandidate.

        Extraction strategy for verification codes. Unsupported strategies may fall back when allowFallback is true.  # noqa: E501

        :param method: The method of this CodeCandidate.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and method is None:  # noqa: E501
            raise ValueError("Invalid value for `method`, must not be `None`")  # noqa: E501
        allowed_values = ["AUTO", "PATTERN", "LLM", "OCR", "OCR_THEN_LLM"]  # noqa: E501
        if self.local_vars_configuration.client_side_validation and method not in allowed_values:  # noqa: E501
            raise ValueError(
                "Invalid value for `method` ({0}), must be one of {1}"  # noqa: E501
                .format(method, allowed_values)
            )

        self._method = method

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

        Source fragment used for extraction, for example RAW_TEXT_PART or SMS_BODY  # noqa: E501

        :return: The source of this CodeCandidate.  # noqa: E501
        :rtype: str
        """
        return self._source

    @source.setter
    def source(self, source):
        """Sets the source of this CodeCandidate.

        Source fragment used for extraction, for example RAW_TEXT_PART or SMS_BODY  # noqa: E501

        :param source: The source of this CodeCandidate.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and source is None:  # noqa: E501
            raise ValueError("Invalid value for `source`, must not be `None`")  # noqa: E501

        self._source = source

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

        Nearby text context useful for debugging extraction decisions  # noqa: E501

        :return: The context of this CodeCandidate.  # noqa: E501
        :rtype: str
        """
        return self._context

    @context.setter
    def context(self, context):
        """Sets the context of this CodeCandidate.

        Nearby text context useful for debugging extraction decisions  # noqa: E501

        :param context: The context of this CodeCandidate.  # noqa: E501
        :type: str
        """

        self._context = context

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

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